Package org.elasticsearch.action.bulk
Class BulkItemResponse.Failure
- java.lang.Object
-
- org.elasticsearch.action.bulk.BulkItemResponse.Failure
-
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentFragment
- Enclosing class:
- BulkItemResponse
public static class BulkItemResponse.Failure extends java.lang.Object implements Writeable, ToXContentFragment
Represents a failure.
-
-
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.String
CAUSE_FIELD
static java.lang.String
ID_FIELD
static java.lang.String
INDEX_FIELD
static ConstructingObjectParser<BulkItemResponse.Failure,java.lang.Void>
PARSER
static java.lang.String
STATUS_FIELD
static java.lang.String
TYPE_FIELD
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
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)
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(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause, RestStatus status, long seqNo, boolean aborted)
Failure(StreamInput in)
Read from a stream.
-
Method Summary
Modifier and Type Method Description static BulkItemResponse.Failure
fromXContent(XContentParser parser)
java.lang.Exception
getCause()
The actual cause of the failure.java.lang.String
getId()
The id of the action.java.lang.String
getIndex()
The index name of the action.java.lang.String
getMessage()
The failure message.long
getSeqNo()
The operation sequence number generated by primary NOTE:SequenceNumbers.UNASSIGNED_SEQ_NO
indicates sequence number was not generated by primaryRestStatus
getStatus()
The rest status.java.lang.String
getType()
The type of the action.boolean
isAborted()
Whether this failure is the result of an abort.java.lang.String
toString()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
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 ConstructingObjectParser<BulkItemResponse.Failure,java.lang.Void> PARSER
-
-
Constructor Detail
-
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)
} 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)
For write failures after operation was assigned a sequence number.
-
Failure
public Failure(java.lang.String index, java.lang.String type, java.lang.String id, java.lang.Exception cause, RestStatus status, long seqNo, boolean aborted)
-
Failure
public Failure(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write 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
public RestStatus 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_NO
indicates sequence number was not generated 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 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
fromXContent
public static BulkItemResponse.Failure fromXContent(XContentParser parser)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-