IN
- type of results to be written into the sink.public class CollectSinkOperator<IN> extends StreamSink<IN> implements OperatorEventHandler
StreamSink
that collects query results and sends them back to the client.userFunction
chainingStrategy, config, latencyStats, LOG, metrics, output, processingTimeService
Constructor and Description |
---|
CollectSinkOperator(TypeSerializer<IN> serializer,
long maxBytesPerBatch,
String accumulatorName) |
Modifier and Type | Method and Description |
---|---|
void |
finish()
This method is called at the end of data processing.
|
CompletableFuture<OperatorID> |
getOperatorIdFuture() |
void |
handleOperatorEvent(OperatorEvent evt) |
open, processElement, processWatermark, reportOrForwardLatencyMarker
close, getUserFunction, getUserFunctionParameters, initializeState, notifyCheckpointAborted, notifyCheckpointComplete, setOutputType, setup, snapshotState
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, isUsingCustomRawKeyedState, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setKeyContextElement
close, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
processLatencyMarker, processWatermarkStatus
public CollectSinkOperator(TypeSerializer<IN> serializer, long maxBytesPerBatch, String accumulatorName)
public void handleOperatorEvent(OperatorEvent evt)
handleOperatorEvent
in interface OperatorEventHandler
public void finish() throws Exception
StreamOperator
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.
finish
in interface StreamOperator<Object>
finish
in class AbstractUdfStreamOperator<Object,SinkFunction<IN>>
Exception
- An exception in this method causes the operator to fail.public CompletableFuture<OperatorID> getOperatorIdFuture()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.