Class BulkScrollerComputation

java.lang.Object
org.nuxeo.lib.stream.computation.AbstractComputation
org.nuxeo.ecm.core.bulk.computation.BulkScrollerComputation
All Implemented Interfaces:
Computation

public class BulkScrollerComputation extends AbstractComputation
Materializes the document set for a command if scroller is not external.

Inputs:

Outputs:

  • - "actionName": Writes BulkBucket into the action stream
  • - "status": Writes BulkStatus into the action stream
Since:
10.2
  • 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

      protected final List<String> 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

      protected String actionStream
    • sequentialProcessing

      protected boolean sequentialProcessing
  • Constructor Details

    • BulkScrollerComputation

      protected BulkScrollerComputation(BulkScrollerComputation.Builder builder)
    • BulkScrollerComputation

      public BulkScrollerComputation(String name, int nbOutputStreams, int scrollBatchSize, int scrollKeepAliveSeconds, boolean produceImmediate)
      Parameters:
      name - the computation name
      nbOutputStreams - the number of registered bulk action streams
      scrollBatchSize - the batch size to scroll
      scrollKeepAliveSeconds - the scroll lifetime
      produceImmediate - whether or not the record should be produced immedialitely while scrolling
    • BulkScrollerComputation

      public BulkScrollerComputation(String name, int nbOutputStreams, int scrollBatchSize, int scrollKeepAliveSeconds, Duration transactionTimeout, boolean produceImmediate)
  • Method Details

    • builder

      public static BulkScrollerComputation.Builder builder(String name, int nbOutputStreams)
    • processRecord

      public void processRecord(ComputationContext context, String inputStreamName, Record record)
      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

      protected void processRecord(ComputationContext context, Record record)
    • detectRetryOnFlushedScroll

      protected boolean detectRetryOnFlushedScroll(String commandId)
    • buildScroll

      protected Scroll buildScroll(BulkCommand command)
    • getCommandConfiguration

      protected void getCommandConfiguration(BulkCommand command)
    • isAbortedCommand

      protected boolean isAbortedCommand(String commandId)
    • updateStatusAsFlushing

      protected void updateStatusAsFlushing(ComputationContext context, String commandId)
    • updateStatusAsScrolling

      protected void updateStatusAsScrolling(ComputationContext context, String commandId)
    • 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

      protected void flushRecords(ComputationContextImpl contextImpl, String commandId)