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
Modifier and TypeFieldDescriptionprotected String
protected org.opensearch.action.bulk.BulkRequest
protected List<org.opensearch.action.bulk.BulkRequest>
protected static final String
protected static final long
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
append
(org.opensearch.action.index.IndexRequest indexRequest) protected void
compute
(CoreSession session, List<String> documentIds, Map<String, Serializable> properties) void
endBucket
(ComputationContext context, BulkStatus delta) Can be overridden to write to downstream computation or add results to statusprotected String
getIndexName
(CoreSession session, Map<String, Serializable> properties) void
startBucket
(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, 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 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:AbstractBulkComputation
Can be overridden to init stuff before processing the bucket- Overrides:
startBucket
in classAbstractBulkComputation
-
compute
protected void compute(CoreSession session, List<String> documentIds, Map<String, Serializable> properties) - Specified by:
compute
in classAbstractBulkComputation
-
append
protected void append(org.opensearch.action.index.IndexRequest indexRequest) -
endBucket
Description copied from class:AbstractBulkComputation
Can be overridden to write to downstream computation or add results to status- Overrides:
endBucket
in classAbstractBulkComputation
-
getIndexName
-
toBytes
protected byte[] toBytes(org.opensearch.action.bulk.BulkRequest request)
-