You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2022/05/19 22:11:07 UTC

[couchdb] branch dead-code-cleanup updated (7cde91d5c -> 8725a9b71)

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

vatamane pushed a change to branch dead-code-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git


 discard 7cde91d5c Cleanup couch_file exports and unused code
 discard 9bb5f79e0 Remove dead code from smoosh
 discard be1b2e5b5 Removed unused include files
     add cf7a2275d Implement resource hoggers
     add cc47dcd70 Merge pull request #3985 from noahshaw11/implement-resource_hoggers
     new e8a018386 Removed unused include files
     new 3163b9bee Remove dead code from smoosh
     new 8725a9b71 Cleanup couch_file exports and unused code

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (7cde91d5c)
            \
             N -- N -- N   refs/heads/dead-code-cleanup (8725a9b71)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 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.


Summary of changes:
 src/couch/src/couch_debug.erl | 157 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 157 insertions(+)


[couchdb] 02/03: Remove dead code from smoosh

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

vatamane pushed a commit to branch dead-code-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 3163b9bee2f565f87ee7c11bc54754838b5eab71
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Thu May 19 18:02:53 2022 -0400

    Remove dead code from smoosh
---
 src/smoosh/src/smoosh_channel.erl | 13 -------------
 src/smoosh/src/smoosh_server.erl  | 14 --------------
 src/smoosh/src/smoosh_utils.erl   | 15 +--------------
 3 files changed, 1 insertion(+), 41 deletions(-)

diff --git a/src/smoosh/src/smoosh_channel.erl b/src/smoosh/src/smoosh_channel.erl
index fbeb011d7..952f4fd50 100644
--- a/src/smoosh/src/smoosh_channel.erl
+++ b/src/smoosh/src/smoosh_channel.erl
@@ -460,19 +460,6 @@ maybe_start_compaction(State) ->
             State
     end.
 
-start_compact(State, {schema, DbName, GroupId}) ->
-    case smoosh_utils:ignore_db({DbName, GroupId}) of
-        false ->
-            {ok, Pid} = couch_md_index_manager:get_group_pid(
-                DbName,
-                GroupId
-            ),
-            Ref = erlang:monitor(process, Pid),
-            Pid ! {'$gen_call', {self(), Ref}, compact},
-            State#state{starting = [{Ref, {schema, DbName, GroupId}} | State#state.starting]};
-        _ ->
-            false
-    end;
 start_compact(State, DbName) when is_list(DbName) ->
     start_compact(State, ?l2b(DbName));
 start_compact(State, DbName) when is_binary(DbName) ->
diff --git a/src/smoosh/src/smoosh_server.erl b/src/smoosh/src/smoosh_server.erl
index 145f8d1ab..55c8f61fd 100644
--- a/src/smoosh/src/smoosh_server.erl
+++ b/src/smoosh/src/smoosh_server.erl
@@ -384,20 +384,6 @@ get_priority(Channel, {Shard, GroupId}) ->
             ),
             0
     end;
-get_priority(Channel, {schema, DbName, DDocId}) ->
-    case couch_md_index_manager:get_group_pid(DbName, DDocId) of
-        {ok, Pid} ->
-            {ok, SchemaInfo} = couch_md_index:get_info(Pid),
-            DiskSize = couch_util:get_value(disk_size, SchemaInfo),
-            DataSize = couch_util:get_value(data_size, SchemaInfo),
-            get_priority(Channel, DiskSize, DataSize, false);
-        {error, Reason} ->
-            couch_log:warning(
-                "Failed to get group_pid for ~p ~p ~p: ~p",
-                [Channel, DbName, DDocId, Reason]
-            ),
-            0
-    end;
 get_priority(Channel, DbName) when is_list(DbName) ->
     get_priority(Channel, ?l2b(DbName));
 get_priority(Channel, DbName) when is_binary(DbName) ->
diff --git a/src/smoosh/src/smoosh_utils.erl b/src/smoosh/src/smoosh_utils.erl
index ac9b0568f..6dd231ce7 100644
--- a/src/smoosh/src/smoosh_utils.erl
+++ b/src/smoosh/src/smoosh_utils.erl
@@ -13,23 +13,10 @@
 -module(smoosh_utils).
 -include_lib("couch/include/couch_db.hrl").
 
--export([get/2, get/3, group_pid/1, split/1, stringify/1, ignore_db/1]).
+-export([get/2, get/3, split/1, stringify/1, ignore_db/1]).
 -export([in_allowed_window/1, write_to_file/3]).
 -export([log_level/2]).
 
-group_pid({Shard, GroupId}) ->
-    case couch_view_group:open_db_group(Shard, GroupId) of
-        {ok, Group} ->
-            try
-                gen_server:call(couch_view, {get_group_server, Shard, Group})
-            catch
-                _:Error ->
-                    {error, Error}
-            end;
-        Else ->
-            Else
-    end.
-
 get(Channel, Key) ->
     ?MODULE:get(Channel, Key, undefined).
 


