Struct ckb_db::db_with_ttl::DBWithTTL [−][src]
pub struct DBWithTTL { /* fields omitted */ }
Expand description
DB with ttl support wrapper
TTL is accepted in seconds If TTL is non positive or not provided, the behaviour is TTL = infinity (int32_t)Timestamp(creation) is suffixed to values in Put internally Expired TTL values are deleted in compaction only:(Timestamp+ttl<time_now) Get/Iterator may return expired entries(compaction not run on them yet) Different TTL may be used during different Opens Example: Open1 at t=0 with ttl=4 and insert k1,k2, close at t=2. Open2 at t=3 with ttl=5. Now k1,k2 should be deleted at t>=5 read_only=true opens in the usual read-only mode. Compactions will not be triggered(neither manual nor automatic), so no expired entries removed
Implementations
Open a database with ttl support.
Return the value associated with a key using RocksDB’s PinnableSlice from the given column so as to avoid unnecessary memory copy.
Insert a value into the database under the given key.
Create a new column family for the database.