public static class StreamBulkProcessor.CounterComputation extends AbstractComputation
Modifier and Type | Field and Description |
---|---|
protected Map<String,Long> |
counters |
protected int |
counterThresholdMs |
metadata
Constructor and Description |
---|
CounterComputation(String counterComputationName,
int counterThresholdMs) |
Modifier and Type | Method and Description |
---|---|
void |
init(ComputationContext context)
Called when the framework has registered the computation successfully.
|
void |
processRecord(ComputationContext context,
String inputStreamName,
Record record)
Process an incoming record on one of the computation's input streams.
|
void |
processTimer(ComputationContext context,
String key,
long timestamp)
Process a timer callback previously set via
ComputationContext.setTimer(String, long) . |
metadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, signalStop
protected final int counterThresholdMs
public CounterComputation(String counterComputationName, int counterThresholdMs)
public void init(ComputationContext context)
Computation
init
in interface Computation
init
in class AbstractComputation
context
- The computation context object provided by the system.public void processTimer(ComputationContext context, String key, long timestamp)
Computation
ComputationContext.setTimer(String, long)
.processTimer
in interface Computation
processTimer
in class AbstractComputation
context
- The computation context object provided by the system.key
- The name of the timer.timestamp
- The timestamp (in ms) for which the callback was scheduled.public void processRecord(ComputationContext context, String inputStreamName, Record record)
Computation
context
- The computation context object provided by the system.inputStreamName
- Name of the input stream that provides the record.record
- The record.Copyright © 2018 Nuxeo. All rights reserved.