[couchdb] 03/03: Cleanup couch_file exports and unused code

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

vatamane pushed a commit to branch dead-code-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 8725a9b7145d0b9ef4d83e852cd486439bea2ea4
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Thu May 19 18:08:03 2022 -0400

    Cleanup couch_file exports and unused code
    
    Removed:
     * append_binary_md5/2
     * assemble_file_chunk/1
     * append_term_md5/2
     * append_term_md5/3
     * pread_binaries/2
     * pread_iolists/2
     * append_binaries/2
---
 src/couch/src/couch_file.erl | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/src/couch/src/couch_file.erl b/src/couch/src/couch_file.erl
index 0e786525f..ba8d9c42f 100644
--- a/src/couch/src/couch_file.erl
+++ b/src/couch/src/couch_file.erl
@@ -39,11 +39,11 @@
 % public API
 -export([open/1, open/2, close/1, bytes/1, sync/1, truncate/2, set_db_pid/2]).
 -export([pread_term/2, pread_iolist/2, pread_binary/2]).
--export([append_binary/2, append_binary_md5/2]).
--export([append_raw_chunk/2, assemble_file_chunk/1, assemble_file_chunk/2]).
--export([append_term/2, append_term/3, append_term_md5/2, append_term_md5/3]).
--export([pread_terms/2, pread_binaries/2, pread_iolists/2]).
--export([append_terms/2, append_terms/3, append_binaries/2]).
+-export([append_binary/2]).
+-export([append_raw_chunk/2, assemble_file_chunk/2]).
+-export([append_term/2, append_term/3]).
+-export([pread_terms/2]).
+-export([append_terms/2, append_terms/3]).
 -export([write_header/2, read_header/1]).
 -export([delete/2, delete/3, nuke_dir/2, init_delete_dir/1]).
 -export([last_read/1]).
@@ -124,13 +124,6 @@ append_term(Fd, Term, Options) ->
     Comp = couch_util:get_value(compression, Options, ?DEFAULT_COMPRESSION),
     append_binary(Fd, couch_compress:compress(Term, Comp)).
 
-append_term_md5(Fd, Term) ->
-    append_term_md5(Fd, Term, []).
-
-append_term_md5(Fd, Term, Options) ->
-    Comp = couch_util:get_value(compression, Options, ?DEFAULT_COMPRESSION),
-    append_binary_md5(Fd, couch_compress:compress(Term, Comp)).
-
 %%----------------------------------------------------------------------
 %% Purpose: To append an Erlang binary to the end of the file.
 %% Args:    Erlang term to serialize and append to the file.
@@ -142,13 +135,6 @@ append_term_md5(Fd, Term, Options) ->
 append_binary(Fd, Bin) ->
     ioq:call(Fd, {append_bin, assemble_file_chunk(Bin)}, erlang:get(io_priority)).
 
-append_binary_md5(Fd, Bin) ->
-    ioq:call(
-        Fd,
-        {append_bin, assemble_file_chunk(Bin, couch_hash:md5_hash(Bin))},
-        erlang:get(io_priority)
-    ).
-
 append_raw_chunk(Fd, Chunk) ->
     ioq:call(Fd, {append_bin, Chunk}, erlang:get(io_priority)).
 


[couchdb] 01/03: Removed unused include files

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

vatamane pushed a commit to branch dead-code-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit e8a0183864aef248a7f6dec82819ea6ec4c60a78
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Thu May 19 17:53:11 2022 -0400

    Removed unused include files
    
    Emacs + erlang_ls noticed those. There may be more, but didn't know how
    systematically check all of the files.
---
 src/fabric/src/fabric_doc_update.erl | 1 -
 src/rexi/src/rexi.erl                | 2 --
 2 files changed, 3 deletions(-)

diff --git a/src/fabric/src/fabric_doc_update.erl b/src/fabric/src/fabric_doc_update.erl
index b6a588039..69ad03da5 100644
--- a/src/fabric/src/fabric_doc_update.erl
+++ b/src/fabric/src/fabric_doc_update.erl
@@ -14,7 +14,6 @@
 
 -export([go/3]).
 
--include_lib("fabric/include/fabric.hrl").
 -include_lib("mem3/include/mem3.hrl").
 -include_lib("couch/include/couch_db.hrl").
 
diff --git a/src/rexi/src/rexi.erl b/src/rexi/src/rexi.erl
index 90000dda2..77830996e 100644
--- a/src/rexi/src/rexi.erl
+++ b/src/rexi/src/rexi.erl
@@ -21,8 +21,6 @@
 -export([stream2/1, stream2/2, stream2/3, stream_last/1, stream_last/2]).
 -export([ping/0]).
 
--include_lib("rexi/include/rexi.hrl").
-
 start() ->
     application:start(rexi).