diff options
author | Nick Vatamaniuc <vatamane@gmail.com> | 2022-05-19 18:02:53 -0400 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2022-05-19 18:48:14 -0400 |
commit | 5ded3ba5fa713a979adcd3c75a62782498de963e (patch) | |
tree | 536f47ef96e97ed9cbd09ac86931f5c0b92e27ce | |
parent | 104827994f0596f646d86bf1f68bb5628e82374e (diff) | |
download | couchdb-5ded3ba5fa713a979adcd3c75a62782498de963e.tar.gz |
Remove dead code from smoosh
-rw-r--r-- | src/smoosh/src/smoosh_channel.erl | 13 | ||||
-rw-r--r-- | src/smoosh/src/smoosh_server.erl | 14 | ||||
-rw-r--r-- | src/smoosh/src/smoosh_utils.erl | 15 |
3 files changed, 1 insertions, 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). |