public class BulkScrollerComputation extends AbstractComputation
Inputs:
BulkCommand
sharded by actionOutputs:
BulkBucket
into the action streamBulkStatus
into the action streamModifier and Type | Field and Description |
---|---|
protected List<String> |
documentIds |
static int |
MAX_SCROLL_SIZE |
protected int |
scrollBatchSize |
protected int |
scrollKeepAliveSeconds |
Constructor and Description |
---|
BulkScrollerComputation(String name,
int nbOutputStreams,
int scrollBatchSize,
int scrollKeepAliveSeconds,
boolean produceImmediate) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isAbortedCommand(String commandId) |
protected void |
processRecord(ComputationContext context,
Record record) |
void |
processRecord(ComputationContext context,
String inputStreamName,
Record record)
Process an incoming record on one of the computation's input streams.
|
protected void |
produceBucket(ComputationContext context,
String action,
String commandId,
int bucketSize,
long bucketNumber)
Produces a bucket as a record to appropriate bulk action stream.
|
protected void |
updateStatusAfterScroll(ComputationContext context,
String commandId,
long documentCount) |
protected void |
updateStatusAfterScroll(ComputationContext context,
String commandId,
long documentCount,
String errorMessage) |
protected void |
updateStatusAfterScroll(ComputationContext context,
String commandId,
String errorMessage) |
protected void |
updateStatusAsScrolling(ComputationContext context,
String commandId) |
init, metadata, processFailure, processRetry, processTimer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, signalStop
public static final int MAX_SCROLL_SIZE
protected final int scrollBatchSize
protected final int scrollKeepAliveSeconds
protected final List<String> documentIds
public BulkScrollerComputation(String name, int nbOutputStreams, int scrollBatchSize, int scrollKeepAliveSeconds, boolean produceImmediate)
name
- the computation namenbOutputStreams
- the number of registered bulk action streamsscrollBatchSize
- the batch size to scrollscrollKeepAliveSeconds
- the scroll lifetimeproduceImmediate
- whether or not the record should be produced immedialitely while scrollingpublic 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.protected void processRecord(ComputationContext context, Record record)
protected boolean isAbortedCommand(String commandId)
protected void updateStatusAsScrolling(ComputationContext context, String commandId)
protected void updateStatusAfterScroll(ComputationContext context, String commandId, String errorMessage)
protected void updateStatusAfterScroll(ComputationContext context, String commandId, long documentCount)
protected void updateStatusAfterScroll(ComputationContext context, String commandId, long documentCount, String errorMessage)
protected void produceBucket(ComputationContext context, String action, String commandId, int bucketSize, long bucketNumber)
Copyright © 2019 Nuxeo. All rights reserved.