Package org.elasticsearch.action.bulk
Class BulkItemResponse.Failure
java.lang.Object
org.elasticsearch.action.bulk.BulkItemResponse.Failure
- All Implemented Interfaces:
Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment
- Enclosing class:
- BulkItemResponse
public static class BulkItemResponse.Failure extends java.lang.Object implements Writeable, org.elasticsearch.common.xcontent.ToXContentFragment
Represents a failure.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested 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.StringCAUSE_FIELDstatic java.lang.StringID_FIELDstatic java.lang.StringINDEX_FIELDstatic org.elasticsearch.common.xcontent.ConstructingObjectParser<BulkItemResponse.Failure,java.lang.Void>PARSERstatic java.lang.StringSTATUS_FIELDstatic java.lang.StringTYPE_FIELD -
Constructor Summary
Constructors Constructor Description Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause)For write failures before operation was assigned a sequence number.Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause, boolean aborted)Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause, long seqNo, long term)For write failures after operation was assigned a sequence number.Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause, RestStatus status)Failure(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description static BulkItemResponse.FailurefromXContent(org.elasticsearch.common.xcontent.XContentParser parser)java.lang.ExceptiongetCause()The actual cause of the failure.java.lang.StringgetId()The id of the action.java.lang.StringgetIndex()The index name of the action.java.lang.StringgetMessage()The failure message.longgetSeqNo()The operation sequence number generated by primary NOTE:SequenceNumbers.UNASSIGNED_SEQ_NOindicates sequence number was not generated by primaryRestStatusgetStatus()The rest status.longgetTerm()The operation primary term of the primary NOTE:SequenceNumbers.UNASSIGNED_PRIMARY_TERMindicates primary term was not assigned by primaryjava.lang.StringgetType()The type of the action.booleanisAborted()Whether this failure is the result of an abort.java.lang.StringtoString()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.
-
Field Details
-
INDEX_FIELD
public static final java.lang.String INDEX_FIELD- See Also:
- Constant Field Values
-
TYPE_FIELD
public static final java.lang.String TYPE_FIELD- See Also:
- Constant Field Values
-
ID_FIELD
public static final java.lang.String ID_FIELD- See Also:
- Constant Field Values
-
CAUSE_FIELD
public static final java.lang.String CAUSE_FIELD- See Also:
- Constant Field Values
-
STATUS_FIELD
public static final java.lang.String STATUS_FIELD- See Also:
- Constant Field Values
-
PARSER
public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<BulkItemResponse.Failure,java.lang.Void> PARSER
-
-
Constructor Details
-
Failure
public Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause)For write failures before operation was assigned a sequence number. use @{linkFailure(String, String, String, Exception, long, long)} to record operation sequence no with failure -
Failure
public Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause, boolean aborted) -
Failure
public Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause, RestStatus status) -
Failure
public Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause, long seqNo, long term)For write failures after operation was assigned a sequence number. -
Failure
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
getIndex
public java.lang.String getIndex()The index name of the action. -
getType
public java.lang.String getType()The type of the action. -
getId
public java.lang.String getId()The id of the action. -
getMessage
public java.lang.String getMessage()The failure message. -
getStatus
The rest status. -
getCause
public java.lang.Exception getCause()The actual cause of the failure. -
getSeqNo
public long getSeqNo()The operation sequence number generated by primary NOTE:SequenceNumbers.UNASSIGNED_SEQ_NOindicates sequence number was not generated by primary -
getTerm
public long getTerm()The operation primary term of the primary NOTE:SequenceNumbers.UNASSIGNED_PRIMARY_TERMindicates primary term was not assigned by primary -
isAborted
public boolean isAborted()Whether this failure is the result of an abort. Iftrue, the request to which this failure relates should never be retried, regardless of thecause.- See Also:
BulkItemRequest.abort(String, Exception)
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-
fromXContent
public static BulkItemResponse.Failure fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-