public class HeadOperator extends org.apache.flink.streaming.api.operators.AbstractStreamOperator<IterationRecord<?>> implements org.apache.flink.streaming.api.operators.OneInputStreamOperator<IterationRecord<?>,IterationRecord<?>>, org.apache.flink.statefun.flink.core.feedback.FeedbackConsumer<org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IterationRecord<?>>>, org.apache.flink.runtime.operators.coordination.OperatorEventHandler, org.apache.flink.streaming.api.operators.BoundedOneInput
Specially for checkpoint, the head operator would like to
IterationListener.onEpochWatermarkIncremented(int,
       IterationListener.Context, Collector).
 To implement the first target, the head operator also need to include the records between
 alignment and received barrier from the feed-back edge into the snapshot. To implement the second
 target, the head operator would also wait for the notification from the OperatorCoordinator in
 additional to the task inputs. This ensures the GloballyAlignedEvent would not interleave
 with the epoch watermarks and all the tasks inside the iteration would be notified with the same
 epochs, which facility the rescaling in the future.
| 限定符和类型 | 字段和说明 | 
|---|---|
static org.apache.flink.util.OutputTag<IterationRecord<Void>> | 
ALIGN_NOTIFY_OUTPUT_TAG  | 
| 构造器和说明 | 
|---|
HeadOperator(IterationID iterationId,
            int feedbackIndex,
            boolean isCriteriaStream,
            org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor,
            org.apache.flink.runtime.operators.coordination.OperatorEventGateway operatorEventGateway,
            org.apache.flink.streaming.runtime.tasks.ProcessingTimeService processingTimeService)  | 
| 限定符和类型 | 方法和说明 | 
|---|---|
void | 
close()  | 
void | 
endInput()  | 
org.apache.flink.runtime.operators.coordination.OperatorEventGateway | 
getOperatorEventGateway()  | 
org.apache.flink.iteration.operator.HeadOperator.HeadOperatorStatus | 
getStatus()  | 
void | 
handleOperatorEvent(org.apache.flink.runtime.operators.coordination.OperatorEvent operatorEvent)  | 
void | 
initializeState(org.apache.flink.runtime.state.StateInitializationContext context)  | 
void | 
notifyCheckpointAborted(long checkpointId)  | 
void | 
prepareSnapshotPreBarrier(long checkpointId)  | 
void | 
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IterationRecord<?>> element)  | 
void | 
processFeedback(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IterationRecord<?>> iterationRecord)  | 
void | 
setup(org.apache.flink.streaming.runtime.tasks.StreamTask<?,?> containingTask,
     org.apache.flink.streaming.api.graph.StreamConfig config,
     org.apache.flink.streaming.api.operators.Output<org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IterationRecord<?>>> output)  | 
void | 
snapshotState(org.apache.flink.runtime.state.StateSnapshotContext context)  | 
finish, getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, isUsingCustomRawKeyedState, notifyCheckpointComplete, open, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, snapshotStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final org.apache.flink.util.OutputTag<IterationRecord<Void>> ALIGN_NOTIFY_OUTPUT_TAG
public HeadOperator(IterationID iterationId, int feedbackIndex, boolean isCriteriaStream, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, org.apache.flink.runtime.operators.coordination.OperatorEventGateway operatorEventGateway, org.apache.flink.streaming.runtime.tasks.ProcessingTimeService processingTimeService)
public void setup(org.apache.flink.streaming.runtime.tasks.StreamTask<?,?> containingTask,
                  org.apache.flink.streaming.api.graph.StreamConfig config,
                  org.apache.flink.streaming.api.operators.Output<org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IterationRecord<?>>> output)
setup 在接口中 org.apache.flink.streaming.api.operators.SetupableStreamOperator<IterationRecord<?>>setup 在类中 org.apache.flink.streaming.api.operators.AbstractStreamOperator<IterationRecord<?>>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<IterationRecord<?>>Exceptionpublic void prepareSnapshotPreBarrier(long checkpointId)
                               throws Exception
prepareSnapshotPreBarrier 在接口中 org.apache.flink.streaming.api.operators.StreamOperator<IterationRecord<?>>prepareSnapshotPreBarrier 在类中 org.apache.flink.streaming.api.operators.AbstractStreamOperator<IterationRecord<?>>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<IterationRecord<?>>Exceptionpublic void notifyCheckpointAborted(long checkpointId)
                             throws Exception
notifyCheckpointAborted 在接口中 org.apache.flink.api.common.state.CheckpointListenernotifyCheckpointAborted 在类中 org.apache.flink.streaming.api.operators.AbstractStreamOperator<IterationRecord<?>>Exceptionpublic void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IterationRecord<?>> element) throws Exception
processElement 在接口中 org.apache.flink.streaming.api.operators.Input<IterationRecord<?>>Exceptionpublic void processFeedback(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IterationRecord<?>> iterationRecord) throws Exception
processFeedback 在接口中 org.apache.flink.statefun.flink.core.feedback.FeedbackConsumer<org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IterationRecord<?>>>Exceptionpublic void handleOperatorEvent(org.apache.flink.runtime.operators.coordination.OperatorEvent operatorEvent)
handleOperatorEvent 在接口中 org.apache.flink.runtime.operators.coordination.OperatorEventHandlerpublic void endInput()
              throws Exception
endInput 在接口中 org.apache.flink.streaming.api.operators.BoundedOneInputExceptionpublic void close()
           throws Exception
close 在接口中 org.apache.flink.streaming.api.operators.StreamOperator<IterationRecord<?>>close 在类中 org.apache.flink.streaming.api.operators.AbstractStreamOperator<IterationRecord<?>>Exception@VisibleForTesting public org.apache.flink.runtime.operators.coordination.OperatorEventGateway getOperatorEventGateway()
@VisibleForTesting public org.apache.flink.iteration.operator.HeadOperator.HeadOperatorStatus getStatus()
Copyright © 2019–2022 The Apache Software Foundation. All rights reserved.