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 forBulkByScrollTaskthat 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 voidcountBatch()voidcountBulkRetry()voidcountCreated()voidcountDeleted()voidcountNoop()voidcountSearchRetry()voidcountUpdated()voidcountVersionConflict()voiddelayPrepareBulkRequest(ThreadPool threadPool, long lastBatchStartTimeNS, int lastBatchSize, AbstractRunnable prepareBulkRequestRunnable)Schedule prepareBulkRequestRunnable to run after some delay.longgetCreated()Count of documents created.longgetDeleted()Count of successful delete operations.BulkByScrollTask.StatusgetStatus()longgetUpdated()Count of documents updated.voidhandleCancel()voidrethrottle(float newRequestsPerSecond)ApplynewRequestsPerSecondas the new rate limit for this task's search requestsvoidsetTotal(long totalHits)TimeValuethrottleWaitTime(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 Detail
-
WorkerBulkByScrollTaskState
public WorkerBulkByScrollTaskState(BulkByScrollTask task, java.lang.Integer sliceId, float requestsPerSecond)
-
-
Method Detail
-
getStatus
public BulkByScrollTask.Status 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:SuccessfullyProcessedCount of documents created.- Specified by:
getCreatedin interfaceSuccessfullyProcessed
-
countCreated
public void countCreated()
-
getUpdated
public long getUpdated()
Description copied from interface:SuccessfullyProcessedCount of documents updated.- Specified by:
getUpdatedin interfaceSuccessfullyProcessed
-
countUpdated
public void countUpdated()
-
getDeleted
public long getDeleted()
Description copied from interface:SuccessfullyProcessedCount of successful delete operations.- Specified by:
getDeletedin 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 TimeValue throttleWaitTime(long lastBatchStartTimeNS, long nowNS, int lastBatchSize)
-
rethrottle
public void rethrottle(float newRequestsPerSecond)
ApplynewRequestsPerSecondas the new rate limit for this task's search requests
-
-