Package org.nuxeo.ecm.core.work
Class WorkComputation
- java.lang.Object
-
- org.nuxeo.lib.stream.computation.AbstractComputation
-
- org.nuxeo.ecm.core.work.WorkComputation
-
- All Implemented Interfaces:
Computation
public class WorkComputation extends AbstractComputation
A Stream computation that consumes works.- Since:
- 9.3
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
IDS_SIZE
protected long
stateTTL
protected Work
work
protected org.apache.commons.collections.buffer.CircularFifoBuffer
workIds
protected io.dropwizard.metrics5.Timer
workTimer
-
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
Constructors Constructor Description WorkComputation(String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cleanupWorkInFailure(Work work, Exception exception)
static Work
deserialize(byte[] data)
void
processRecord(ComputationContext context, String inputStreamName, Record record)
Process an incoming record on one of the computation's input streams.static byte[]
serialize(Work work)
void
signalStop()
A hook to inform that computation will be soon destroyed.-
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
-
-
-
-
Field Detail
-
IDS_SIZE
protected static final int IDS_SIZE
- See Also:
- Constant Field Values
-
workIds
protected final org.apache.commons.collections.buffer.CircularFifoBuffer workIds
-
workTimer
protected final io.dropwizard.metrics5.Timer workTimer
-
stateTTL
protected final long stateTTL
-
work
protected Work work
-
-
Constructor Detail
-
WorkComputation
public WorkComputation(String name)
-
-
Method Detail
-
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.
-
deserialize
public static Work deserialize(byte[] data)
-
serialize
public static byte[] serialize(Work work)
-
-