Struct grenad::WriterBuilder
source · pub struct WriterBuilder { /* private fields */ }
Expand description
A struct that is used to configure a Writer
.
Implementations§
source§impl WriterBuilder
impl WriterBuilder
sourcepub fn new() -> WriterBuilder
pub fn new() -> WriterBuilder
Creates a WriterBuilder
, it can be used to
configure your Writer
to better fit your needs.
sourcepub fn compression_type(
&mut self,
compression_type: CompressionType
) -> &mut Self
pub fn compression_type( &mut self, compression_type: CompressionType ) -> &mut Self
Defines the CompressionType
that will be used to compress the writer blocks.
sourcepub fn compression_level(&mut self, level: u32) -> &mut Self
pub fn compression_level(&mut self, level: u32) -> &mut Self
Defines the copression level of the defined CompressionType
that will be used to compress the writer blocks.
sourcepub fn block_size(&mut self, size: usize) -> &mut Self
pub fn block_size(&mut self, size: usize) -> &mut Self
Defines the size of the blocks that the writer will writer.
The bigger the blocks are the better they are compressed but the more time it takes to compress and decompress them.
sourcepub fn index_key_interval(&mut self, interval: NonZeroUsize) -> &mut Self
pub fn index_key_interval(&mut self, interval: NonZeroUsize) -> &mut Self
The interval at which we store the index of a key in the index footer, used to seek into a block.
sourcepub fn index_levels(&mut self, levels: u8) -> &mut Self
pub fn index_levels(&mut self, levels: u8) -> &mut Self
The number of levels/indirection we will use to write the index footer.
An indirection of 1 or 2 is sufficient to reduce the impact of decompressing/reading the index block footer.
The default is 0 which means that the index block footer values directly specifies the block where the requested data entries can be found. The disavantage of this is that the index block can be quite big and take time to be decompressed and read.