public class KeyedProcessOperator<KEY,IN,OUT> extends ProcessOperator<IN,OUT> implements Triggerable<KEY,VoidNamespace>
OneInputStreamProcessFunction
in KeyedPartitionStream
.context, nonPartitionedContext, outputCollector, partitionedContext
userFunction
chainingStrategy, config, lastRecordAttributes1, lastRecordAttributes2, latencyStats, LOG, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager
Constructor and Description |
---|
KeyedProcessOperator(OneInputStreamProcessFunction<IN,OUT> userFunction) |
KeyedProcessOperator(OneInputStreamProcessFunction<IN,OUT> userFunction,
KeySelector<OUT,KEY> outKeySelector) |
Modifier and Type | Method and Description |
---|---|
protected Object |
currentKey() |
protected NonPartitionedContext<OUT> |
getNonPartitionedContext() |
protected TimestampCollector<OUT> |
getOutputCollector() |
protected ProcessingTimeManager |
getProcessingTimeManager() |
void |
onEventTime(InternalTimer<KEY,VoidNamespace> timer)
Invoked when an event-time timer fires.
|
void |
onProcessingTime(InternalTimer<KEY,VoidNamespace> timer)
Invoked when a processing-time timer fires.
|
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g.
|
void |
setKeyContextElement1(StreamRecord record) |
endInput, processElement
close, finish, 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, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, isUsingCustomRawKeyedState, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, snapshotState, useSplittableTimers
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setKeyContextElement
close, finish, getMetricGroup, getOperatorAttributes, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
processLatencyMarker, processRecordAttributes, processWatermark, processWatermarkStatus
hasKeyContext
public KeyedProcessOperator(OneInputStreamProcessFunction<IN,OUT> userFunction)
public KeyedProcessOperator(OneInputStreamProcessFunction<IN,OUT> userFunction, @Nullable KeySelector<OUT,KEY> outKeySelector)
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class ProcessOperator<IN,OUT>
Exception
- An exception in this method causes the operator to fail.protected TimestampCollector<OUT> getOutputCollector()
getOutputCollector
in class ProcessOperator<IN,OUT>
protected Object currentKey()
currentKey
in class ProcessOperator<IN,OUT>
public void onEventTime(InternalTimer<KEY,VoidNamespace> timer) throws Exception
Triggerable
onEventTime
in interface Triggerable<KEY,VoidNamespace>
Exception
public void onProcessingTime(InternalTimer<KEY,VoidNamespace> timer) throws Exception
Triggerable
onProcessingTime
in interface Triggerable<KEY,VoidNamespace>
Exception
protected ProcessingTimeManager getProcessingTimeManager()
getProcessingTimeManager
in class ProcessOperator<IN,OUT>
protected NonPartitionedContext<OUT> getNonPartitionedContext()
getNonPartitionedContext
in class ProcessOperator<IN,OUT>
public void setKeyContextElement1(StreamRecord record) throws Exception
setKeyContextElement1
in interface StreamOperator<OUT>
setKeyContextElement1
in class AbstractStreamOperator<OUT>
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.