diff options
author | Paul J. Davis <paul.joseph.davis@gmail.com> | 2020-04-05 14:20:09 -0500 |
---|---|---|
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | 2020-04-05 14:20:09 -0500 |
commit | 445aa03550ffbec69b6d7946d6b04873559f486d (patch) | |
tree | f9b68597ec4ec3c282b1eae8f215e0bad3f811d3 | |
parent | 07ccd471c52e92b8ffff2b477b8a3ca05578ba18 (diff) | |
download | couchdb-445aa03550ffbec69b6d7946d6b04873559f486d.tar.gz |
Move functions for consistencyarchive/davisp-db-softdeletiondavisp-db-softdeletion
-rw-r--r-- | src/fabric/src/fabric2_fdb.erl | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/fabric/src/fabric2_fdb.erl b/src/fabric/src/fabric2_fdb.erl index cd51161c2..e45843dbb 100644 --- a/src/fabric/src/fabric2_fdb.erl +++ b/src/fabric/src/fabric2_fdb.erl @@ -22,9 +22,9 @@ open/2, ensure_current/1, delete/1, - exists/1, undelete/3, remove_deleted_db/2, + exists/1, get_dir/1, @@ -348,19 +348,6 @@ delete(#{} = Db) -> end. -exists(#{name := DbName} = Db) when is_binary(DbName) -> - #{ - tx := Tx, - layer_prefix := LayerPrefix - } = ensure_current(Db, false), - - DbKey = erlfdb_tuple:pack({?ALL_DBS, DbName}, LayerPrefix), - case erlfdb:wait(erlfdb:get(Tx, DbKey)) of - Bin when is_binary(Bin) -> true; - not_found -> false - end. - - undelete(#{} = Db0, TgtDbName, TimeStamp) -> #{ name := DbName, @@ -420,6 +407,19 @@ remove_deleted_db(#{} = Db0, TimeStamp) -> end. +exists(#{name := DbName} = Db) when is_binary(DbName) -> + #{ + tx := Tx, + layer_prefix := LayerPrefix + } = ensure_current(Db, false), + + DbKey = erlfdb_tuple:pack({?ALL_DBS, DbName}, LayerPrefix), + case erlfdb:wait(erlfdb:get(Tx, DbKey)) of + Bin when is_binary(Bin) -> true; + not_found -> false + end. + + get_dir(Tx) -> Root = erlfdb_directory:root(), Dir = fabric2_server:fdb_directory(), |