@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.
| 构造器和说明 |
|---|
CompactCoordinator(org.apache.flink.util.function.SupplierWithException<org.apache.flink.core.fs.FileSystem,IOException> fsFactory,
long targetFileSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
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, getTimeServiceManager, getUserCodeClassloader, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, open, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, finish, getMetricGroup, getOperatorID, initializeState, open, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotStatepublic 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 在接口中 org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperatorinitializeState 在类中 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 在接口中 org.apache.flink.streaming.api.operators.Input<CompactMessages.CoordinatorInput>Exceptionpublic void snapshotState(org.apache.flink.runtime.state.StateSnapshotContext context)
throws Exception
snapshotState 在接口中 org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperatorsnapshotState 在类中 org.apache.flink.streaming.api.operators.AbstractStreamOperator<CompactMessages.CoordinatorOutput>ExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.