Class BatchRecord

java.lang.Object
com.aerospike.client.BatchRecord
Direct Known Subclasses:
BatchDelete, BatchRead, BatchUDF, BatchWrite

public class BatchRecord extends Object
Batch key and record result.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Batch command type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
    Does this command contain a write operation.
    boolean
    Is it possible that the write transaction may have completed even though an error occurred for this record.
    final Key
    Key.
    Record result after batch command has completed.
    int
    Result code for this returned record.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BatchRecord(Key key, boolean hasWrite)
    Initialize batch key.
    BatchRecord(Key key, Record record, boolean hasWrite)
    Initialize batch key and record.
    BatchRecord(Key key, Record record, int resultCode, boolean inDoubt, boolean hasWrite)
    Error constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Optimized reference equality check to determine batch wire protocol repeat flag.
    Return batch command type.
    final void
    Prepare for upcoming batch call.
    final void
    setError(int resultCode, boolean inDoubt)
    Set error result.
    final void
    setRecord(Record record)
    Set record result.
    int
    size(Policy parentPolicy)
    Return wire protocol size.
    Convert to string.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • key

      public final Key key
      Key.
    • record

      public Record record
      Record result after batch command has completed. Will be null if record was not found or an error occurred. See resultCode.
    • resultCode

      public int resultCode
      Result code for this returned record. See ResultCode. If not ResultCode.OK, the record will be null.
    • inDoubt

      public boolean inDoubt
      Is it possible that the write transaction may have completed even though an error occurred for this record. This may be the case when a client error occurs (like timeout) after the command was sent to the server.
    • hasWrite

      public final boolean hasWrite
      Does this command contain a write operation. For internal use only.
  • Constructor Details

    • BatchRecord

      public BatchRecord(Key key, boolean hasWrite)
      Initialize batch key.
    • BatchRecord

      public BatchRecord(Key key, Record record, boolean hasWrite)
      Initialize batch key and record.
    • BatchRecord

      public BatchRecord(Key key, Record record, int resultCode, boolean inDoubt, boolean hasWrite)
      Error constructor.
  • Method Details

    • prepare

      public final void prepare()
      Prepare for upcoming batch call. Reset result fields because this instance might be reused. For internal use only.
    • setRecord

      public final void setRecord(Record record)
      Set record result. For internal use only.
    • setError

      public final void setError(int resultCode, boolean inDoubt)
      Set error result. For internal use only.
    • toString

      public String toString()
      Convert to string.
      Overrides:
      toString in class Object
    • getType

      public BatchRecord.Type getType()
      Return batch command type. For internal use only.
    • equals

      public boolean equals(BatchRecord other)
      Optimized reference equality check to determine batch wire protocol repeat flag. For internal use only.
    • size

      public int size(Policy parentPolicy)
      Return wire protocol size. For internal use only.