• Y
    Blob DB TTL extractor · 6083bc79
    Yi Wu 提交于
    Summary:
    Introducing blob_db::TTLExtractor to replace extract_ttl_fn. The TTL
    extractor can be use to extract TTL from keys insert with Put or
    WriteBatch. Change over existing extract_ttl_fn are:
    * If value is changed, it will be return via std::string* (rather than Slice*). With Slice* the new value has to be part of the existing value. With std::string* the limitation is removed.
    * It can optionally return TTL or expiration.
    
    Other changes in this PR:
    * replace `std::chrono::system_clock` with `Env::NowMicros` so that I can mock time in tests.
    * add several TTL tests.
    * other minor naming change.
    Closes https://github.com/facebook/rocksdb/pull/2659
    
    Differential Revision: D5512627
    
    Pulled By: yiwu-arbug
    
    fbshipit-source-id: 0dfcb00d74d060b8534c6130c808e4d5d0a54440
    6083bc79
blob_db.h 6.7 KB