Class LeafBlockV1
java.lang.Object
io.datarouter.filesystem.snapshot.block.leaf.LeafBlockV1
public class LeafBlockV1 extends Object implements LeafBlock
Sections:
- num keys
- key endings: relative to the start of the section
- keys
- value block ids
- value block indexes
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.datarouter.filesystem.snapshot.block.leaf.LeafBlock
LeafBlock.ValueLocation -
Field Summary
-
Constructor Summary
Constructors Constructor Description LeafBlockV1(byte[] bytes) -
Method Summary
Modifier and Type Method Description io.datarouter.model.util.BytesblockKey(int index)io.datarouter.model.util.BytesblockValue(int index)intfirstValueBlockId(int column)intfirstValueIndex(int column)intheapSize()intnumRecords()intnumValueBlocks(int column)longrecordId(int index)StringtoDetailedString()StringtoString()intvalueBlockEnding(int column, int valueBlockId)BlockKeyvalueBlockKey(SnapshotKey snapshotKey, int column, int valueBlockId)intvalueBlockOffset(int column, int valueBlockOffsetIndex)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.datarouter.filesystem.snapshot.block.leaf.LeafBlock
findRecordId, findRecordIndex, findValueBlock, firstRecordId, getValueBlock, insertionIndex, keyCopies, keys, leafRecords, search, snapshotKey, snapshotLeafRecord, snapshotValue, valueBlockIds, valueBlockOffsetForKey, valueCopies, valueIndex, values
-
Field Details
-
FORMAT
- See Also:
- Constant Field Values
-
-
Constructor Details
-
LeafBlockV1
public LeafBlockV1(byte[] bytes)
-
-
Method Details
-
toString
-
heapSize
public int heapSize() -
recordId
public long recordId(int index) -
numRecords
public int numRecords()- Specified by:
numRecordsin interfaceLeafBlock- Returns:
- Number of keys in the block
-
blockKey
public io.datarouter.model.util.Bytes blockKey(int index) -
blockValue
public io.datarouter.model.util.Bytes blockValue(int index)- Specified by:
blockValuein interfaceLeafBlock- Returns:
- Nth value in the block
-
firstValueBlockId
public int firstValueBlockId(int column)- Specified by:
firstValueBlockIdin interfaceLeafBlock- Returns:
- First ValueBlock known to this LeafBlock
-
numValueBlocks
public int numValueBlocks(int column)- Specified by:
numValueBlocksin interfaceLeafBlock- Returns:
- Number of ValueBlocks referenced by this LeafBlock
-
valueBlockEnding
public int valueBlockEnding(int column, int valueBlockId)- Specified by:
valueBlockEndingin interfaceLeafBlock
-
valueBlockKey
- Specified by:
valueBlockKeyin interfaceLeafBlock
-
firstValueIndex
public int firstValueIndex(int column)- Specified by:
firstValueIndexin interfaceLeafBlock- Returns:
- First index into first ValueBlock known to this LeafBlock
-
valueBlockOffset
public int valueBlockOffset(int column, int valueBlockOffsetIndex)- Specified by:
valueBlockOffsetin interfaceLeafBlockvalueBlockOffsetIndex- offset into the list of valueBlockOffsets. Passing 0 should always return 0.- Returns:
- recordIndex at the requested offset
-
toDetailedString
-