public interface DataMovementManager
DataMovementManager is the starting point for getting new
instances of QueryBatcher, WriteBatcher and RowBatcher, 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.
DataMovementManager dataMovementManager = databaseClient.newDataMovementManager();
WriteBatcher batcher = dataMovementManager.newWriteBatcher();
dataMovementManager.startJob(batcher);
. . .
dataMovementManager.stopJob(batcher);
dataMovementManager.release();
Modifier and Type | Method and Description |
---|---|
JobTicket |
getActiveJob(java.lang.String jobId)
Gets the job ticket for an active job that has
not been stopped by calling stopJob method.
|
DatabaseClient.ConnectionType |
getConnectionType()
Identify whether the DataMovementManager
connects directly to each MarkLogic host with a forest for the
database or whether the DataMovementManager uses a gateway such as
a load balancer to communicate with the MarkLogic hosts.
|
JobReport |
getJobReport(JobTicket ticket)
Get a snapshot report of the state of the job
when the call is made.
|
QueryBatcher |
newQueryBatcher(CtsQueryDefinition query)
Create a new QueryBatcher instance configured to
retrieve uris that match this query.
|
QueryBatcher |
newQueryBatcher(java.util.Iterator<java.lang.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(RawCtsQueryDefinition query)
Create a new QueryBatcher instance configured to
retrieve uris that match this Cts 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.
|
<T> RowBatcher<T> |
newRowBatcher(ContentHandle<T> rowsHandle)
Create a new RowBatcher instance to export all
of the rows from a view in batches.
|
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(RowBatcher<?> batcher)
Starts the RowBatcher 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()
JobTicket startJob(WriteBatcher batcher)
batcher
- the WriteBatcher instance which has to
be startedJobTicket startJob(QueryBatcher batcher)
batcher
- the QueryBatcher instance which has to
be startedJobTicket startJob(RowBatcher<?> batcher)
batcher
- the RowBatcher instance to startJobReport getJobReport(JobTicket ticket)
ticket
- the JobTicket for which the report has to
be generatedJobTicket getActiveJob(java.lang.String jobId)
jobId
- the jobId of the active jobvoid stopJob(JobTicket ticket)
ticket
- indicates the job to stopvoid stopJob(Batcher batcher)
batcher
- the batcher instance to stopWriteBatcher newWriteBatcher()
QueryBatcher newQueryBatcher(CtsQueryDefinition query)
query
- the query used to find matching urisQueryBatcher newQueryBatcher(StructuredQueryDefinition query)
query
- the query used to find matching urisQueryBatcher newQueryBatcher(RawStructuredQueryDefinition query)
query
- the query used to find matching urisQueryBatcher newQueryBatcher(StringQueryDefinition query)
query
- the query used to find matching urisQueryBatcher newQueryBatcher(RawCombinedQueryDefinition query)
query
- the query used to find matching urisQueryBatcher newQueryBatcher(RawCtsQueryDefinition query)
query
- the query used to find matching urisQueryBatcher newQueryBatcher(java.util.Iterator<java.lang.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 uris<T> RowBatcher<T> newRowBatcher(ContentHandle<T> rowsHandle)
You pass a sample handle (that is, an adapter for the Java class
that should store a batch of retrieved rows). The handle must
implement the ContentHandle
and StructuredReadHandle
interfaces.
T
- the Java class that stores a batch of
retrieved rolesrowsHandle
- a sample handle for storing a batch
of rowsForestConfiguration readForestConfig()
DatabaseClient.ConnectionType getConnectionType()
Copyright © 2024 MarkLogic Corporation. All Rights Reserved.