public static class StreamAuditWriter.AuditLogWriterComputation extends AbstractComputation
Modifier and Type | Field and Description |
---|---|
protected int |
batchSize |
protected int |
batchThresholdMs |
protected List<LogEntry> |
logEntries |
metadata
Constructor and Description |
---|
AuditLogWriterComputation(String name,
int batchSize,
int batchThresholdMs) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called when the framework is ready to shutdown the computation.
|
protected LogEntry |
getLogEntryFromJson(byte[] data) |
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) . |
protected void |
writeEntriesToAudit(ComputationContext context) |
metadata
protected final int batchSize
protected final int batchThresholdMs
protected final List<LogEntry> logEntries
public AuditLogWriterComputation(String name, int batchSize, int batchThresholdMs)
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.public void destroy()
Computation
protected void writeEntriesToAudit(ComputationContext context)
protected LogEntry getLogEntryFromJson(byte[] data)
Copyright © 2018 Nuxeo. All rights reserved.