public abstract class AbstractBulkComputation extends AbstractComputation
Inputs:
BulkBucket
BulkStatus
deltaModifier and Type | Field and Description |
---|---|
protected BulkCommand |
command |
protected Map<String,BulkCommand> |
commands |
protected BulkStatus |
delta |
protected static String |
SELECT_DOCUMENTS_IN |
Constructor and Description |
---|
AbstractBulkComputation(String name) |
AbstractBulkComputation(String name,
int nbOutputStreams) |
Modifier and Type | Method and Description |
---|---|
protected 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 status
|
protected BulkCommand |
getCommand(String commandId) |
BulkCommand |
getCurrentCommand() |
protected boolean |
isAbortedCommand(String commandId) |
DocumentModelList |
loadDocuments(CoreSession session,
List<String> documentIds)
Helper to load a list of documents.
|
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 bucket
|
static void |
updateStatus(ComputationContext context,
BulkStatus delta) |
init, metadata, processRetry, processTimer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, signalStop
protected static final String SELECT_DOCUMENTS_IN
protected Map<String,BulkCommand> commands
protected BulkCommand command
protected BulkStatus delta
public AbstractBulkComputation(String name)
public AbstractBulkComputation(String name, int nbOutputStreams)
public void processRecord(ComputationContext context, String inputStreamName, Record record)
Computation
context
- The computation context object provided by the system.inputStreamName
- Name of the input stream that provides the record.record
- The record.protected boolean isAbortedCommand(String commandId)
protected BulkCommand getCommand(String commandId)
public BulkCommand getCurrentCommand()
protected void processBatchOfDocuments(List<String> batch)
public void startBucket(String bucketKey)
public void endBucket(ComputationContext context, BulkStatus delta)
public void processFailure(ComputationContext context, Throwable failure)
Computation
Computation.processRecord(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, org.nuxeo.lib.stream.computation.Record)
or Computation.processTimer(org.nuxeo.lib.stream.computation.ComputationContext, java.lang.String, long)
fails and cannot be retried.processFailure
in interface Computation
processFailure
in class AbstractComputation
public static void updateStatus(ComputationContext context, BulkStatus delta)
protected abstract void compute(CoreSession session, List<String> ids, Map<String,Serializable> properties)
public DocumentModelList loadDocuments(CoreSession session, List<String> documentIds)
Copyright © 2019 Nuxeo. All rights reserved.