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 ClassesModifier and TypeClassDescriptionstatic classstatic classThis class represents a command to delete the identified partition.static classThis class represents a command to delete the "current" partition.static classWrap a LAS command (as defined in com.illumon.iris.db.v2.logaggregator.CommandHelper.LasInnerCommandId) in a record entry. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedThe extending class is expected to set command.protectedCommandRecordV2(int command) Construct a command for writing, used by sub-classes. -
Method Summary
Modifier and TypeMethodDescriptioncom.fishlib.base.log.LogOutputappend(com.fishlib.base.log.LogOutput logOutput) intReturn the command byte.intDetermine the required buffer size in bytes.protected voidsetCommand(ByteBuffer buffer) Read the bytes common to all commands from the buffer.toString()voidwrite(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:RecordDataWrite the record data to the given data buffer.- Specified by:
writein interfaceRecordData- Parameters:
buffer- write to this buffer
-
append
public com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput) - Specified by:
appendin interfacecom.fishlib.base.log.LogOutputAppendable
-
getDataSize
public int getDataSize()Description copied from interface:RecordDataDetermine 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:
getDataSizein interfaceRecordData- Returns:
- the required buffer size in bytes
-
toString
-