Package io.ebeanservice.elastic
Class ElasticUpdateProcessor
- java.lang.Object
-
- io.ebeanservice.elastic.ElasticUpdateProcessor
-
- All Implemented Interfaces:
io.ebeanservice.docstore.api.DocStoreUpdateProcessor
public class ElasticUpdateProcessor extends Object implements io.ebeanservice.docstore.api.DocStoreUpdateProcessor
ElasticSearch implementation of the DocStoreUpdateProcessor.
-
-
Constructor Summary
Constructors Constructor Description ElasticUpdateProcessor(io.ebean.plugin.SpiServer server, IndexQueueWriter queueWriter, com.fasterxml.jackson.core.JsonFactory jsonFactory, Object defaultObjectMapper, IndexMessageSender messageSender, int defaultBatchSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit(io.ebeanservice.docstore.api.DocStoreTransaction docStoreTxn)BulkUpdatecreateBulkUpdate(int batchSize)Create the BulkUpdate for batch sending bulk API messages.<T> io.ebeanservice.docstore.api.DocStoreQueryUpdate<T>createQueryUpdate(io.ebean.plugin.BeanType<T> beanType, int batchSize)Create an 'update by query' processor.io.ebeanservice.docstore.api.DocStoreTransactioncreateTransaction(int batchSize)voidonStartup()Initialise communication with the queue.voidprocess(io.ebeanservice.docstore.api.DocStoreUpdates updates, int batchSize)Process the post-commit updates that have come from the Ebean transaction manager.longprocessQueue(BulkUpdate txn, List<io.ebean.DocStoreQueueEntry> entries)Process queue entries.
-
-
-
Constructor Detail
-
ElasticUpdateProcessor
public ElasticUpdateProcessor(io.ebean.plugin.SpiServer server, IndexQueueWriter queueWriter, com.fasterxml.jackson.core.JsonFactory jsonFactory, Object defaultObjectMapper, IndexMessageSender messageSender, int defaultBatchSize)
-
-
Method Detail
-
createTransaction
public io.ebeanservice.docstore.api.DocStoreTransaction createTransaction(int batchSize)
- Specified by:
createTransactionin interfaceio.ebeanservice.docstore.api.DocStoreUpdateProcessor
-
commit
public void commit(io.ebeanservice.docstore.api.DocStoreTransaction docStoreTxn)
- Specified by:
commitin interfaceio.ebeanservice.docstore.api.DocStoreUpdateProcessor
-
onStartup
public void onStartup()
Initialise communication with the queue.
-
createQueryUpdate
public <T> io.ebeanservice.docstore.api.DocStoreQueryUpdate<T> createQueryUpdate(io.ebean.plugin.BeanType<T> beanType, int batchSize) throws IOException
Create an 'update by query' processor.- Specified by:
createQueryUpdatein interfaceio.ebeanservice.docstore.api.DocStoreUpdateProcessor- Throws:
IOException
-
createBulkUpdate
public BulkUpdate createBulkUpdate(int batchSize) throws IOException
Create the BulkUpdate for batch sending bulk API messages.- Throws:
IOException
-
process
public void process(io.ebeanservice.docstore.api.DocStoreUpdates updates, int batchSize)
Process the post-commit updates that have come from the Ebean transaction manager.- Specified by:
processin interfaceio.ebeanservice.docstore.api.DocStoreUpdateProcessor
-
processQueue
public long processQueue(BulkUpdate txn, List<io.ebean.DocStoreQueueEntry> entries) throws IOException
Process queue entries.- Throws:
IOException
-
-