Class StreamSortOperator
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
-
- org.apache.flink.table.runtime.operators.TableStreamOperator<RowData>
-
- org.apache.flink.table.runtime.operators.sort.StreamSortOperator
-
- All Implemented Interfaces:
Serializable
,CheckpointListener
,Input<RowData>
,KeyContext
,KeyContextHandler
,OneInputStreamOperator<RowData,RowData>
,StreamOperator<RowData>
,StreamOperatorStateHandler.CheckpointedStreamOperator
,YieldingOperator<RowData>
public class StreamSortOperator extends TableStreamOperator<RowData> implements OneInputStreamOperator<RowData,RowData>
Operator for stream sort.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.table.runtime.operators.TableStreamOperator
TableStreamOperator.ContextImpl
-
-
Field Summary
-
Fields inherited from class org.apache.flink.table.runtime.operators.TableStreamOperator
ctx, currentWatermark
-
Fields inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator
config, lastRecordAttributes1, lastRecordAttributes2, latencyStats, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager
-
-
Constructor Summary
Constructors Constructor Description StreamSortOperator(InternalTypeInfo<RowData> inputRowType, GeneratedRecordComparator gComparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finish()
This method is called at the end of data processing.OperatorAttributes
getOperatorAttributes()
Called to get the OperatorAttributes of the operator.void
initializeState(StateInitializationContext context)
Stream operators with state which can be restored need to override this hook method.void
open()
This method is called immediately before any elements are processed, it should contain the operator's initialization logic, e.g. state initialization.void
processElement(StreamRecord<RowData> element)
Processes one element that arrived on this input of theMultipleInputStreamOperator
.void
snapshotState(StateSnapshotContext context)
Stream operators with state, which want to participate in a snapshot need to override this hook method.-
Methods inherited from class org.apache.flink.table.runtime.operators.TableStreamOperator
computeMemorySize, processWatermark, useSplittableTimers
-
Methods inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator
close, 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, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, setup, snapshotState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.common.state.CheckpointListener
notifyCheckpointAborted, notifyCheckpointComplete
-
Methods inherited from interface org.apache.flink.streaming.api.operators.Input
processLatencyMarker, processRecordAttributes, processWatermark, processWatermarkStatus
-
Methods inherited from interface org.apache.flink.streaming.api.operators.KeyContext
getCurrentKey, setCurrentKey
-
Methods inherited from interface org.apache.flink.streaming.api.operators.KeyContextHandler
hasKeyContext
-
Methods inherited from interface org.apache.flink.streaming.api.operators.OneInputStreamOperator
setKeyContextElement
-
Methods inherited from interface org.apache.flink.streaming.api.operators.StreamOperator
close, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
-
-
-
-
Constructor Detail
-
StreamSortOperator
public StreamSortOperator(InternalTypeInfo<RowData> inputRowType, GeneratedRecordComparator gComparator)
-
-
Method Detail
-
open
public void open() throws Exception
Description copied from class:AbstractStreamOperator
This method is called immediately before any elements are processed, it should contain the operator's initialization logic, e.g. state initialization.The default implementation does nothing.
- Specified by:
open
in interfaceStreamOperator<RowData>
- Overrides:
open
in classTableStreamOperator<RowData>
- Throws:
Exception
- An exception in this method causes the operator to fail.
-
processElement
public void processElement(StreamRecord<RowData> element) throws Exception
Description copied from interface:Input
Processes one element that arrived on this input of theMultipleInputStreamOperator
. This method is guaranteed to not be called concurrently with other methods of the operator.- Specified by:
processElement
in interfaceInput<RowData>
- Throws:
Exception
-
initializeState
public void initializeState(StateInitializationContext context) throws Exception
Description copied from class:AbstractStreamOperator
Stream operators with state which can be restored need to override this hook method.- Specified by:
initializeState
in interfaceStreamOperatorStateHandler.CheckpointedStreamOperator
- Overrides:
initializeState
in classAbstractStreamOperator<RowData>
- Parameters:
context
- context that allows to register different states.- Throws:
Exception
-
snapshotState
public void snapshotState(StateSnapshotContext context) throws Exception
Description copied from class:AbstractStreamOperator
Stream operators with state, which want to participate in a snapshot need to override this hook method.- Specified by:
snapshotState
in interfaceStreamOperatorStateHandler.CheckpointedStreamOperator
- Overrides:
snapshotState
in classAbstractStreamOperator<RowData>
- Parameters:
context
- context that provides information and means required for taking a snapshot- Throws:
Exception
-
finish
public void finish() throws Exception
Description copied from interface:StreamOperator
This method is called at the end of data processing.The method is expected to flush all remaining buffered data. Exceptions during this flushing of buffered data should be propagated, in order to cause the operation to be recognized as failed, because the last data items are not processed properly.
After this method is called, no more records can be produced for the downstream operators.
WARNING: It is not safe to use this method to commit any transactions or other side effects! You can use this method to flush any buffered data that can later on be committed e.g. in a
CheckpointListener.notifyCheckpointComplete(long)
.NOTE:This method does not need to close any resources. You should release external resources in the
StreamOperator.close()
method.- Specified by:
finish
in interfaceStreamOperator<RowData>
- Overrides:
finish
in classAbstractStreamOperator<RowData>
- Throws:
Exception
- An exception in this method causes the operator to fail.
-
getOperatorAttributes
public OperatorAttributes getOperatorAttributes()
Description copied from interface:StreamOperator
Called to get the OperatorAttributes of the operator. If there is no defined attribute, a default OperatorAttributes is built.- Specified by:
getOperatorAttributes
in interfaceStreamOperator<RowData>
- Returns:
- OperatorAttributes of the operator.
-
-