Package org.nuxeo.elasticsearch.bulk
Class IndexRequestComputation
- java.lang.Object
-
- org.nuxeo.lib.stream.computation.AbstractComputation
-
- org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation
-
- org.nuxeo.elasticsearch.bulk.IndexRequestComputation
-
- All Implemented Interfaces:
Computation
public class IndexRequestComputation extends AbstractBulkComputation
Build elasticsearch requests to index documents.- Since:
- 10.3
-
-
Field Summary
Fields Modifier and Type Field Description protected StringbucketKeyprotected org.elasticsearch.action.bulk.BulkRequestbulkRequestprotected List<org.elasticsearch.action.bulk.BulkRequest>bulkRequestsprotected static StringINDEX_OPTIONprotected static longMAX_RECORD_SIZE-
Fields inherited from class org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation
command, commands, delta, SELECT_DOCUMENTS_IN
-
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
Constructors Constructor Description IndexRequestComputation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappend(org.elasticsearch.action.index.IndexRequest indexRequest)protected voidcompute(CoreSession session, List<String> documentIds, Map<String,Serializable> properties)voidendBucket(ComputationContext context, BulkStatus delta)Can be overridden to write to downstream computation or add results to statusprotected StringgetIndexName(CoreSession session, Map<String,Serializable> properties)voidstartBucket(String bucketKey)Can be overridden to init stuff before processing the bucketprotected byte[]toBytes(org.elasticsearch.action.bulk.BulkRequest request)-
Methods inherited from class org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation
getBatchTransactionTimeout, getCommand, getCurrentCommand, isAbortedCommand, loadDocuments, loadDocumentsOneByOne, loginSystemOrUser, processBatchOfDocuments, processFailure, processRecord, updateStatus
-
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 Detail
-
MAX_RECORD_SIZE
protected static final long MAX_RECORD_SIZE
- See Also:
- Constant Field Values
-
INDEX_OPTION
protected static final String INDEX_OPTION
- See Also:
- Constant Field Values
-
bulkRequest
protected org.elasticsearch.action.bulk.BulkRequest bulkRequest
-
bulkRequests
protected List<org.elasticsearch.action.bulk.BulkRequest> bulkRequests
-
bucketKey
protected String bucketKey
-
-
Method Detail
-
startBucket
public void startBucket(String bucketKey)
Description copied from class:AbstractBulkComputationCan be overridden to init stuff before processing the bucket- Overrides:
startBucketin classAbstractBulkComputation
-
compute
protected void compute(CoreSession session, List<String> documentIds, Map<String,Serializable> properties)
- Specified by:
computein classAbstractBulkComputation
-
append
protected void append(org.elasticsearch.action.index.IndexRequest indexRequest)
-
endBucket
public void endBucket(ComputationContext context, BulkStatus delta)
Description copied from class:AbstractBulkComputationCan be overridden to write to downstream computation or add results to status- Overrides:
endBucketin classAbstractBulkComputation
-
getIndexName
protected String getIndexName(CoreSession session, Map<String,Serializable> properties)
-
toBytes
protected byte[] toBytes(org.elasticsearch.action.bulk.BulkRequest request)
-
-