Class BulkScrollerComputation
java.lang.Object
org.nuxeo.lib.stream.computation.AbstractComputation
org.nuxeo.ecm.core.bulk.computation.BulkScrollerComputation
- All Implemented Interfaces:
Computation
Materializes the document set for a command if scroller is not external.
Inputs:
- i1: Reads a stream of
BulkCommand
sharded by action
Outputs:
- - "actionName": Writes
BulkBucket
into the action stream - - "status": Writes
BulkStatus
into the action stream
- Since:
- 10.2
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
static final long
protected int
static final int
protected final boolean
protected final long
protected final int
protected final int
protected int
protected boolean
protected final int
Fields inherited from class org.nuxeo.lib.stream.computation.AbstractComputation
INPUT_1, INPUT_2, INPUT_3, INPUT_NULL, metadata, OUTPUT_1, OUTPUT_2, OUTPUT_3, OUTPUT_4
-
Constructor Summary
ModifierConstructorDescriptionBulkScrollerComputation
(String name, int nbOutputStreams, int scrollBatchSize, int scrollKeepAliveSeconds, boolean produceImmediate) BulkScrollerComputation
(String name, int nbOutputStreams, int scrollBatchSize, int scrollKeepAliveSeconds, Duration transactionTimeout, boolean produceImmediate) protected
-
Method Summary
Modifier and TypeMethodDescriptionprotected Scroll
buildScroll
(BulkCommand command) protected boolean
detectRetryOnFlushedScroll
(String commandId) protected void
flushRecords
(ComputationContextImpl contextImpl, String commandId) protected void
getCommandConfiguration
(BulkCommand command) protected boolean
isAbortedCommand
(String commandId) void
processRecord
(ComputationContext context, String inputStreamName, Record record) Process an incoming record on one of the computation's input streams.protected void
processRecord
(ComputationContext context, Record record) protected void
produceBucket
(ComputationContext context, String commandId, int bucketSize, long bucketNumber, long documentCount) Produces a bucket as a record to appropriate bulk action stream.protected void
updateStatusAfterScroll
(ComputationContext context, String commandId, long documentCount, boolean limited) protected void
updateStatusAfterScroll
(ComputationContext context, String commandId, long documentCount, String errorMessage, Integer errorCode, boolean limited) protected void
updateStatusAfterScroll
(ComputationContext context, String commandId, String errorMessage, Integer errorCode) protected void
updateStatusAsFlushing
(ComputationContext context, String commandId) protected void
updateStatusAsScrolling
(ComputationContext context, String commandId) Methods inherited from class org.nuxeo.lib.stream.computation.AbstractComputation
init, metadata, processFailure, processRetry, processTimer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.lib.stream.computation.Computation
destroy, signalStop
-
Field Details
-
MAX_SCROLL_SIZE
public static final int MAX_SCROLL_SIZE- See Also:
-
BIG_BULK_COMMAND_THRESHOLD
public static final long BIG_BULK_COMMAND_THRESHOLD- See Also:
-
scrollBatchSize
protected final int scrollBatchSize -
scrollKeepAliveSeconds
protected final int scrollKeepAliveSeconds -
documentIds
-
produceImmediate
protected final boolean produceImmediate -
produceImmediateThreshold
protected final long produceImmediateThreshold -
transactionTimeoutSeconds
protected final int transactionTimeoutSeconds -
scrollSize
protected int scrollSize -
bucketSize
protected int bucketSize -
actionStream
-
sequentialProcessing
protected boolean sequentialProcessing
-
-
Constructor Details
-
BulkScrollerComputation
-
BulkScrollerComputation
public BulkScrollerComputation(String name, int nbOutputStreams, int scrollBatchSize, int scrollKeepAliveSeconds, boolean produceImmediate) - Parameters:
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 scrolling
-
BulkScrollerComputation
-
-
Method Details
-
builder
-
processRecord
Description copied from interface:Computation
Process an incoming record on one of the computation's input streams.- Parameters:
context
- The computation context object provided by the system.inputStreamName
- Name of the input stream that provides the record.record
- The record.
-
processRecord
-
detectRetryOnFlushedScroll
-
buildScroll
-
getCommandConfiguration
-
isAbortedCommand
-
updateStatusAsFlushing
-
updateStatusAsScrolling
-
updateStatusAfterScroll
protected void updateStatusAfterScroll(ComputationContext context, String commandId, String errorMessage, Integer errorCode) -
updateStatusAfterScroll
protected void updateStatusAfterScroll(ComputationContext context, String commandId, long documentCount, boolean limited) -
updateStatusAfterScroll
protected void updateStatusAfterScroll(ComputationContext context, String commandId, long documentCount, String errorMessage, Integer errorCode, boolean limited) -
produceBucket
protected void produceBucket(ComputationContext context, String commandId, int bucketSize, long bucketNumber, long documentCount) Produces a bucket as a record to appropriate bulk action stream. -
flushRecords
-