Class WorkComputation

All Implemented Interfaces:
Computation

public class WorkComputation extends AbstractComputation
A Stream computation that consumes works.
Since:
9.3
  • Field Details

    • IDS_SIZE

      protected static final int IDS_SIZE
      See Also:
    • workIds

      protected final org.apache.commons.collections4.queue.CircularFifoQueue<String> workIds
    • workTimer

      protected final io.dropwizard.metrics5.Timer workTimer
    • stateTTL

      protected final long stateTTL
    • work

      protected Work work
  • Constructor Details

    • WorkComputation

      public WorkComputation(String name)
  • Method Details

    • signalStop

      public void signalStop()
      Description copied from interface: Computation
      A hook to inform that computation will be soon destroyed. It gives a way for long processing to cooperate to a quick shutdown.
      This method is not invoked from the computation thread, it should only set some volatile flag and returns immediately.
    • 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.
    • cleanupWorkInFailure

      protected void cleanupWorkInFailure(Work work, Exception exception)
    • deserialize

      public static Work deserialize(byte[] data)
    • serialize

      public static byte[] serialize(Work work)