Package org.iq80.leveldb.table
Class Table
java.lang.Object
org.iq80.leveldb.table.Table
- Direct Known Subclasses:
FileChannelTable,MMapTable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Comparator<Slice> protected final FileChannelprotected final Blockprotected final BlockHandleprotected final Stringprotected static ByteBufferprotected final boolean -
Constructor Summary
ConstructorsConstructorDescriptionTable(String name, FileChannel fileChannel, Comparator<Slice> comparator, boolean verifyChecksums) -
Method Summary
Modifier and TypeMethodDescriptionCallable<?> closer()longGiven a key, return an approximate byte offset in the file where the data for that key begins (or would begin if the key were present in the file).protected abstract Footerinit()iterator()protected abstract BlockreadBlock(BlockHandle blockHandle) toString()protected intuncompressedLength(ByteBuffer data) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
name
-
fileChannel
-
comparator
-
verifyChecksums
protected final boolean verifyChecksums -
indexBlock
-
metaindexBlockHandle
-
uncompressedScratch
-
-
Constructor Details
-
Table
public Table(String name, FileChannel fileChannel, Comparator<Slice> comparator, boolean verifyChecksums) throws IOException - Throws:
IOException
-
-
Method Details
-
init
- Throws:
IOException
-
iterator
-
openBlock
-
readBlock
- Throws:
IOException
-
uncompressedLength
- Throws:
IOException
-
getApproximateOffsetOf
Given a key, return an approximate byte offset in the file where the data for that key begins (or would begin if the key were present in the file). The returned value is in terms of file bytes, and so includes effects like compression of the underlying data. For example, the approximate offset of the last key in the table will be close to the file length. -
toString
-
closer
-