Class 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 Detail

      • BIG_BULK_COMMAND_THRESHOLD

        public static final long BIG_BULK_COMMAND_THRESHOLD
        See Also:
        Constant Field Values
      • 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 Detail

      • 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 Detail

      • 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.
      • detectRetryOnFlushedScroll

        protected boolean detectRetryOnFlushedScroll​(String commandId)
      • getCommandConfiguration

        protected void getCommandConfiguration​(BulkCommand command)
      • isAbortedCommand

        protected boolean isAbortedCommand​(String commandId)
      • 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.