Struct sstable::table_builder::TableBuilder
[−]
[src]
pub struct TableBuilder<C: Comparator, Dst: Write> { /* fields omitted */ }
A table consists of DATA BLOCKs, an INDEX BLOCK and a FOOTER.
DATA BLOCKs, INDEX BLOCK BLOCK are built using the code in
the block
module.
The footer is a pointer pointing to the index block, padding to fill up to 40 B and at the end the 8B magic number 0xdb4775248b80fb57.
Methods
impl<Dst: Write> TableBuilder<StandardComparator, Dst>
[src]
fn new_defaults(dst: Dst) -> TableBuilder<StandardComparator, Dst>
Create a new TableBuilder with default comparator and options.
impl<C: Comparator, Dst: Write> TableBuilder<C, Dst>
[src]
fn new(opt: Options, cmp: C, dst: Dst) -> TableBuilder<C, Dst>
Create a new TableBuilder.
fn entries(&self) -> usize
Returns how many entries have been written.
fn add(&mut self, key: &[u8], val: &[u8])
Add an entry to this table. The key must be lexicographically greater than the last entry written.
fn finish(self)
Finish building this table. This must be called at the end, otherwise not all data may land on disk.