Class BulkOperation
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageProducer
,AdaptrisMessageSender
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
ElasticRestProducer.getIndex()
should return the index that the documents will be inserted against
ElasticSearch; the type
is taken from the DocumentBuilder
The action for each document is driven by the configured ActionExtractor
instance. In the
event of an DocumentAction.UPSERT
action then the same XContentBuilder
from the
DocumentWrapper
is used as both the update and upsert document via
doc(XContentBuilder
} and upsert(XContentBuilder)
. This makes the assumption that
the document generated contains all the data required, not just a subset. If in doubt; stick to a
normal DocumentAction.UPDATE
which will throw a DocumentMissingException
failing
the messages.
In the adapter configuration file this class is aliased as elastic-rest-bulk-operation which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.elastic.rest.SingleOperation
requestBuilder
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AdaptrisMessage
doRequest
(AdaptrisMessage msg, String index, long timeout) The batch window which is the number of operations that make a bulk request before its executed.void
setBatchWindow
(Integer batchWindow) The batch window which is the number of operations that make a bulk request before its executed.Methods inherited from class com.adaptris.core.elastic.rest.SingleOperation
actionExtractor, getAction, getDocumentBuilder, getRefreshPolicy, setAction, setDocumentBuilder, setRefreshPolicy, withAction, withDocumentBuilder, withRefreshPolicy
Methods inherited from class com.adaptris.core.elastic.rest.ElasticRestProducer
defaultTimeout, doProduce, endpoint, getIndex, prepare, setIndex, withIndex
Methods inherited from class com.adaptris.core.RequestReplyProducerImp
produce, request, request
Methods inherited from class com.adaptris.core.RequestReplyProducerBase
copyReplyContents, getIgnoreReplyMetadata, mergeReply, setIgnoreReplyMetadata
Methods inherited from class com.adaptris.core.AdaptrisMessageProducerImp
createName
Methods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
Methods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createQualifier, isTrackingEndpoint
-
Constructor Details
-
BulkOperation
public BulkOperation()
-
-
Method Details
-
doRequest
protected AdaptrisMessage doRequest(AdaptrisMessage msg, String index, long timeout) throws ProduceException - Overrides:
doRequest
in classSingleOperation
- Throws:
ProduceException
-
withBatchWindow
-
getBatchWindow
The batch window which is the number of operations that make a bulk request before its executed.If not specified explicitly then the default is 10000
-
setBatchWindow
The batch window which is the number of operations that make a bulk request before its executed.If not specified explicitly then the default is 10000
-