Package org.elasticsearch.index.reindex
Class BulkByScrollTask.Status
- java.lang.Object
-
- org.elasticsearch.index.reindex.BulkByScrollTask.Status
-
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentObject,SuccessfullyProcessed,Task.Status
- Enclosing class:
- BulkByScrollTask
public static class BulkByScrollTask.Status extends java.lang.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 theirToXContent.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBATCHES_FIELDstatic java.lang.StringCANCELED_FIELDstatic java.lang.StringCREATED_FIELDstatic java.lang.StringDELETED_FIELDstatic java.util.Set<java.lang.String>FIELDS_SETstatic java.lang.StringINCLUDE_CREATEDXContent param name to indicate if "created" count must be included in the response.static java.lang.StringINCLUDE_UPDATEDXContent param name to indicate if "updated" count must be included in the response.static java.lang.StringNAMEstatic java.lang.StringNOOPS_FIELDstatic java.lang.StringREQUESTS_PER_SEC_FIELDstatic java.lang.StringRETRIES_BULK_FIELDstatic java.lang.StringRETRIES_FIELDstatic java.lang.StringRETRIES_SEARCH_FIELDstatic java.lang.StringSLICE_ID_FIELDstatic java.lang.StringSLICES_FIELDstatic java.lang.StringTHROTTLED_HR_FIELDstatic java.lang.StringTHROTTLED_RAW_FIELDstatic java.lang.StringTHROTTLED_UNTIL_HR_FIELDstatic java.lang.StringTHROTTLED_UNTIL_RAW_FIELDstatic java.lang.StringTOTAL_FIELDstatic java.lang.StringUPDATED_FIELDstatic java.lang.StringVERSION_CONFLICTS_FIELD-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description Status(java.lang.Integer sliceId, long total, long updated, long created, long deleted, int batches, long versionConflicts, long noops, long bulkRetries, long searchRetries, TimeValue throttled, float requestsPerSecond, java.lang.String reasonCancelled, TimeValue throttledUntil)Status(java.util.List<BulkByScrollTask.StatusOrException> sliceStatuses, java.lang.String reasonCancelled)Constructor merging many statuses.Status(StreamInput in)
-
Method Summary
Modifier and Type Method Description static voiddeclareFields(ObjectParser<? extends BulkByScrollTask.StatusBuilder,java.lang.Void> parser)booleanequals(java.lang.Object o)booleanequalsWithoutSliceStatus(java.lang.Object o, boolean includeUpdated, boolean includeCreated)static BulkByScrollTask.StatusfromXContent(XContentParser parser)intgetBatches()Number of scan responses this request has processed.longgetBulkRetries()Number of retries that had to be attempted due to bulk actions being rejected.longgetCreated()Count of documents created.longgetDeleted()Count of successful delete operations.longgetNoops()Number of noops (skipped bulk items) as part of this request.java.lang.StringgetReasonCancelled()The reason that the request was canceled or null if it hasn't been.floatgetRequestsPerSecond()The number of requests per second to which to throttle the request.longgetSearchRetries()Number of retries that had to be attempted due to search actions being rejected.java.util.List<BulkByScrollTask.StatusOrException>getSliceStatuses()Statuses of the sub requests into which this sub-request was sliced.TimeValuegetThrottled()The total time this request has throttled itself not including the current throttle time if it is currently sleeping.TimeValuegetThrottledUntil()Remaining delay of any current throttle sleep or 0 if not sleeping.longgetTotal()The total number of documents this request will process.longgetUpdated()Count of documents updated.longgetVersionConflicts()Number of version conflicts this request has hit.java.lang.StringgetWriteableName()Returns the name of the writeable objectinthashCode()static BulkByScrollTask.StatusinnerFromXContent(XContentParser parser)voidinnerToString(java.lang.StringBuilder builder)XContentBuilderinnerXContent(XContentBuilder builder, ToXContent.Params params)We need to write a manual parser for this because ofBulkByScrollTask.StatusOrException.java.lang.StringtoString()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.index.reindex.SuccessfullyProcessed
getSuccessfullyProcessed
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
INCLUDE_CREATED
public static final java.lang.String INCLUDE_CREATED
XContent param name to indicate if "created" count must be included in the response.- See Also:
- Constant Field Values
-
INCLUDE_UPDATED
public static final java.lang.String INCLUDE_UPDATED
XContent param name to indicate if "updated" count must be included in the response.- See Also:
- Constant Field Values
-
SLICE_ID_FIELD
public static final java.lang.String SLICE_ID_FIELD
- See Also:
- Constant Field Values
-
TOTAL_FIELD
public static final java.lang.String TOTAL_FIELD
- See Also:
- Constant Field Values
-
UPDATED_FIELD
public static final java.lang.String UPDATED_FIELD
- See Also:
- Constant Field Values
-
CREATED_FIELD
public static final java.lang.String CREATED_FIELD
- See Also:
- Constant Field Values
-
DELETED_FIELD
public static final java.lang.String DELETED_FIELD
- See Also:
- Constant Field Values
-
BATCHES_FIELD
public static final java.lang.String BATCHES_FIELD
- See Also:
- Constant Field Values
-
VERSION_CONFLICTS_FIELD
public static final java.lang.String VERSION_CONFLICTS_FIELD
- See Also:
- Constant Field Values
-
NOOPS_FIELD
public static final java.lang.String NOOPS_FIELD
- See Also:
- Constant Field Values
-
RETRIES_FIELD
public static final java.lang.String RETRIES_FIELD
- See Also:
- Constant Field Values
-
RETRIES_BULK_FIELD
public static final java.lang.String RETRIES_BULK_FIELD
- See Also:
- Constant Field Values
-
RETRIES_SEARCH_FIELD
public static final java.lang.String RETRIES_SEARCH_FIELD
- See Also:
- Constant Field Values
-
THROTTLED_RAW_FIELD
public static final java.lang.String THROTTLED_RAW_FIELD
- See Also:
- Constant Field Values
-
THROTTLED_HR_FIELD
public static final java.lang.String THROTTLED_HR_FIELD
- See Also:
- Constant Field Values
-
REQUESTS_PER_SEC_FIELD
public static final java.lang.String REQUESTS_PER_SEC_FIELD
- See Also:
- Constant Field Values
-
CANCELED_FIELD
public static final java.lang.String CANCELED_FIELD
- See Also:
- Constant Field Values
-
THROTTLED_UNTIL_RAW_FIELD
public static final java.lang.String THROTTLED_UNTIL_RAW_FIELD
- See Also:
- Constant Field Values
-
THROTTLED_UNTIL_HR_FIELD
public static final java.lang.String THROTTLED_UNTIL_HR_FIELD
- See Also:
- Constant Field Values
-
SLICES_FIELD
public static final java.lang.String SLICES_FIELD
- See Also:
- Constant Field Values
-
FIELDS_SET
public static java.util.Set<java.lang.String> FIELDS_SET
-
-
Constructor Detail
-
Status
public Status(java.lang.Integer sliceId, long total, long updated, long created, long deleted, int batches, long versionConflicts, long noops, long bulkRetries, long searchRetries, TimeValue throttled, float requestsPerSecond, @Nullable java.lang.String reasonCancelled, TimeValue throttledUntil)
-
Status
public Status(java.util.List<BulkByScrollTask.StatusOrException> sliceStatuses, @Nullable java.lang.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 insliceStatusescan be cancelled independently of this task but if this task is cancelled then the workers *should* be cancelled.
-
Status
public Status(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
declareFields
public static void declareFields(ObjectParser<? extends BulkByScrollTask.StatusBuilder,java.lang.Void> parser)
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:WriteableWrite this into the StreamOutput.
-
getWriteableName
public java.lang.String getWriteableName()
Description copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
innerXContent
public XContentBuilder innerXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
We need to write a manual parser for this because ofBulkByScrollTask.StatusOrException. SinceBulkByScrollTask.StatusOrException.fromXContent(XContentParser)tries to peek at a field first before deciding what needs to be it cannot use anObjectParser.- Throws:
java.io.IOException
-
fromXContent
public static BulkByScrollTask.Status fromXContent(XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
innerFromXContent
public static BulkByScrollTask.Status innerFromXContent(XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
innerToString
public void innerToString(java.lang.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:SuccessfullyProcessedCount of documents updated.- Specified by:
getUpdatedin interfaceSuccessfullyProcessed
-
getCreated
public long getCreated()
Description copied from interface:SuccessfullyProcessedCount of documents created.- Specified by:
getCreatedin interfaceSuccessfullyProcessed
-
getDeleted
public long getDeleted()
Description copied from interface:SuccessfullyProcessedCount of successful delete operations.- Specified by:
getDeletedin interfaceSuccessfullyProcessed
-
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 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 java.lang.String getReasonCancelled()
The reason that the request was canceled or null if it hasn't been.
-
getThrottledUntil
public TimeValue getThrottledUntil()
Remaining delay of any current throttle sleep or 0 if not sleeping.
-
getSliceStatuses
public java.util.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:
hashCodein classjava.lang.Object
-
equalsWithoutSliceStatus
public boolean equalsWithoutSliceStatus(java.lang.Object o, boolean includeUpdated, boolean includeCreated)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-