Package org.nuxeo.lib.stream.computation
Class AbstractComputation
java.lang.Object
org.nuxeo.lib.stream.computation.AbstractComputation
- All Implemented Interfaces:
Computation
- Direct Known Subclasses:
AbstractBatchComputation,AbstractBulkComputation,AbstractTransientBlobComputation,BulkScrollerComputation,BulkStatusComputation,LatencyTrackerComputation,StreamAuditStorageWriter.AuditStorageLogWriterComputation,StreamDocumentGC.DocumentGCComputation,StreamIntrospectionComputation,StreamMetricsComputation,StreamOrphanBlobGC.BlobGCComputation,WorkComputation,WorkManagerRunWorkInFailure.WorkFailureComputation
An abstract
Computation that manages the metadata init.
By convention the inputs streams are named internally: i1, i2 ...
and the output streams are named: o1, o2 ...
- Since:
- 9.3
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractComputation(String name, int nbInputStreams, int nbOutputStreams) Creates a computation with the requested number of input and output streams. -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(ComputationContext context) Called when the framework has registered the computation successfully.metadata()Identify the computation.voidprocessFailure(ComputationContext context, Throwable failure) voidprocessRetry(ComputationContext context, Throwable failure) voidprocessTimer(ComputationContext context, String key, long timestamp) Process a timer callback previously set viaComputationContext.setTimer(String, long).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.lib.stream.computation.Computation
destroy, processRecord, signalStop
-
Field Details
-
metadata
-
INPUT_1
- See Also:
-
INPUT_2
- See Also:
-
INPUT_3
- See Also:
-
OUTPUT_1
- See Also:
-
OUTPUT_2
- See Also:
-
OUTPUT_3
- See Also:
-
OUTPUT_4
- See Also:
-
INPUT_NULL
- See Also:
-
-
Constructor Details
-
AbstractComputation
Creates a computation with the requested number of input and output streams.- Since:
- 10.3
-
-
Method Details
-
init
Description copied from interface:ComputationCalled when the framework has registered the computation successfully. Gives users a first opportunity to schedule timer callbacks and produce records. This method can be called multiple times.- Specified by:
initin interfaceComputation- Parameters:
context- The computation context object provided by the system.
-
processTimer
Description copied from interface:ComputationProcess a timer callback previously set viaComputationContext.setTimer(String, long).- Specified by:
processTimerin interfaceComputation- Parameters:
context- The computation context object provided by the system.key- The name of the timer.timestamp- The timestamp (in ms) for which the callback was scheduled.
-
metadata
Description copied from interface:ComputationIdentify the computation.- Specified by:
metadatain interfaceComputation- Returns:
- computation's metadata.
-
processRetry
Description copied from interface:ComputationCalled after a failure inComputation.processRecord(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, org.nuxeo.lib.stream.computation.Record)orComputation.processTimer(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, long)before retrying.- Specified by:
processRetryin interfaceComputation
-
processFailure
Description copied from interface:ComputationCalled whenComputation.processRecord(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, org.nuxeo.lib.stream.computation.Record)orComputation.processTimer(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, long)fails and cannot be retried.- Specified by:
processFailurein interfaceComputation
-