public class ComputationContextImpl extends Object implements ComputationContext
Modifier and Type | Field and Description |
---|---|
protected boolean |
checkpointFlag |
protected long |
lowWatermark |
protected ComputationMetadataMapping |
metadata |
protected Map<String,List<Record>> |
streamRecords |
protected boolean |
terminateFlag |
protected Map<String,Long> |
timers |
Constructor and Description |
---|
ComputationContextImpl(ComputationMetadataMapping metadata) |
Modifier and Type | Method and Description |
---|---|
void |
askForCheckpoint()
Ask for checkpoint in order to send records, save input stream offset positions.
|
void |
askForTermination()
Ask to terminate this computation.
|
List<Record> |
getRecords(String streamName) |
long |
getSourceLowWatermark() |
Map<String,Long> |
getTimers() |
void |
produceRecord(String streamName,
Record record) |
void |
removeCheckpointFlag() |
void |
removeTimer(String key) |
boolean |
requireCheckpoint() |
boolean |
requireTerminate() |
void |
setSourceLowWatermark(long watermark)
Set the low watermark for a source computation.
|
void |
setTimer(String key,
long time)
Register a timer callback for some point in the future
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
produceRecord
protected final ComputationMetadataMapping metadata
protected final Map<String,List<Record>> streamRecords
protected boolean checkpointFlag
protected long lowWatermark
protected boolean terminateFlag
public ComputationContextImpl(ComputationMetadataMapping metadata)
public List<Record> getRecords(String streamName)
public void setTimer(String key, long time)
ComputationContext
setTimer
in interface ComputationContext
key
- Name of the timer callback.time
- The (ms since epoch) at which the callback should be firedpublic void removeTimer(String key)
public void produceRecord(String streamName, Record record)
produceRecord
in interface ComputationContext
public long getSourceLowWatermark()
public void setSourceLowWatermark(long watermark)
ComputationContext
setSourceLowWatermark
in interface ComputationContext
public boolean requireCheckpoint()
public void removeCheckpointFlag()
public void askForCheckpoint()
ComputationContext
askForCheckpoint
in interface ComputationContext
public void askForTermination()
ComputationContext
askForTermination
in interface ComputationContext
public boolean requireTerminate()
Copyright © 2018 Nuxeo. All rights reserved.