Skip to content

QueryBatcherTemplate

rjrudin edited this page Mar 14, 2018 · 1 revision

QueryBatcherTemplate is a Spring-style Template class that simplifies common operations involving a QueryBatcher. A QueryBatcherTemplate depends on an instance of DatabaseClient, and then you can configure it and call the method that matches your use case. Example:

QueryBatcherTemplate t = new QueryBatcherTemplate(databaseClient);
t.setThreadCount(32); // defaults to 8 
t.setBatchSize(50); // defaults to 100
t.setApplyConsistentSnapshot(true); // defaults to true
t.setAwaitCompletion(true); // defaults to true
t.applyOnCollections(someListener, "collection1", "collection2");
t.applyOnUriPattern(someOtherListener, "**some-pattern*.xml"); // uses cts:uri-match under the hood

In addition to QueryBatcherTemplate, ml-javaclient-util provides implementations of the QueryBatchListener interface for common use cases. Implementations currently exist for adding, removing, setting, and deleting collections, and for adding, removing, and setting permissions.

Clone this wiki locally