Class BulkByScrollTask.Status

java.lang.Object
org.elasticsearch.index.reindex.BulkByScrollTask.Status
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, SuccessfullyProcessed, Task.Status
Enclosing class:
BulkByScrollTask

public static class BulkByScrollTask.Status extends Object implements Task.Status, SuccessfullyProcessed
Status of the reindex, update by query, or delete by query. While in general we allow Task.Status implementations to make backwards incompatible changes to their ToXContent.toXContent(org.elasticsearch.common.xcontent.XContentBuilder, org.elasticsearch.common.xcontent.ToXContent.Params) implementations, this one has become defacto standardized because Kibana parses it. As such, we should be very careful about removing things from this.
  • Field Details

  • Constructor Details

    • Status

      public Status(Integer sliceId, long total, long updated, long created, long deleted, int batches, long versionConflicts, long noops, long bulkRetries, long searchRetries, org.elasticsearch.core.TimeValue throttled, float requestsPerSecond, @Nullable String reasonCancelled, org.elasticsearch.core.TimeValue throttledUntil)
    • Status

      public Status(List<BulkByScrollTask.StatusOrException> sliceStatuses, @Nullable String reasonCancelled)
      Constructor merging many statuses.
      Parameters:
      sliceStatuses - Statuses of sub requests that this task was sliced into.
      reasonCancelled - Reason that this *this* task was cancelled. Note that each entry in sliceStatuses can be cancelled independently of this task but if this task is cancelled then the workers *should* be cancelled.
    • Status

      public Status(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • declareFields

      public static void declareFields(org.elasticsearch.common.xcontent.ObjectParser<? extends BulkByScrollTask.StatusBuilder,​Void> parser)
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • getWriteableName

      public String getWriteableName()
      Description copied from interface: NamedWriteable
      Returns the name of the writeable object
      Specified by:
      getWriteableName in interface NamedWriteable
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      IOException
    • innerXContent

      public org.elasticsearch.common.xcontent.XContentBuilder innerXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      We need to write a manual parser for this because of BulkByScrollTask.StatusOrException. Since BulkByScrollTask.StatusOrException.fromXContent(XContentParser) tries to peek at a field first before deciding what needs to be it cannot use an ObjectParser.
      Throws:
      IOException
    • fromXContent

      public static BulkByScrollTask.Status fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • innerFromXContent

      public static BulkByScrollTask.Status innerFromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • innerToString

      public void innerToString(StringBuilder builder)
    • getTotal

      public long getTotal()
      The total number of documents this request will process. 0 means we don't yet know or, possibly, there are actually 0 documents to process. Its ok that these have the same meaning because any request with 0 actual documents should be quite short lived.
    • getUpdated

      public long getUpdated()
      Description copied from interface: SuccessfullyProcessed
      Count of documents updated.
      Specified by:
      getUpdated in interface SuccessfullyProcessed
    • getCreated

      public long getCreated()
      Description copied from interface: SuccessfullyProcessed
      Count of documents created.
      Specified by:
      getCreated in interface SuccessfullyProcessed
    • getDeleted

      public long getDeleted()
      Description copied from interface: SuccessfullyProcessed
      Count of successful delete operations.
      Specified by:
      getDeleted in interface SuccessfullyProcessed
    • getBatches

      public int getBatches()
      Number of scan responses this request has processed.
    • getVersionConflicts

      public long getVersionConflicts()
      Number of version conflicts this request has hit.
    • getNoops

      public long getNoops()
      Number of noops (skipped bulk items) as part of this request.
    • getBulkRetries

      public long getBulkRetries()
      Number of retries that had to be attempted due to bulk actions being rejected.
    • getSearchRetries

      public long getSearchRetries()
      Number of retries that had to be attempted due to search actions being rejected.
    • getThrottled

      public org.elasticsearch.core.TimeValue getThrottled()
      The total time this request has throttled itself not including the current throttle time if it is currently sleeping.
    • getRequestsPerSecond

      public float getRequestsPerSecond()
      The number of requests per second to which to throttle the request. Float.POSITIVE_INFINITY means unlimited.
    • getReasonCancelled

      public String getReasonCancelled()
      The reason that the request was canceled or null if it hasn't been.
    • getThrottledUntil

      public org.elasticsearch.core.TimeValue getThrottledUntil()
      Remaining delay of any current throttle sleep or 0 if not sleeping.
    • getSliceStatuses

      public List<BulkByScrollTask.StatusOrException> getSliceStatuses()
      Statuses of the sub requests into which this sub-request was sliced. Empty if this request wasn't sliced into sub-requests.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equalsWithoutSliceStatus

      public boolean equalsWithoutSliceStatus(Object o, boolean includeUpdated, boolean includeCreated)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object