public interface Batcher
The base class (shared methods) for QueryBatcher and WriteBatcher.
| Modifier and Type | Method and Description |
|---|---|
int |
getBatchSize() |
ForestConfiguration |
getForestConfig() |
String |
getJobName() |
JobTicket |
getJobTicket()
After the job has been started, returns the JobTicket generated when the job was started.
|
int |
getThreadCount() |
boolean |
isStopped()
true if the job is terminated (e.g.
|
Batcher |
withBatchSize(int batchSize)
The size of each batch (usually 50-500).
|
Batcher |
withForestConfig(ForestConfiguration forestConfig)
Updates the ForestConfiguration used by this job to spread the writes or reads.
|
Batcher |
withJobName(String jobName)
Sets the name of the job to help with managing multiple concurrent jobs.
|
Batcher |
withThreadCount(int threadCount)
The number of threads to be used internally by this job to perform concurrent tasks on batches (usually > 10).
|
Batcher withJobName(String jobName)
Sets the name of the job to help with managing multiple concurrent jobs.
jobName - the name you would like to assign to this jobString getJobName()
Batcher withBatchSize(int batchSize)
The size of each batch (usually 50-500). With some experimentation with your custom job, this value can be tuned. Tuning this value is one of the best ways to achieve optimal throughput.
This method cannot be called after the job has started.
batchSize - the batch size – must be 1 or greaterint getBatchSize()
Batcher withThreadCount(int threadCount)
The number of threads to be used internally by this job to perform concurrent tasks on batches (usually > 10). With some experimentation with your custom job and client environment, this value can be tuned. Tuning this value is one of the best ways to achieve optimal throughput or to throttle the server resources used by this job. Setting this to 1 does not guarantee that batches will be processed sequentially because the calling thread will sometimes also process batches.
This method cannot be called after the job has started.
int getThreadCount()
ForestConfiguration getForestConfig()
Batcher withForestConfig(ForestConfiguration forestConfig)
Updates the ForestConfiguration used by this job to spread the writes or reads. This can be called mid-job in order to accommodate for node failures or other changes without requiring a restart of this job. Ideally, this ForestConfiguration will come from DataMovementManager.readForestConfig(), perhaps wrapped by something like FilteredForestConfiguration.
boolean isStopped()
true if the job is terminated (e.g. DataMovementManager.stopJob was called), false otherwise
DataMovementManager.stopJob was called), false otherwiseJobTicket getJobTicket()
After the job has been started, returns the JobTicket generated when the job was started.
IllegalStateException - if this job has not yet been startedCopyright © 2013-2017 MarkLogic Corporation.