class BlockWriter
extends java.lang.Object
ReftableWriter
.Modifier and Type | Class and Description |
---|---|
(package private) static class |
BlockWriter.DeleteLogEntry |
(package private) static class |
BlockWriter.Entry |
(package private) static class |
BlockWriter.IndexEntry |
(package private) static class |
BlockWriter.LogEntry |
(package private) static class |
BlockWriter.ObjEntry |
(package private) static class |
BlockWriter.RefEntry |
Modifier and Type | Field and Description |
---|---|
private int |
blockLimitBytes |
private byte |
blockType |
private java.util.List<BlockWriter.Entry> |
entries |
private int |
entriesSumBytes |
private byte |
keyType |
private int |
restartCnt |
private int |
restartInterval |
Constructor and Description |
---|
BlockWriter(byte type,
byte kt,
int bs,
int ri) |
Modifier and Type | Method and Description |
---|---|
private BlockSizeTooSmallException |
blockSizeTooSmall(BlockWriter.Entry entry) |
(package private) byte |
blockType() |
(package private) static int |
commonPrefix(byte[] a,
int n,
byte[] b) |
(package private) static int |
compare(byte[] a,
int ai,
int aLen,
byte[] b,
int bi,
int bLen) |
private int |
computeBlockBytes(int entryBytes,
boolean restart) |
private static int |
computeBlockBytes(int entryBytes,
int restartCnt) |
(package private) int |
currentSize() |
(package private) static int |
encodeSuffixAndType(int sfx,
int valueType) |
private static int |
estimateEntryCount(byte blockType,
byte keyType,
int blockLimitBytes) |
(package private) byte[] |
lastKey() |
(package private) void |
mustAdd(BlockWriter.Entry entry) |
private boolean |
nextShouldBeRestart() |
(package private) boolean |
padBetweenBlocks() |
(package private) static boolean |
padBetweenBlocks(byte type) |
(package private) boolean |
tryAdd(BlockWriter.Entry entry) |
private boolean |
tryAdd(BlockWriter.Entry entry,
boolean tryRestart) |
(package private) void |
writeTo(ReftableOutputStream os) |
private final byte blockType
private final byte keyType
private final java.util.List<BlockWriter.Entry> entries
private final int blockLimitBytes
private final int restartInterval
private int entriesSumBytes
private int restartCnt
private static int estimateEntryCount(byte blockType, byte keyType, int blockLimitBytes)
byte blockType()
boolean padBetweenBlocks()
static boolean padBetweenBlocks(byte type)
byte[] lastKey()
int currentSize()
void mustAdd(BlockWriter.Entry entry) throws BlockSizeTooSmallException
BlockSizeTooSmallException
boolean tryAdd(BlockWriter.Entry entry)
private boolean tryAdd(BlockWriter.Entry entry, boolean tryRestart)
private boolean nextShouldBeRestart()
private int computeBlockBytes(int entryBytes, boolean restart)
private static int computeBlockBytes(int entryBytes, int restartCnt)
void writeTo(ReftableOutputStream os) throws java.io.IOException
java.io.IOException
private BlockSizeTooSmallException blockSizeTooSmall(BlockWriter.Entry entry)
static int commonPrefix(byte[] a, int n, byte[] b)
static int encodeSuffixAndType(int sfx, int valueType)
static int compare(byte[] a, int ai, int aLen, byte[] b, int bi, int bLen)