You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2020/04/05 19:21:58 UTC

[couchdb] 05/05: Move functions for consistency

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch davisp-db-softdeletion
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 445aa03550ffbec69b6d7946d6b04873559f486d
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Sun Apr 5 14:20:09 2020 -0500

    Move functions for consistency
---
 src/fabric/src/fabric2_fdb.erl | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/fabric/src/fabric2_fdb.erl b/src/fabric/src/fabric2_fdb.erl
index cd51161..e45843d 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(),