public class ElasticsearchWorkProcessor extends Object implements AutoCloseable
ElasticsearchWorks against the Elasticsearch server.
When processing multiple requests, bulk requests will be formed and executed as far as possible.
Requests can be processed synchronously or asynchronously. In the latter case, incoming requests are added to a queue
via AsyncBackendRequestProcessor from where a worker runnable will process them in bulks.
| Constructor and Description |
|---|
ElasticsearchWorkProcessor(BuildContext context,
ElasticsearchClient client,
GsonProvider gsonProvider,
ElasticsearchWorkFactory workFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitAsyncProcessingCompletion()
Blocks until the queue of requests scheduled for asynchronous processing has been fully processed.
|
void |
close() |
void |
executeAsync(ElasticsearchWork<?> request)
Executes a work asynchronously, passing any exception to the error handler.
|
void |
executeSyncSafe(Iterable<ElasticsearchWork<?>> requests)
Executes works synchronously, passing any thrown exception to the error handler.
|
<T> T |
executeSyncUnsafe(ElasticsearchWork<T> work)
Executes a work synchronously, potentially throwing exceptions (the error handler isn't used).
|
public ElasticsearchWorkProcessor(BuildContext context, ElasticsearchClient client, GsonProvider gsonProvider, ElasticsearchWorkFactory workFactory)
public void close()
close in interface AutoCloseablepublic <T> T executeSyncUnsafe(ElasticsearchWork<T> work)
public void executeSyncSafe(Iterable<ElasticsearchWork<?>> requests)
public void executeAsync(ElasticsearchWork<?> request)
public void awaitAsyncProcessingCompletion()
Copyright © 2006–2017 Hibernate. All rights reserved.