You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2019/09/04 19:48:54 UTC

[couchdb] branch remove-deprecated-dbinfo-bits created (now d9c294d)

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

kocolosk pushed a change to branch remove-deprecated-dbinfo-bits
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at d9c294d  Remove deprecated dbinfo fields

This branch includes the following new commits:

     new d9c294d  Remove deprecated dbinfo fields

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Remove deprecated dbinfo fields

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch remove-deprecated-dbinfo-bits
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit d9c294d8a35939f1fc19616cc93afeace5b0de31
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Wed Sep 4 15:31:40 2019 -0400

    Remove deprecated dbinfo fields
    
    These fields are all marked as deprecated in the current documentation
    and they have more specific replacements in the `sizes` object.
    
    Fauxton needs an update here as well.
---
 src/couch/src/couch_db.erl                              |  8 --------
 src/couch_mrview/src/couch_mrview_index.erl             |  2 --
 .../test/eunit/couch_mrview_index_info_tests.erl        | 10 ----------
 src/fabric/src/fabric_db_info.erl                       | 17 -----------------
 src/fabric/src/fabric_group_info.erl                    |  4 ----
 5 files changed, 41 deletions(-)

diff --git a/src/couch/src/couch_db.erl b/src/couch/src/couch_db.erl
index 52c3fbb..33aa1f7 100644
--- a/src/couch/src/couch_db.erl
+++ b/src/couch/src/couch_db.erl
@@ -619,14 +619,6 @@ get_db_info(Db) ->
         {purge_seq, couch_db_engine:get_purge_seq(Db)},
         {compact_running, Compactor /= nil},
         {sizes, {SizeInfo}},
-        % TODO: Remove this in 3.0
-        % These are legacy and have been duplicated under
-        % the sizes key since 2.0. We should make a note
-        % in our release notes that we'll remove these
-        % old versions in 3.0
-        {disk_size, FileSize}, % legacy
-        {data_size, ActiveSize},
-        {other, {[{data_size, ExternalSize}]}},
         {instance_start_time, StartTime},
         {disk_format_version, DiskVersion},
         {committed_update_seq, CommittedUpdateSeq},
diff --git a/src/couch_mrview/src/couch_mrview_index.erl b/src/couch_mrview/src/couch_mrview_index.erl
index 0370169..91703bd 100644
--- a/src/couch_mrview/src/couch_mrview_index.erl
+++ b/src/couch_mrview/src/couch_mrview_index.erl
@@ -80,8 +80,6 @@ get(info, State) ->
     {ok, [
         {signature, list_to_binary(couch_index_util:hexsig(Sig))},
         {language, Lang},
-        {disk_size, FileSize}, % legacy
-        {data_size, ExternalSize}, % legacy
         {sizes, {[
             {file, FileSize},
             {active, ActiveSize},
diff --git a/src/couch_mrview/test/eunit/couch_mrview_index_info_tests.erl b/src/couch_mrview/test/eunit/couch_mrview_index_info_tests.erl
index efa03e7..c4c765f 100644
--- a/src/couch_mrview/test/eunit/couch_mrview_index_info_tests.erl
+++ b/src/couch_mrview/test/eunit/couch_mrview_index_info_tests.erl
@@ -48,8 +48,6 @@ view_info_test_() ->
                     fun file_size_is_non_neg_int/1,
                     fun active_size_is_non_neg_int/1,
                     fun external_size_is_non_neg_int/1,
-                    fun disk_size_is_file_size/1,
-                    fun data_size_is_external_size/1,
                     fun active_size_less_than_file_size/1,
                     fun update_seq_is_non_neg_int/1,
                     fun purge_seq_is_non_neg_int/1,
@@ -80,14 +78,6 @@ external_size_is_non_neg_int({_, Info}) ->
     ?_assert(check_non_neg_int([sizes, external], Info)).
 
 
-disk_size_is_file_size({_, Info}) ->
-    ?_assertEqual(prop([sizes, file], Info), prop(disk_size, Info)).
-
-
-data_size_is_external_size({_, Info}) ->
-    ?_assertEqual(prop([sizes, external], Info), prop(data_size, Info)).
-
-
 active_size_less_than_file_size({_, Info}) ->
     ?_assert(prop([sizes, active], Info) < prop([sizes, file], Info)).
 
diff --git a/src/fabric/src/fabric_db_info.erl b/src/fabric/src/fabric_db_info.erl
index bb7a353..ed14e3e 100644
--- a/src/fabric/src/fabric_db_info.erl
+++ b/src/fabric/src/fabric_db_info.erl
@@ -99,14 +99,8 @@ merge_results(Info) ->
             [{doc_del_count, lists:sum(X)} | Acc];
         (compact_running, X, Acc) ->
             [{compact_running, lists:member(true, X)} | Acc];
-        (disk_size, X, Acc) -> % legacy
-            [{disk_size, lists:sum(X)} | Acc];
-        (data_size, X, Acc) -> % legacy
-            [{data_size, lists:sum(X)} | Acc];
         (sizes, X, Acc) ->
             [{sizes, {merge_object(X)}} | Acc];
-        (other, X, Acc) -> % legacy
-            [{other, {merge_other_results(X)}} | Acc];
         (disk_format_version, X, Acc) ->
             [{disk_format_version, lists:max(X)} | Acc];
         (cluster, [X], Acc) ->
@@ -117,17 +111,6 @@ merge_results(Info) ->
             Acc
     end, [{instance_start_time, <<"0">>}], Dict).
 
-merge_other_results(Results) ->
-    Dict = lists:foldl(fun({Props}, D) ->
-        lists:foldl(fun({K,V},D0) -> orddict:append(K,V,D0) end, D, Props)
-    end, orddict:new(), Results),
-    orddict:fold(fun
-        (data_size, X, Acc) ->
-            [{data_size, lists:sum(X)} | Acc];
-        (_, _, Acc) ->
-            Acc
-    end, [], Dict).
-
 merge_object(Objects) ->
     Dict = lists:foldl(fun({Props}, D) ->
         lists:foldl(fun({K,V},D0) -> orddict:append(K,V,D0) end, D, Props)
diff --git a/src/fabric/src/fabric_group_info.erl b/src/fabric/src/fabric_group_info.erl
index be50742..91bdf01 100644
--- a/src/fabric/src/fabric_group_info.erl
+++ b/src/fabric/src/fabric_group_info.erl
@@ -111,10 +111,6 @@ merge_results(Info) ->
             [{signature, X} | Acc];
         (language, [X | _], Acc) ->
             [{language, X} | Acc];
-        (disk_size, X, Acc) -> % legacy
-            [{disk_size, lists:sum(X)} | Acc];
-        (data_size, X, Acc) -> % legacy
-            [{data_size, lists:sum(X)} | Acc];
         (sizes, X, Acc) ->
             [{sizes, {merge_object(X)}} | Acc];
         (compact_running, X, Acc) ->