Class BranchBlockV1Encoder
java.lang.Object
io.datarouter.filesystem.snapshot.block.branch.BranchBlockV1Encoder
- All Implemented Interfaces:
BlockEncoder,BranchBlockEncoder,DataBlockEncoder
public class BranchBlockV1Encoder extends Object implements BranchBlockEncoder
-
Field Summary
Fields inherited from interface io.datarouter.filesystem.snapshot.encode.BranchBlockEncoder
LEVEL_AND_BLOCK_ID_COMPARATOR -
Constructor Summary
Constructors Constructor Description BranchBlockV1Encoder(int level) -
Method Summary
Modifier and Type Method Description voidadd(int blockId, long recordId, SnapshotEntry entry, int childBlockId)intblockId()EncodedBlockencode(BlockQueue.FileIdsAndEndings fileIdsAndEndings)intfirstChildBlockId()Stringformat()intlevel()intnumBytes()Used to determine when to flush a block.intnumRecords()The number of items in the block.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.datarouter.filesystem.snapshot.encode.BranchBlockEncoder
isEmpty
-
Constructor Details
-
BranchBlockV1Encoder
public BranchBlockV1Encoder(int level)
-
-
Method Details
-
format
- Specified by:
formatin interfaceBlockEncoder
-
add
- Specified by:
addin interfaceBranchBlockEncoder
-
numRecords
public int numRecords()Description copied from interface:DataBlockEncoderThe number of items in the block. Zero indicates we don't need to flush it.- Specified by:
numRecordsin interfaceDataBlockEncoder
-
numBytes
public int numBytes()Description copied from interface:DataBlockEncoderUsed to determine when to flush a block. We won't always know the exact block size until we actually encode it.- Specified by:
numBytesin interfaceDataBlockEncoder
-
encode
- Specified by:
encodein interfaceBranchBlockEncoder
-
level
public int level()- Specified by:
levelin interfaceBranchBlockEncoder
-
blockId
public int blockId()- Specified by:
blockIdin interfaceBranchBlockEncoder
-
firstChildBlockId
public int firstChildBlockId()- Specified by:
firstChildBlockIdin interfaceBranchBlockEncoder
-