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.

Delete column family.

“rocksdb.estimate-num-keys” - returns estimated number of total keys in the active and unflushed immutable memtables and storage.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

TODO(doc): @quake

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.