public class WorkingBulkByScrollTask extends BulkByScrollTask implements SuccessfullyProcessed
BulkByScrollTask
subclass for tasks that actually perform the work. Compare to ParentBulkByScrollTask
.BulkByScrollTask.Status, BulkByScrollTask.StatusOrException
Constructor and Description |
---|
WorkingBulkByScrollTask(long id,
java.lang.String type,
java.lang.String action,
java.lang.String description,
TaskId parentTask,
java.lang.Integer sliceId,
float requestsPerSecond) |
Modifier and Type | Method and Description |
---|---|
void |
countBatch() |
void |
countBulkRetry() |
void |
countCreated() |
void |
countDeleted() |
void |
countNoop() |
void |
countSearchRetry() |
void |
countUpdated() |
void |
countVersionConflict() |
void |
delayPrepareBulkRequest(ThreadPool threadPool,
TimeValue lastBatchStartTime,
int lastBatchSize,
AbstractRunnable prepareBulkRequestRunnable)
Schedule prepareBulkRequestRunnable to run after some delay.
|
long |
getCreated()
Count of documents created.
|
long |
getDeleted()
Count of successful delete operations.
|
TaskInfo |
getInfoGivenSliceInfo(java.lang.String localNodeId,
java.util.List<TaskInfo> sliceInfo)
Build the status for this task given a snapshot of the information of running slices.
|
BulkByScrollTask.Status |
getStatus()
Build a status for this task or null if this task doesn't have status.
|
long |
getUpdated()
Count of documents updated.
|
protected void |
onCancelled()
Called after the task is cancelled so that it can take any actions that it has to take.
|
void |
rethrottle(float newRequestsPerSecond)
Apply the
newRequestsPerSecond . |
int |
runningSliceSubTasks()
The number of sub-slices that are still running.
|
void |
setTotal(long totalHits) |
TimeValue |
throttleWaitTime(TimeValue lastBatchStartTime,
TimeValue now,
int lastBatchSize) |
shouldCancelChildrenOnCancellation
cancelOnParentLeaving, getReasonCancelled, isCancelled
getAction, getDescription, getId, getParentTaskId, getStartTime, getType, result, result, taskInfo, taskInfo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSuccessfullyProcessed
public WorkingBulkByScrollTask(long id, java.lang.String type, java.lang.String action, java.lang.String description, TaskId parentTask, java.lang.Integer sliceId, float requestsPerSecond)
public BulkByScrollTask.Status getStatus()
Task
getStatus
in class BulkByScrollTask
protected void onCancelled()
CancellableTask
onCancelled
in class CancellableTask
public int runningSliceSubTasks()
BulkByScrollTask
WorkingBulkByScrollTask
will always have 0 and
ParentBulkByScrollTask
will return the number of waiting tasks. Used to decide how to perform rethrottling.runningSliceSubTasks
in class BulkByScrollTask
public TaskInfo getInfoGivenSliceInfo(java.lang.String localNodeId, java.util.List<TaskInfo> sliceInfo)
BulkByScrollTask
getInfoGivenSliceInfo
in class BulkByScrollTask
public void setTotal(long totalHits)
public void countBatch()
public void countNoop()
public long getCreated()
SuccessfullyProcessed
getCreated
in interface SuccessfullyProcessed
public void countCreated()
public long getUpdated()
SuccessfullyProcessed
getUpdated
in interface SuccessfullyProcessed
public void countUpdated()
public long getDeleted()
SuccessfullyProcessed
getDeleted
in interface SuccessfullyProcessed
public void countDeleted()
public void countVersionConflict()
public void countBulkRetry()
public void countSearchRetry()
public void delayPrepareBulkRequest(ThreadPool threadPool, TimeValue lastBatchStartTime, int lastBatchSize, AbstractRunnable prepareBulkRequestRunnable)
public TimeValue throttleWaitTime(TimeValue lastBatchStartTime, TimeValue now, int lastBatchSize)
public void rethrottle(float newRequestsPerSecond)
BulkByScrollTask
newRequestsPerSecond
.rethrottle
in class BulkByScrollTask