public class BulkByScrollTask extends CancellableTask
setWorkerCount(int)
) or a worker task that performs search queries (using
setWorker(float, Integer)
).
We don't always know if this task will be a leader or worker task when it's created, because if slices is set to "auto" it may
be either depending on the number of shards in the source indices. We figure that out when the request is handled and set it on this
class with setWorkerCount(int)
or setWorker(float, Integer)
.Modifier and Type | Class | Description |
---|---|---|
static class |
BulkByScrollTask.Status |
|
static class |
BulkByScrollTask.StatusOrException |
The status of a slice of the request.
|
Constructor | Description |
---|---|
BulkByScrollTask(long id,
java.lang.String type,
java.lang.String action,
java.lang.String description,
TaskId parentTaskId,
java.util.Map<java.lang.String,java.lang.String> headers) |
Modifier and Type | Method | Description |
---|---|---|
LeaderBulkByScrollTaskState |
getLeaderState() |
Returns the object that tracks the state of sliced subtasks.
|
BulkByScrollTask.Status |
getStatus() |
Build a status for this task or null if this task doesn't have status.
|
WorkerBulkByScrollTaskState |
getWorkerState() |
Returns the object that manages sending search requests.
|
boolean |
isLeader() |
Returns true if this task is a leader for other slice subtasks
|
boolean |
isWorker() |
Returns true if this task is a worker task that performs search requests.
|
void |
onCancelled() |
Called after the task is cancelled so that it can take any actions that it has to take.
|
void |
setWorker(float requestsPerSecond,
java.lang.Integer sliceId) |
Sets this task to be a worker task that performs search requests
|
void |
setWorkerCount(int slices) |
Sets this task to be a leader task for
slices sliced subtasks |
boolean |
shouldCancelChildrenOnCancellation() |
Returns true if this task can potentially have children that need to be cancelled when it parent is cancelled.
|
TaskInfo |
taskInfoGivenSubtaskInfo(java.lang.String localNodeId,
java.util.List<TaskInfo> sliceInfo) |
Build the status for this task given a snapshot of the information of running slices.
|
cancelOnParentLeaving, getReasonCancelled, isCancelled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAction, getDescription, getHeader, getId, getParentTaskId, getStartTime, getType, result, result, taskInfo, taskInfo
public BulkByScrollTask(long id, java.lang.String type, java.lang.String action, java.lang.String description, TaskId parentTaskId, java.util.Map<java.lang.String,java.lang.String> headers)
public BulkByScrollTask.Status getStatus()
Task
public TaskInfo taskInfoGivenSubtaskInfo(java.lang.String localNodeId, java.util.List<TaskInfo> sliceInfo)
public boolean isLeader()
public void setWorkerCount(int slices)
slices
sliced subtaskspublic LeaderBulkByScrollTaskState getLeaderState()
public boolean isWorker()
public void setWorker(float requestsPerSecond, @Nullable java.lang.Integer sliceId)
requestsPerSecond
- How many search requests per second this task should makesliceId
- If this is is a sliced task, which slice number this task corresponds to. Null if not sliced.public WorkerBulkByScrollTaskState getWorkerState()
public void onCancelled()
CancellableTask
onCancelled
in class CancellableTask
public boolean shouldCancelChildrenOnCancellation()
CancellableTask
shouldCancelChildrenOnCancellation
in class CancellableTask