public static class StreamAuditWriter.AuditLogWriterComputation extends AbstractBatchComputation
batchRecords, currentInputStream, newBatch, removeLastRecordOnRetry, thresholdMillis, TIMER_BATCH
Constructor and Description |
---|
AuditLogWriterComputation(String name) |
Modifier and Type | Method and Description |
---|---|
void |
batchFailure(ComputationContext context,
String inputStreamName,
List<Record> records)
Called when the retry policy has failed.
|
void |
batchProcess(ComputationContext context,
String inputStreamName,
List<Record> records)
Called when:
- the batch capacity is reached - the time threshold is reached - the inputStreamName has changed If this method raises an exception the retry policy is applied. |
protected LogEntry |
getLogEntryFromJson(byte[] data) |
protected void |
writeEntriesToAudit(List<LogEntry> logEntries) |
checkpointBatch, init, processFailure, processRecord, processRetry, processTimer
metadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, signalStop
public AuditLogWriterComputation(String name)
public void batchProcess(ComputationContext context, String inputStreamName, List<Record> records)
AbstractBatchComputation
batchProcess
in class AbstractBatchComputation
context
- used to send records to output streams, note that the checkpoint is managed automatically.inputStreamName
- the input streams where the records are coming fromrecords
- the batch of recordspublic void batchFailure(ComputationContext context, String inputStreamName, List<Record> records)
AbstractBatchComputation
batchFailure
in class AbstractBatchComputation
protected void writeEntriesToAudit(List<LogEntry> logEntries)
protected LogEntry getLogEntryFromJson(byte[] data)
Copyright © 2019 Nuxeo. All rights reserved.