python-rocksdb icon indicating copy to clipboard operation
python-rocksdb copied to clipboard

python-rocksdb have some problem in time-to-live db

Open young001 opened this issue 8 years ago • 7 comments

when a rockdb opened by with a time-to-live option,in java is

Options options = new Options().setCreateIfMissing(true);

            options.setKeepLogFileNum(10);
            rawDatadb = TtlDB.open(options, "xxx", 43200, false);

when open using python-rocksdb,the value will print some odd character,it maybe the inner data of time-to-live,when open by python-rocksdb: rocks_db = rocksdb.DB("xxx", opts, read_only=True),even add a ttl to the DB is the same

such as: [{"name":"haha"}]�E�X

young001 avatar Apr 14 '17 05:04 young001

@young001

what is your config of opts in python code?

twmht avatar Apr 16 '17 17:04 twmht

now is : rocksdb_perfconsole_process_db = rocksdb.DB(rocksdb_perfconsole_process_dir, rocksdb.Options(), read_only=True) add ttl to 43200 rocksdb_perfconsole_process_db = rocksdb.DB(rocksdb_perfconsole_process_dir, rocksdb.Options(), read_only=True, ttl=43200) with no luck

young001 avatar Apr 17 '17 05:04 young001

hi,twmht,have u confirm this problem?

young001 avatar Apr 26 '17 15:04 young001

Yes! I am trying to fix this.

twmht avatar Apr 27 '17 01:04 twmht

@young001

Sorry for late reply, Currently python-rocksdb does not support time-to-live api, I will add it.

btw, Can you give me some mini-example databases which can reproduce your problem?

twmht avatar Jun 06 '17 02:06 twmht

@young001

Sorry for late reply, Currently python-rocksdb does not support time-to-live api, I will add it.

btw, Can you give me some mini-example databases which can reproduce your problem?

Has time-to-live api been added or not? I can't find any information about it.

vnnw avatar Mar 20 '19 04:03 vnnw

@vnnw did you find the answer? any sample code?

kadnan avatar Oct 03 '22 14:10 kadnan