Package org.elasticsearch.index.reindex
Class WorkerBulkByScrollTaskState
java.lang.Object
org.elasticsearch.index.reindex.WorkerBulkByScrollTaskState
- All Implemented Interfaces:
SuccessfullyProcessed
public class WorkerBulkByScrollTaskState extends java.lang.Object implements SuccessfullyProcessed
Task behavior for
BulkByScrollTask
that does the actual work of querying and indexing-
Constructor Summary
Constructors Constructor Description WorkerBulkByScrollTaskState(BulkByScrollTask task, java.lang.Integer sliceId, float requestsPerSecond)
-
Method Summary
Modifier and Type Method Description void
countBatch()
void
countBulkRetry()
void
countCreated()
void
countDeleted()
void
countNoop()
void
countSearchRetry()
void
countUpdated()
void
countVersionConflict()
void
delayPrepareBulkRequest(ThreadPool threadPool, long lastBatchStartTimeNS, int lastBatchSize, AbstractRunnable prepareBulkRequestRunnable)
Schedule prepareBulkRequestRunnable to run after some delay.long
getCreated()
Count of documents created.long
getDeleted()
Count of successful delete operations.BulkByScrollTask.Status
getStatus()
long
getUpdated()
Count of documents updated.void
handleCancel()
void
rethrottle(float newRequestsPerSecond)
ApplynewRequestsPerSecond
as the new rate limit for this task's search requestsvoid
setTotal(long totalHits)
org.elasticsearch.common.unit.TimeValue
throttleWaitTime(long lastBatchStartTimeNS, long nowNS, int lastBatchSize)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.index.reindex.SuccessfullyProcessed
getSuccessfullyProcessed
-
Constructor Details
-
WorkerBulkByScrollTaskState
public WorkerBulkByScrollTaskState(BulkByScrollTask task, java.lang.Integer sliceId, float requestsPerSecond)
-
-
Method Details
-
getStatus
-
handleCancel
public void handleCancel() -
setTotal
public void setTotal(long totalHits) -
countBatch
public void countBatch() -
countNoop
public void countNoop() -
getCreated
public long getCreated()Description copied from interface:SuccessfullyProcessed
Count of documents created.- Specified by:
getCreated
in interfaceSuccessfullyProcessed
-
countCreated
public void countCreated() -
getUpdated
public long getUpdated()Description copied from interface:SuccessfullyProcessed
Count of documents updated.- Specified by:
getUpdated
in interfaceSuccessfullyProcessed
-
countUpdated
public void countUpdated() -
getDeleted
public long getDeleted()Description copied from interface:SuccessfullyProcessed
Count of successful delete operations.- Specified by:
getDeleted
in interfaceSuccessfullyProcessed
-
countDeleted
public void countDeleted() -
countVersionConflict
public void countVersionConflict() -
countBulkRetry
public void countBulkRetry() -
countSearchRetry
public void countSearchRetry() -
delayPrepareBulkRequest
public void delayPrepareBulkRequest(ThreadPool threadPool, long lastBatchStartTimeNS, int lastBatchSize, AbstractRunnable prepareBulkRequestRunnable)Schedule prepareBulkRequestRunnable to run after some delay. This is where throttling plugs into reindexing so the request can be rescheduled over and over again. -
throttleWaitTime
public org.elasticsearch.common.unit.TimeValue throttleWaitTime(long lastBatchStartTimeNS, long nowNS, int lastBatchSize) -
rethrottle
public void rethrottle(float newRequestsPerSecond)ApplynewRequestsPerSecond
as the new rate limit for this task's search requests
-