public class LatencyTrackerComputation extends AbstractComputation
| Modifier and Type | Field and Description | 
|---|---|
protected Codec<Record> | 
codec  | 
protected int | 
count  | 
protected int | 
intervalMs  | 
protected List<LogPartitionGroup> | 
logGroups  | 
protected List<String> | 
logNames  | 
protected LogManager | 
manager  | 
protected static String | 
OUTPUT_STREAM  | 
protected int | 
remaining  | 
protected boolean | 
verbose  | 
| Constructor and Description | 
|---|
LatencyTrackerComputation(LogManager manager,
                         List<String> logNames,
                         String computationName,
                         int intervalSecond,
                         int count,
                         boolean verbose,
                         Codec<Record> codec)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
debug(String msg)  | 
static LogPartitionGroup | 
decodeKey(String key)  | 
void | 
destroy()
Called when the framework is ready to shutdown the computation. 
 | 
static String | 
encodeKey(LogPartitionGroup logGroup,
         int partition)  | 
protected byte[] | 
encodeLatency(Latency latency)  | 
protected void | 
error(String msg)  | 
protected List<Latency> | 
getLatenciesForPartition(LogPartitionGroup logGroup,
                        Codec<Record> codec)  | 
protected void | 
info(String msg)  | 
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, processFailure, processRetryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsignalStopprotected static final String OUTPUT_STREAM
protected final LogManager manager
protected final int intervalMs
protected final int count
protected final boolean verbose
protected int remaining
protected List<LogPartitionGroup> logGroups
public LatencyTrackerComputation(LogManager manager, List<String> logNames, String computationName, int intervalSecond, int count, boolean verbose, Codec<Record> codec)
public void init(ComputationContext context)
Computationinit in interface Computationinit in class AbstractComputationcontext - The computation context object provided by the system.public void processTimer(ComputationContext context, String key, long timestamp)
ComputationComputationContext.setTimer(String, long).processTimer in interface ComputationprocessTimer in class AbstractComputationcontext - 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.protected byte[] encodeLatency(Latency latency)
protected List<Latency> getLatenciesForPartition(LogPartitionGroup logGroup, Codec<Record> codec)
public static String encodeKey(LogPartitionGroup logGroup, int partition)
public static LogPartitionGroup decodeKey(String key)
public void destroy()
Computationpublic void processRecord(ComputationContext context, String inputStreamName, Record record)
Computationcontext - The computation context object provided by the system.inputStreamName - Name of the input stream that provides the record.record - The record.Copyright © 2019 Nuxeo. All rights reserved.