public class ComputationContextImpl extends Object implements ComputationContext
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.
|
List<Record> |
getRecords(String streamName) |
long |
getSourceLowWatermark() |
byte[] |
getState(String key)
Get local state for a given key
|
Map<String,Long> |
getTimers() |
void |
produceRecord(String streamName,
Record record) |
void |
produceRecord(String streamName,
String key,
byte[] data)
Emit a record downstream.
|
void |
removeCheckpointFlag() |
void |
removeTimer(String key) |
boolean |
requireCheckpoint() |
void |
setSourceLowWatermark(long watermark)
Set the low watermark for a source computation.
|
void |
setState(String key,
byte[] binaryValue)
Set local state for a given key.
|
void |
setTimer(String key,
long time)
Register a timer callback for some point in the future
|
public ComputationContextImpl(ComputationMetadataMapping metadata)
public List<Record> getRecords(String streamName)
public void setState(String key, byte[] binaryValue)
ComputationContext
setState
in interface ComputationContext
key
- Key to set in local store.binaryValue
- Value to store at key.public byte[] getState(String key)
ComputationContext
getState
in interface ComputationContext
key
- Key to receive from local store.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, String key, byte[] data)
ComputationContext
ComputationContext.askForCheckpoint()
.produceRecord
in interface ComputationContext
streamName
- The name of the stream on which the record should be emitted.key
- The key associated with the record. Only relevant when routing method is `GROUP_BY`.public void produceRecord(String streamName, Record record)
produceRecord
in interface ComputationContext
public void setSourceLowWatermark(long watermark)
ComputationContext
setSourceLowWatermark
in interface ComputationContext
public long getSourceLowWatermark()
public boolean requireCheckpoint()
public void removeCheckpointFlag()
public void askForCheckpoint()
ComputationContext
askForCheckpoint
in interface ComputationContext
Copyright © 2017 Nuxeo. All rights reserved.