Struct grenad::Sorter [−][src]
pub struct Sorter<MF, CC: ChunkCreator = DefaultChunkCreator> { /* fields omitted */ }
Expand description
A struct you can use to automatically sort and merge duplicate entries.
You can insert key-value pairs in arbitrary order, it will use the
ChunkCreator
and you the generated chunks to buffer when the dump_threashold
setting is reached.
Implementations
Creates a SorterBuilder
from a merge function, it can be
used to configure your Sorter
to better fit your needs.
Creates a Sorter
from a merge function, with the default parameters.
A rough estimate of how much memory usage it will take on the disk once dumped to disk.
This is a very bad estimate in the sense that it does not calculate the amount of duplicate entries that are in the dumped chunks and neither the fact that the in-memory buffer will likely be compressed once written to disk. This estimate will always be greater than the actual end space usage on disk.