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
A Stream computation that consumes works.
- Since:
- 9.3
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected final long
protected Work
protected final org.apache.commons.collections4.queue.CircularFifoQueue<String>
protected final io.dropwizard.metrics5.Timer
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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[]
void
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 Details
-
IDS_SIZE
protected static final int IDS_SIZE- See Also:
-
workIds
-
workTimer
protected final io.dropwizard.metrics5.Timer workTimer -
stateTTL
protected final long stateTTL -
work
-
-
Constructor Details
-
WorkComputation
-
-
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
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
-
deserialize
-
serialize
-