Package com.illumon.iris.binarystore
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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommandRecordV2.CheckpointCommand
static class
CommandRecordV2.DeletePartition2Command
This class represents a command to delete the identified partition.static class
CommandRecordV2.DeletePartitionCommand
This class represents a command to delete the "current" partition.static class
CommandRecordV2.LASCommandRecordV2
Wrap a LAS command (as defined in com.illumon.iris.db.v2.logaggregator.CommandHelper.LasInnerCommandId) in a record entry. -
Field Summary
Fields Modifier and Type Field Description protected int
command
The command id. -
Constructor Summary
Constructors Modifier Constructor Description protected
CommandRecordV2()
The extending class is expected to set command.protected
CommandRecordV2(int command)
Construct a command for writing, used by sub-classes. -
Method Summary
Modifier and Type Method Description com.fishlib.base.log.LogOutput
append(com.fishlib.base.log.LogOutput logOutput)
int
getCommand()
Return the command byte.int
getDataSize()
Determine the required buffer size in bytes.protected void
setCommand(ByteBuffer buffer)
Read the bytes common to all commands from the buffer.String
toString()
void
write(ByteBuffer buffer)
Write the record data to the given data buffer.
-
Field Details
-
command
protected int commandThe 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
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
Description copied from interface:RecordData
Write the record data to the given data buffer.- Specified by:
write
in interfaceRecordData
- Parameters:
buffer
- write to this buffer
-
append
public com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput)- Specified by:
append
in interfacecom.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 interfaceRecordData
- Returns:
- the required buffer size in bytes
-
toString
-