public class BatchCompactOperator<T> extends org.apache.flink.streaming.api.operators.AbstractStreamOperator<CompactMessages.CompactOutput> implements org.apache.flink.streaming.api.operators.OneInputStreamOperator<CompactMessages.CoordinatorOutput,CompactMessages.CompactOutput>, org.apache.flink.streaming.api.operators.BoundedOneInput
CompactOperator but skip some unnecessary
operations in batch mode.
Note: if the size of the files to be compacted is 1, this operator won't do anything and just emit the file to downstream. Also, the name of the files to be compacted is not a hidden file, it's expected these files are in hidden or temporary directory. Please make sure it. This assumption can help skip rename hidden file.
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTEMPT_PREFIX |
static String |
COMPACTED_PREFIX |
static String |
UNCOMPACTED_PREFIX |
| Constructor and Description |
|---|
BatchCompactOperator(org.apache.flink.util.function.SupplierWithException<org.apache.flink.core.fs.FileSystem,IOException> fsFactory,
CompactReader.Factory<T> readerFactory,
CompactWriter.Factory<T> writerFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static org.apache.flink.core.fs.Path |
convertFromUncompacted(org.apache.flink.core.fs.Path path) |
void |
endInput() |
void |
open() |
void |
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<CompactMessages.CoordinatorOutput> element) |
finish, getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, setup, snapshotState, snapshotState, useSplittableTimersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetKeyContextElementfinish, getMetricGroup, getOperatorAttributes, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotStatenotifyCheckpointAborted, notifyCheckpointCompletegetCurrentKey, setCurrentKeypublic static final String UNCOMPACTED_PREFIX
public static final String COMPACTED_PREFIX
public static final String ATTEMPT_PREFIX
public BatchCompactOperator(org.apache.flink.util.function.SupplierWithException<org.apache.flink.core.fs.FileSystem,IOException> fsFactory, CompactReader.Factory<T> readerFactory, CompactWriter.Factory<T> writerFactory)
public void open()
throws Exception
open in interface org.apache.flink.streaming.api.operators.StreamOperator<CompactMessages.CompactOutput>open in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<CompactMessages.CompactOutput>Exceptionpublic void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<CompactMessages.CoordinatorOutput> element) throws Exception
processElement in interface org.apache.flink.streaming.api.operators.Input<CompactMessages.CoordinatorOutput>Exceptionpublic void endInput()
throws Exception
endInput in interface org.apache.flink.streaming.api.operators.BoundedOneInputExceptionpublic void close()
throws Exception
close in interface org.apache.flink.streaming.api.operators.StreamOperator<CompactMessages.CompactOutput>close in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<CompactMessages.CompactOutput>Exceptionpublic static org.apache.flink.core.fs.Path convertFromUncompacted(org.apache.flink.core.fs.Path path)
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.