Class CommandRecordV2

java.lang.Object
com.illumon.iris.binarystore.CommandRecordV2
All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, RecordData
Direct Known Subclasses:
CommandRecordV2.CheckpointCommand, CommandRecordV2.DeletePartition2Command, CommandRecordV2.DeletePartitionCommand, CommandRecordV2.LASCommandRecordV2

public abstract class CommandRecordV2
extends Object
implements RecordData, com.fishlib.base.log.LogOutputAppendable
Read and write RecordData that are commands. Does not contain an internal buffer or data sink.
  • Field Details

    • command

      protected int command
      The command id.
  • Constructor Details

    • CommandRecordV2

      protected CommandRecordV2​(int command)
      Construct a command for writing, used by sub-classes.
    • CommandRecordV2

      protected CommandRecordV2()
      The extending class is expected to set command.
  • Method Details

    • setCommand

      protected void setCommand​(ByteBuffer buffer)
      Read the bytes common to all commands from the buffer.
      Parameters:
      buffer - The source buffer.
    • getCommand

      public int getCommand()
      Return the command byte.
      Returns:
      the command byte.
    • write

      public void write​(ByteBuffer buffer)
      Description copied from interface: RecordData
      Write the record data to the given data buffer.
      Specified by:
      write in interface RecordData
      Parameters:
      buffer - write to this buffer
    • append

      public com.fishlib.base.log.LogOutput append​(com.fishlib.base.log.LogOutput logOutput)
      Specified by:
      append in interface com.fishlib.base.log.LogOutputAppendable
    • getDataSize

      public int getDataSize()
      Description copied from interface: RecordData
      Determine the required buffer size in bytes. Note that this method is intended for use in exception-handling and may not have good performance, and may allocate temporary buffers to determine the final data size.
      Specified by:
      getDataSize in interface RecordData
      Returns:
      the required buffer size in bytes
    • toString

      public String toString()
      Overrides:
      toString in class Object