Class AbstractBulkComputation
java.lang.Object
org.nuxeo.lib.stream.computation.AbstractComputation
org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation
- All Implemented Interfaces:
Computation
- Direct Known Subclasses:
AbstractAutomationBulkAction.AutomationComputation
,AbstractBulkMigrator.MigrationComputation
,CSVProjectionComputation
,DeletionAction.DeletionComputation
,DocumentRoutingEscalationAction.DocumentRoutingEscalationComputation
,ExtractBinaryFulltextAction.ExtractBinaryFulltextComputation
,FireGroupUpdatedEventAction.FireGroupUpdatedEventComputation
,GarbageCollectOrphanBlobsAction.GarbageCollectOrphanBlobsComputation
,GarbageCollectOrphanVersionsAction.GarbageCollectOrphanVersionsComputation
,GarbageCollectRoutesAction.GarbageCollectRoutesComputation
,IndexRequestComputation
,RecomputeThumbnailsAction.RecomputeThumbnailsComputation
,RecomputeTranscodedVideosComputation
,RecomputeVideoInfoComputation
,RecomputeViewsAction.RecomputeViewsComputation
,RemoveProxyAction.RemoveProxyComputation
,RetentionExpiredAction.RetentionExpiredComputation
,S3SetBlobLengthAction.SetBlobLengthComputation
,SetPropertiesAction.SetPropertyComputation
,SetSystemPropertiesAction.SetSystemPropertyComputation
,TrashAction.TrashComputation
,UpdateReadAclsAction.UpdateReadAclsComputation
Base class for bulk action computation.
Inputs:
- i1: Reads
BulkBucket
- o1: Writes
BulkStatus
delta
- Since:
- 10.2
-
Field Summary
Modifier and TypeFieldDescriptionprotected BulkCommand
protected Map<String,
BulkCommand> protected BulkStatus
protected static final String
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 abstract void
compute
(CoreSession session, List<String> ids, Map<String, Serializable> properties) void
endBucket
(ComputationContext context, BulkStatus delta) Can be overridden to write to downstream computation or add results to statusprotected Duration
protected BulkCommand
getCommand
(String commandId) protected boolean
isAbortedCommand
(String commandId) loadDocuments
(CoreSession session, List<String> documentIds) Helper to load a list of documents.loadDocumentsOneByOne
(CoreSession session, List<String> documentIds) protected NuxeoLoginContext
loginSystemOrUser
(String username) protected void
processBatchOfDocuments
(List<String> batch) 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
startBucket
(String bucketKey) Can be overridden to init stuff before processing the bucketstatic void
updateStatus
(ComputationContext context, BulkStatus delta) Methods inherited from class org.nuxeo.lib.stream.computation.AbstractComputation
init, metadata, 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, signalStop
-
Field Details
-
SELECT_DOCUMENTS_IN
- See Also:
-
commands
-
command
-
delta
-
-
Constructor Details
-
AbstractBulkComputation
-
AbstractBulkComputation
-
-
Method Details
-
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.
-
isAbortedCommand
-
getCommand
-
getCurrentCommand
-
processBatchOfDocuments
-
getBatchTransactionTimeout
- Returns:
- the transaction timeout to use to process the bucket, <= 0 for the default
-
loginSystemOrUser
- Throws:
LoginException
-
startBucket
Can be overridden to init stuff before processing the bucket -
endBucket
Can be overridden to write to downstream computation or add results to status -
processFailure
Description copied from interface:Computation
Called 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:
processFailure
in interfaceComputation
- Overrides:
processFailure
in classAbstractComputation
-
updateStatus
-
compute
protected abstract void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) -
loadDocuments
Helper to load a list of documents. Documents without read access or that does not exists are not returned. -
loadDocumentsOneByOne
-