@Internal @Deprecated public abstract class AbstractAlignedProcessingTimeWindowOperator<KEY,IN,OUT,STATE,F extends Function> extends AbstractUdfStreamOperator<OUT,F> implements OneInputStreamOperator<IN,OUT>, ProcessingTimeCallback
AbstractStreamOperator.CountingOutput, AbstractStreamOperator.LatencyGauge
userFunction
chainingStrategy, config, latencyGauge, LOG, metrics, output
Modifier | Constructor and Description |
---|---|
protected |
AbstractAlignedProcessingTimeWindowOperator(F function,
KeySelector<IN,KEY> keySelector,
TypeSerializer<KEY> keySerializer,
TypeSerializer<STATE> stateTypeSerializer,
long windowLength,
long windowSlide)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Deprecated.
This method is called after all records have been added to the operators via the methods
OneInputStreamOperator.processElement(StreamRecord) , or
TwoInputStreamOperator.processElement1(StreamRecord) and
TwoInputStreamOperator.processElement2(StreamRecord) . |
protected abstract AbstractKeyedTimePanes<IN,KEY,STATE,OUT> |
createPanes(KeySelector<IN,KEY> keySelector,
Function function)
Deprecated.
|
void |
dispose()
Deprecated.
This method is called at the very end of the operator's life, both in the case of a successful
completion of the operation, and in the case of a failure and canceling.
|
long |
getNextEvaluationTime()
Deprecated.
|
long |
getNextSlideTime()
Deprecated.
|
int |
getNumPanesPerWindow()
Deprecated.
|
long |
getPaneSize()
Deprecated.
|
long |
getWindowSize()
Deprecated.
|
long |
getWindowSlide()
Deprecated.
|
void |
onProcessingTime(long timestamp)
Deprecated.
This method is invoked with the timestamp for which the trigger was scheduled.
|
void |
open()
Deprecated.
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g.
|
void |
processElement(StreamRecord<IN> element)
Deprecated.
Processes one element that arrived at this operator.
|
void |
restoreState(FSDataInputStream in)
Deprecated.
Restores the operator state, if this operator's execution is recovering from a checkpoint.
|
void |
snapshotState(FSDataOutputStream out,
long checkpointId,
long timestamp)
Deprecated.
Called to draw a state snapshot from the operator.
|
String |
toString()
Deprecated.
|
getUserFunction, getUserFunctionParameters, initializeState, notifyOfCompletedCheckpoint, setOutputType, setup, snapshotState
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorName, getOperatorStateBackend, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getUserCodeClassloader, initializeState, numEventTimeTimers, numProcessingTimeTimers, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, snapshotLegacyOperatorState, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
processLatencyMarker, processWatermark
getChainingStrategy, getMetricGroup, initializeState, notifyOfCompletedCheckpoint, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setup, snapshotLegacyOperatorState, snapshotState
protected AbstractAlignedProcessingTimeWindowOperator(F function, KeySelector<IN,KEY> keySelector, TypeSerializer<KEY> keySerializer, TypeSerializer<STATE> stateTypeSerializer, long windowLength, long windowSlide)
protected abstract AbstractKeyedTimePanes<IN,KEY,STATE,OUT> createPanes(KeySelector<IN,KEY> keySelector, Function function)
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class AbstractUdfStreamOperator<OUT,F extends Function>
Exception
- An exception in this method causes the operator to fail.public void close() throws Exception
AbstractStreamOperator
OneInputStreamOperator.processElement(StreamRecord)
, or
TwoInputStreamOperator.processElement1(StreamRecord)
and
TwoInputStreamOperator.processElement2(StreamRecord)
.
The method is expected to flush all remaining buffered data. Exceptions during this flushing of buffered should be propagated, in order to cause the operation to be recognized asa failed, because the last data items are not processed properly.
close
in interface StreamOperator<OUT>
close
in class AbstractUdfStreamOperator<OUT,F extends Function>
Exception
- An exception in this method causes the operator to fail.public void dispose() throws Exception
AbstractStreamOperator
dispose
in interface StreamOperator<OUT>
dispose
in class AbstractUdfStreamOperator<OUT,F extends Function>
Exception
public void processElement(StreamRecord<IN> element) throws Exception
OneInputStreamOperator
processElement
in interface OneInputStreamOperator<IN,OUT>
Exception
public void onProcessingTime(long timestamp) throws Exception
ProcessingTimeCallback
If the triggering is delayed for whatever reason (trigger timer was blocked, JVM stalled due to a garbage collection), the timestamp supplied to this function will still be the original timestamp for which the trigger was scheduled.
onProcessingTime
in interface ProcessingTimeCallback
timestamp
- The timestamp for which the trigger event was scheduled.Exception
public void snapshotState(FSDataOutputStream out, long checkpointId, long timestamp) throws Exception
StreamCheckpointedOperator
snapshotState
in interface StreamCheckpointedOperator
snapshotState
in class AbstractUdfStreamOperator<OUT,F extends Function>
out
- The stream to which we have to write our state.checkpointId
- The ID of the checkpoint.timestamp
- The timestamp of the checkpoint.Exception
- Forwards exceptions that occur while drawing snapshots from the operator
and the key/value state.public void restoreState(FSDataInputStream in) throws Exception
CheckpointedRestoringOperator
This method is called after StreamOperator.setup(StreamTask, StreamConfig, Output)
and before StreamOperator.open()
.
restoreState
in interface CheckpointedRestoringOperator
restoreState
in class AbstractUdfStreamOperator<OUT,F extends Function>
in
- The stream from which we have to restore our state.Exception
- Exceptions during state restore should be forwarded, so that the system can
properly react to failed state restore and fail the execution attempt.public long getWindowSize()
public long getWindowSlide()
public long getPaneSize()
public int getNumPanesPerWindow()
public long getNextEvaluationTime()
public long getNextSlideTime()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.