barrel_design_store (barrel_design v0.1.0)
View SourceThe derived store of one source database instance: a RocksDB directory under barrel_design's data_dir, opened with the source's storage environment so an encrypted database gets encrypted rows.
Summary
Functions
Bytes the store's files take on disk.
Remove the instance directories of Db other than Keep: only those whose marker names this database and their own instance. Anything else under the database's directory stays and is logged. The database's directory goes too once it is empty.
Fold [Lower, Upper) in key order, optionally under a snapshot. Fun(Key, Value, Acc) -> {ok, Acc} | {stop, Acc}.
Create the instance directory if needed and mark it as the store of Db at Instance. A directory from before markers existed is the current instance's (its name is the live instance id) and is marked.
Types
-type store() :: #{ref := rocksdb:db_handle(), env := term(), dir := string()}.
Functions
-spec bytes(store()) -> non_neg_integer().
Bytes the store's files take on disk.
Remove the instance directories of Db other than Keep: only those whose marker names this database and their own instance. Anything else under the database's directory stays and is logged. The database's directory goes too once it is empty.
-spec close(store()) -> ok.
-spec fold(store(), binary(), binary(), fun(), term(), rocksdb:snapshot_handle() | undefined) -> term().
Fold [Lower, Upper) in key order, optionally under a snapshot. Fun(Key, Value, Acc) -> {ok, Acc} | {stop, Acc}.
-spec get(store(), binary(), rocksdb:snapshot_handle()) -> {ok, binary()} | not_found | {error, term()}.
Create the instance directory if needed and mark it as the store of Db at Instance. A directory from before markers existed is the current instance's (its name is the live instance id) and is marked.
-spec release(rocksdb:snapshot_handle()) -> ok.
-spec root() -> string().
-spec snapshot(store()) -> {ok, rocksdb:snapshot_handle()} | {error, term()}.