org.elasticsearch.action.bulk
Class BulkItemResponse

java.lang.Object
  extended by org.elasticsearch.action.bulk.BulkItemResponse
All Implemented Interfaces:
Streamable

public class BulkItemResponse
extends Object
implements Streamable

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 incase it failed).


Nested Class Summary
static class BulkItemResponse.Failure
          Represents a failure.
 
Constructor Summary
BulkItemResponse(int id, String opType, ActionResponse response)
           
BulkItemResponse(int id, String opType, BulkItemResponse.Failure failure)
           
 
Method Summary
 boolean failed()
          Is this a failed execution of an operation.
 BulkItemResponse.Failure failure()
          The actual failure object if there was a failure.
 String failureMessage()
          The failure message, null if it did not fail.
 BulkItemResponse.Failure getFailure()
          The actual failure object if there was a failure.
 String getFailureMessage()
          The failure message, null if it did not fail.
 String getId()
          The id of the action.
 String getIndex()
          The index name of the action.
 String getType()
          The type of the action.
 String id()
          The id of the action.
 String index()
          The index name of the action.
 boolean isFailed()
          Is this a failed execution of an operation.
 int itemId()
          The numeric order of the item matching the same request order in the bulk request.
 String opType()
          The operation type ("index", "create" or "delete").
static BulkItemResponse readBulkItem(StreamInput in)
           
 void readFrom(StreamInput in)
           
<T extends ActionResponse>
T
response()
          The actual response (IndexResponse or DeleteResponse).
 String type()
          The type of the action.
 long version()
          The version of the action.
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulkItemResponse

public BulkItemResponse(int id,
                        String opType,
                        ActionResponse response)

BulkItemResponse

public BulkItemResponse(int id,
                        String opType,
                        BulkItemResponse.Failure failure)
Method Detail

itemId

public int itemId()
The numeric order of the item matching the same request order in the bulk request.


opType

public String opType()
The operation type ("index", "create" or "delete").


index

public String index()
The index name of the action.


getIndex

public String getIndex()
The index name of the action.


type

public String type()
The type of the action.


getType

public String getType()
The type of the action.


id

public String id()
The id of the action.


getId

public String getId()
The id of the action.


version

public long version()
The version of the action.


response

public <T extends ActionResponse> T response()
The actual response (IndexResponse or DeleteResponse). null in case of failure.


failed

public boolean failed()
Is this a failed execution of an operation.


isFailed

public boolean isFailed()
Is this a failed execution of an operation.


failureMessage

public String failureMessage()
The failure message, null if it did not fail.


getFailureMessage

public String getFailureMessage()
The failure message, null if it did not fail.


failure

public BulkItemResponse.Failure failure()
The actual failure object if there was a failure.


getFailure

public BulkItemResponse.Failure getFailure()
The actual failure object if there was a failure.


readBulkItem

public static BulkItemResponse readBulkItem(StreamInput in)
                                     throws IOException
Throws:
IOException

readFrom

public void readFrom(StreamInput in)
              throws IOException
Specified by:
readFrom in interface Streamable
Throws:
IOException

writeTo

public void writeTo(StreamOutput out)
             throws IOException
Specified by:
writeTo in interface Streamable
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.