Package org.iq80.leveldb.table
Class TableBuilder
java.lang.Object
org.iq80.leveldb.table.TableBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate booleanprivate Sliceprivate final CompressionTypeprivate final BlockBuilderprivate longprivate final FileChannelprivate final BlockBuilderprivate Sliceprivate BlockHandleprivate booleanprivate longstatic final longTABLE_MAGIC_NUMBER was picked by running echo http://code.google.com/p/leveldb/ | sha1sum and taking the leading 64 bits.private final UserComparator -
Constructor Summary
ConstructorsConstructorDescriptionTableBuilder(Options options, FileChannel fileChannel, UserComparator userComparator) -
Method Summary
Modifier and TypeMethodDescriptionvoidabandon()voidadd(BlockEntry blockEntry) voidstatic intcrc32c(Slice data, CompressionType type) voidensureCompressedOutputCapacity(int capacity) voidfinish()private voidflush()longlongprivate static intmaxCompressedLength(int length) private BlockHandlewriteBlock(BlockBuilder blockBuilder)
-
Field Details
-
TABLE_MAGIC_NUMBER
public static final long TABLE_MAGIC_NUMBERTABLE_MAGIC_NUMBER was picked by running echo http://code.google.com/p/leveldb/ | sha1sum and taking the leading 64 bits.- See Also:
-
blockRestartInterval
private final int blockRestartInterval -
blockSize
private final int blockSize -
compressionType
-
fileChannel
-
dataBlockBuilder
-
indexBlockBuilder
-
lastKey
-
userComparator
-
entryCount
private long entryCount -
closed
private boolean closed -
pendingIndexEntry
private boolean pendingIndexEntry -
pendingHandle
-
compressedOutput
-
position
private long position
-
-
Constructor Details
-
TableBuilder
-
-
Method Details
-
getEntryCount
public long getEntryCount() -
getFileSize
- Throws:
IOException
-
add
- Throws:
IOException
-
add
- Throws:
IOException
-
flush
- Throws:
IOException
-
writeBlock
- Throws:
IOException
-
maxCompressedLength
private static int maxCompressedLength(int length) -
finish
- Throws:
IOException
-
abandon
public void abandon() -
crc32c
-
ensureCompressedOutputCapacity
public void ensureCompressedOutputCapacity(int capacity)
-