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
Build elasticsearch requests to index documents.
- Since:
- 10.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected org.opensearch.action.bulk.BulkRequestprotected List<org.opensearch.action.bulk.BulkRequest>protected static final Stringprotected static final longFields inherited from class org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation
command, commands, delta, SELECT_DOCUMENTS_INFields 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 voidappend(org.opensearch.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.opensearch.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, updateStatusMethods 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
-
MAX_RECORD_SIZE
protected static final long MAX_RECORD_SIZE- See Also:
-
INDEX_OPTION
- See Also:
-
bulkRequest
protected org.opensearch.action.bulk.BulkRequest bulkRequest -
bulkRequests
-
bucketKey
-
-
Constructor Details
-
IndexRequestComputation
public IndexRequestComputation()
-
-
Method Details
-
startBucket
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.opensearch.action.index.IndexRequest indexRequest) -
endBucket
Description copied from class:AbstractBulkComputationCan be overridden to write to downstream computation or add results to status- Overrides:
endBucketin classAbstractBulkComputation
-
getIndexName
-
toBytes
protected byte[] toBytes(org.opensearch.action.bulk.BulkRequest request)
-