Package org.elasticsearch.action.bulk
Class BulkItemResponse
java.lang.Object
org.elasticsearch.action.bulk.BulkItemResponse
- All Implemented Interfaces:
Writeable,StatusToXContentObject,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentObject
Represents a single item response for an action executed as part of the bulk API. Holds the index/type/id
of the relevant action, and if it has failed or not (with the failure message in case it failed).
-
Nested Class Summary
Nested ClassesNested 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 inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionBulkItemResponse(int id, DocWriteRequest.OpType opType, BulkItemResponse.Failure failure)BulkItemResponse(int id, DocWriteRequest.OpType opType, DocWriteResponse response) -
Method Summary
Modifier and TypeMethodDescriptionstatic BulkItemResponsefromXContent(org.elasticsearch.common.xcontent.XContentParser parser, int id)Reads aBulkItemResponsefrom aXContentParser.The actual failure object if there was a failure.The failure message,nullif it did not fail.getId()The id of the action.getIndex()The index name of the action.intThe numeric order of the item matching the same request order in the bulk request.The operation type ("index", "create" or "delete").<T extends DocWriteResponse>
TThe actual response (IndexResponseorDeleteResponse).getType()The type of the action.longThe version of the action.booleanisFailed()Is this a failed execution of an operation.status()Returns the REST status to make sure it is returned correctlyorg.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)voidwriteThin(StreamOutput out)voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
BulkItemResponse
-
BulkItemResponse
-
-
Method Details
-
status
Description copied from interface:StatusToXContentObjectReturns the REST status to make sure it is returned correctly- Specified by:
statusin interfaceStatusToXContentObject
-
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:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
IOException
-
fromXContent
public static BulkItemResponse fromXContent(org.elasticsearch.common.xcontent.XContentParser parser, int id) throws IOExceptionReads aBulkItemResponsefrom aXContentParser.- Parameters:
parser- theXContentParserid- the id to assign to the parsedBulkItemResponse. It is usually the index of the item in theBulkResponse.getItems()array.- Throws:
IOException
-
getItemId
public int getItemId()The numeric order of the item matching the same request order in the bulk request. -
getOpType
The operation type ("index", "create" or "delete"). -
getIndex
The index name of the action. -
getType
The type of the action. -
getId
The id of the action. -
getVersion
public long getVersion()The version of the action. -
getResponse
-
isFailed
public boolean isFailed()Is this a failed execution of an operation. -
getFailureMessage
The failure message,nullif it did not fail. -
getFailure
The actual failure object if there was a failure. -
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
writeThin
- Throws:
IOException
-