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,FixBinaryFulltextStorageAction.FixBinaryFulltextStorageComputation,GarbageCollectExpiredOAuth2TokensAction.GarbageCollectExpiredOAuth2TokensComputation,GarbageCollectOrphanBlobsAction.GarbageCollectOrphanBlobsComputation,GarbageCollectOrphanVersionsAction.GarbageCollectOrphanVersionsComputation,GarbageCollectRoutesAction.GarbageCollectRoutesComputation,IdleAction.IdleComputation,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
BulkStatusdelta
- Since:
- 10.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BulkCommandprotected Map<String,BulkCommand> protected BulkStatusprotected static final StringFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcompute(CoreSession session, List<String> ids, Map<String, Serializable> properties) voidendBucket(ComputationContext context, BulkStatus delta) Can be overridden to write to downstream computation or add results to statusprotected Durationprotected BulkCommandgetCommand(String commandId) protected booleanisAbortedCommand(String commandId) loadDocuments(CoreSession session, List<String> documentIds) Helper to load a list of documents.loadDocumentsOneByOne(CoreSession session, List<String> documentIds) protected NuxeoLoginContextloginSystemOrUser(String username) protected voidprocessBatchOfDocuments(List<String> batch) voidprocessFailure(ComputationContext context, Throwable failure) voidprocessRecord(ComputationContext context, String inputStreamName, Record record) Process an incoming record on one of the computation's input streams.voidstartBucket(String bucketKey) Can be overridden to init stuff before processing the bucketstatic voidupdateStatus(ComputationContext context, BulkStatus delta) Methods inherited from class org.nuxeo.lib.stream.computation.AbstractComputation
init, metadata, processRetry, processTimerMethods 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, signalStop
-
Field Details
-
SELECT_DOCUMENTS_IN
- See Also:
-
commands
-
command
-
delta
-
-
Constructor Details
-
AbstractBulkComputation
-
AbstractBulkComputation
-
-
Method Details
-
processRecord
Description copied from interface:ComputationProcess 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: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- Overrides:
processFailurein 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
-