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 BLOCKs, and BLOCKs are built using the code in the block module.

DATA BLOCKs contain the actual data; INDEX BLOCKS contain one entry per block, where the key is a string after the last key of a block, and the value is a encoded BlockHandle pointing to that block.

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]

Create a new TableBuilder with default comparator and BuildOptions.

impl TableBuilder<StandardComparator, File>
[src]

Open/create a file for writing a table. This will truncate the file, if it exists.

impl<C: Comparator, Dst: Write> TableBuilder<C, Dst>
[src]

Create a new TableBuilder.

Returns how many entries have been written.

Add an entry to this table. The key must be lexicographically greater than the last entry written.

Finish building this table. This must be called at the end, otherwise not all data may land on disk.