public interface DataMovementManager
DataMovementManager is the starting point for getting new instances of QueryBatcher and WriteBatcher, configured with a DatabaseClient and ForestConfiguration. On instantiation, it will immediately call readForestConfig to obtain the ForestConfiguration from which it can create host-specific DatabaseClient instances for each applicable host. Applicable hosts are those with forests for the database specified in the DatabaseClient. If not specified, the database is the default database for the port in the DatabaseClient. Call dataMovementMangaer.release() when you’re done with your DataMovementManager instance to free resources associated with those host-specific DatabaseClient instances.
Sample Usage:
DataMovementManager dataMovementManager = databaseClient.newDataMovementManager();
WriteBatcher batcher = dataMovementManager.newWriteBatcher();
dataMovementManager.startJob(batcher);
. . .
dataMovementManager.stopJob(batcher);
dataMovementManager.release();
| Modifier and Type | Method and Description |
|---|---|
JobReport |
getJobReport(JobTicket ticket)
Get a snapshot report of the state of the job when the call is made.
|
QueryBatcher |
newQueryBatcher(Iterator<String> iterator)
Create a new QueryBatcher instance configured to retrieve uris from this Iterator.
|
QueryBatcher |
newQueryBatcher(RawCombinedQueryDefinition query)
Create a new QueryBatcher instance configured to retrieve uris that match this query.
|
QueryBatcher |
newQueryBatcher(RawStructuredQueryDefinition query)
Create a new QueryBatcher instance configured to retrieve uris that match this query.
|
QueryBatcher |
newQueryBatcher(StringQueryDefinition query)
Create a new QueryBatcher instance configured to retrieve uris that match this query.
|
QueryBatcher |
newQueryBatcher(StructuredQueryDefinition query)
Create a new QueryBatcher instance configured to retrieve uris that match this query.
|
WriteBatcher |
newWriteBatcher()
Create a new WriteBatcher instance.
|
ForestConfiguration |
readForestConfig()
Update the ForestConfiguration with the latest from the server.
|
void |
release()
Calls release() on all host-specific DatabaseClient instances (but not on the DatabaseClient instance used to create this DataMovementManager instance).
|
JobTicket |
startJob(QueryBatcher batcher)
Starts the QueryBatcher job.
|
JobTicket |
startJob(WriteBatcher batcher)
Begins job tracking on the WriteBatcher.
|
void |
stopJob(Batcher batcher)
Immediately cancel all queued tasks, prevent new tasks from being added to the queue, and begin to free all resources.
|
void |
stopJob(JobTicket ticket)
Immediately cancel all queued tasks, prevent new tasks from being added to the queue, and begin to free all resources.
|
void release()
Calls release() on all host-specific DatabaseClient instances (but not on the DatabaseClient instance used to create this DataMovementManager instance).
JobTicket startJob(WriteBatcher batcher)
Begins job tracking on the WriteBatcher. Calling startJob is not required on a WriteBatcher if you don’t intend to ever call stopJob or look at the JobReport.
batcher - the WriteBatcher instance which has to be startedJobTicket startJob(QueryBatcher batcher)
Starts the QueryBatcher job.
batcher - the QueryBatcher instance which has to be startedJobReport getJobReport(JobTicket ticket)
Get a snapshot report of the state of the job when the call is made. Depends on some pre-installed listeners attached to the job to collect the details.
ticket - the JobTicket for which the report has to be generatedvoid stopJob(JobTicket ticket)
Immediately cancel all queued tasks, prevent new tasks from being added to the queue, and begin to free all resources. In-process tasks cannot be cancelled because they talk to the REST server which does not have such a mechanism. This does not block until all in-process tasks are finished, for that use QueryBatcher.awaitCompletion() or WriteBatcher.awaitCompletion().
ticket - indicates the job to stopvoid stopJob(Batcher batcher)
Immediately cancel all queued tasks, prevent new tasks from being added to the queue, and begin to free all resources. In-process tasks cannot be cancelled because they talk to the REST server which does not have such a mechanism. This does not block until all in-process tasks are finished, for that use QueryBatcher.awaitCompletion() or WriteBatcher.awaitCompletion().
batcher - the batcher instance to stopWriteBatcher newWriteBatcher()
Create a new WriteBatcher instance.
QueryBatcher newQueryBatcher(StructuredQueryDefinition query)
Create a new QueryBatcher instance configured to retrieve uris that match this query.
query - the query used to find matching urisQueryBatcher newQueryBatcher(RawStructuredQueryDefinition query)
Create a new QueryBatcher instance configured to retrieve uris that match this query.
query - the query used to find matching urisQueryBatcher newQueryBatcher(StringQueryDefinition query)
Create a new QueryBatcher instance configured to retrieve uris that match this query.
query - the query used to find matching urisQueryBatcher newQueryBatcher(RawCombinedQueryDefinition query)
Create a new QueryBatcher instance configured to retrieve uris that match this query.
query - the query used to find matching urisQueryBatcher newQueryBatcher(Iterator<String> iterator)
Create a new QueryBatcher instance configured to retrieve uris from this Iterator. This form enables the uris (actually any String) to come from any source, whereas the other form requires the uris to come from the results of a query. This form is helpful when deleting documents when one cannot set the server’s merge timestamp. For more discussion, see QueryBatcher.
The Iterator needn’t be thread-safe as it is only iterated from one thread.
iterator - the provider of urisForestConfiguration readForestConfig()
Update the ForestConfiguration with the latest from the server.
Copyright © 2013-2017 MarkLogic Corporation.