Package org.nuxeo.lib.stream.computation
Interface Computation
- All Known Implementing Classes:
AbstractAutomationBulkAction.AutomationComputation
,AbstractBatchComputation
,AbstractBulkComputation
,AbstractBulkMigrator.MigrationComputation
,AbstractComputation
,AbstractTransientBlobComputation
,BulkIndexComputation
,BulkScrollerComputation
,BulkStatusComputation
,CSVProjectionComputation
,DeletionAction.DeletionComputation
,DocumentRoutingEscalationAction.DocumentRoutingEscalationComputation
,ExposeBlob
,ExtractBinaryFulltextAction.ExtractBinaryFulltextComputation
,FireGroupUpdatedEventAction.FireGroupUpdatedEventComputation
,GarbageCollectOrphanBlobsAction.GarbageCollectOrphanBlobsComputation
,GarbageCollectOrphanVersionsAction.GarbageCollectOrphanVersionsComputation
,GarbageCollectRoutesAction.GarbageCollectRoutesComputation
,IndexCompletionComputation
,IndexRequestComputation
,LatencyDatadogComputation
,LatencyMonitorComputation
,LatencyTrackerComputation
,MakeBlob
,RecomputeThumbnailsAction.RecomputeThumbnailsComputation
,RecomputeTranscodedVideosComputation
,RecomputeVideoInfoComputation
,RecomputeViewsAction.RecomputeViewsComputation
,RemoveProxyAction.RemoveProxyComputation
,RetentionExpiredAction.RetentionExpiredComputation
,S3SetBlobLengthAction.SetBlobLengthComputation
,SetPropertiesAction.SetPropertyComputation
,SetSystemPropertiesAction.SetSystemPropertyComputation
,SortBlob
,StreamAuditStorageWriter.AuditStorageLogWriterComputation
,StreamAuditWriter.AuditLogWriterComputation
,StreamDocumentGC.DocumentGCComputation
,StreamIntrospectionComputation
,StreamMetricsComputation
,StreamOrphanBlobGC.BlobGCComputation
,TrashAction.TrashComputation
,UpdateReadAclsAction.UpdateReadAclsComputation
,WorkComputation
,WorkManagerRunWorkInFailure.WorkFailureComputation
,ZipBlob
public interface Computation
Computation receives records from input streams one at a time, it can produce record on its output streams. A timer
processing can be used for windowing computation.
- Since:
- 9.3
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
destroy()
Called when the framework is ready to shutdown the computation.void
init
(ComputationContext context) Called when the framework has registered the computation successfully.metadata()
Identify the computation.void
processFailure
(ComputationContext context, Throwable failure) void
processRecord
(ComputationContext context, String inputStreamName, Record record) Process an incoming record on one of the computation's input streams.void
processRetry
(ComputationContext context, Throwable failure) void
processTimer
(ComputationContext context, String key, long timestamp) Process a timer callback previously set viaComputationContext.setTimer(String, long)
.default void
A hook to inform that computation will be soon destroyed.
-
Method Details
-
init
Called 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.- Parameters:
context
- The computation context object provided by the system.
-
destroy
default void destroy()Called when the framework is ready to shutdown the computation. Gives users a chance to perform some cleanup before the process is killed. -
processRecord
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.
-
processTimer
Process a timer callback previously set viaComputationContext.setTimer(String, long)
.- 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
ComputationMetadata metadata()Identify the computation.- Returns:
- computation's metadata.
-
signalStop
default void signalStop()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.- Since:
- 10.2
-
processRetry
Called after a failure inprocessRecord(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, org.nuxeo.lib.stream.computation.Record)
orprocessTimer(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, long)
before retrying.- Since:
- 10.3
-
processFailure
Called whenprocessRecord(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, org.nuxeo.lib.stream.computation.Record)
orprocessTimer(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, long)
fails and cannot be retried.- Since:
- 10.3
-