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 <[email protected]> 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).
