@Internal public class CompactCoordinator extends org.apache.flink.streaming.api.operators.AbstractStreamOperator<CompactMessages.CoordinatorOutput> implements org.apache.flink.streaming.api.operators.OneInputStreamOperator<CompactMessages.CoordinatorInput,CompactMessages.CoordinatorOutput>
CompactMessages.CompactionUnit and CompactMessages.EndCompaction must be sent to the downstream in an orderly
manner, while CompactMessages.EndCompaction is broadcast emitting, so unit and endCompaction use the
broadcast emitting mechanism together. Since unit is broadcast, we want it to be processed by a
single task, so we carry the ID in the unit and let the downstream task select its own unit.
NOTE: The coordination is a stable algorithm, which can ensure that the downstream can perform compaction at any time without worrying about fail over.
STATE: This operator stores input files in state, after the checkpoint completes successfully, input files are taken out from the state for coordination.
| Constructor and Description |
|---|
CompactCoordinator(org.apache.flink.util.function.SupplierWithException<org.apache.flink.core.fs.FileSystem,IOException> fsFactory,
long targetFileSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
initializeState(org.apache.flink.runtime.state.StateInitializationContext context) |
void |
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<CompactMessages.CoordinatorInput> element) |
void |
snapshotState(org.apache.flink.runtime.state.StateSnapshotContext context) |
close, 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, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, open, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, setup, snapshotState, useSplittableTimersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetKeyContextElementclose, finish, getMetricGroup, getOperatorAttributes, getOperatorID, initializeState, open, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotStatenotifyCheckpointAborted, notifyCheckpointCompletegetCurrentKey, setCurrentKeypublic CompactCoordinator(org.apache.flink.util.function.SupplierWithException<org.apache.flink.core.fs.FileSystem,IOException> fsFactory, long targetFileSize)
public void initializeState(org.apache.flink.runtime.state.StateInitializationContext context)
throws Exception
initializeState in interface org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperatorinitializeState in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<CompactMessages.CoordinatorOutput>Exceptionpublic void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<CompactMessages.CoordinatorInput> element) throws Exception
processElement in interface org.apache.flink.streaming.api.operators.Input<CompactMessages.CoordinatorInput>Exceptionpublic void snapshotState(org.apache.flink.runtime.state.StateSnapshotContext context)
throws Exception
snapshotState in interface org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperatorsnapshotState in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<CompactMessages.CoordinatorOutput>ExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.