Congyuwang / RocksDict

Python fast on-disk dictionary / RocksDB & SpeeDB Python binding
https://congyuwang.github.io/RocksDict/rocksdict.html
MIT License
176 stars 8 forks source link

set_compression_options documentation improvement #70

Open MichelangeloConserva opened 1 year ago

MichelangeloConserva commented 1 year ago

Hello,

I'm trying to increase the amount of compression by changing the compression algorithm to zstd. However, it's not clear how to use the set_compression_options function correctly.

The input parameters w_bits, level, strategy, max_dict_bytes are not explained in the documentation so I'm struggling to understand their meaning.

By just setting the compression type to zsts,

    opt.set_compression_type(DBCompressionType.zstd())
    opt.set_zstd_max_train_bytes(256 * 1024 * 1024)

throws an error,

Exception: Invalid argument: The dictionary size limit (`CompressionOptions::max_dict_bytes`) should be nonzero if we're using zstd's dictionary generator.

that seems to suggest that I should select a value for max_dict_bytes.

Congyuwang commented 11 months ago

Since this library is a wrapper around Rocksdb. I'd refer to rocksdb Wiki for full documentation. However, I do think the current python doc is not good enough.