Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Change API to function per level
  • Loading branch information
rnewson committed Feb 12, 2014
1 parent d42720a commit 2c3b9cf45faf8f526f5865cb9eaab3380582d4b2
Showing 5 changed files with 14 additions and 14 deletions.
@@ -69,7 +69,7 @@ handle_cast(_Msg, State) ->
{noreply, State}.

handle_info({'DOWN', _, _, Pid, Reason}, #state{changes_pid=Pid} = State) ->
couch_log:log(notice, "~p changes listener died ~p", [?MODULE, Reason]),
couch_log:notice("~p changes listener died ~p", [?MODULE, Reason]),
StartSeq = State#state.update_seq,
Seq = case Reason of {seq, EndSeq} -> EndSeq; _ -> StartSeq end,
erlang:send_after(5000, self(), start_listener),
@@ -147,7 +147,7 @@ handle_info({'DOWN', _, _, Pid, Reason}, #st{changes_pid=Pid}=St) ->
shard_db_changed ->
{cache_clear(St), get_update_seq()};
_ ->
couch_log:log(notice, "~p changes listener died ~p", [?MODULE, Reason]),
couch_log:notice("~p changes listener died ~p", [?MODULE, Reason]),
{St, get_update_seq()}
end,
erlang:send_after(5000, self(), {start_listener, Seq}),
@@ -218,7 +218,7 @@ changes_callback({change, {Change}, _}, _) ->
false ->
case couch_util:get_value(doc, Change) of
{error, Reason} ->
couch_log:log(error, "missing partition table for ~s: ~p",
couch_log:error("missing partition table for ~s: ~p",
[DbName, Reason]);
{Doc} ->
Shards = mem3_util:build_shards(DbName, Doc),
@@ -268,7 +268,7 @@ create_if_missing(Name) ->
{ok, Db} ->
couch_db:close(Db);
Error ->
couch_log:log(error, "~p tried to create ~s, got ~p",
couch_log:error("~p tried to create ~s, got ~p",
[?MODULE, Name, Error])
end
end.
@@ -134,7 +134,7 @@ handle_info({'EXIT', Active, {{not_found, no_db_file}, _Stack}}, State) ->
handle_info({'EXIT', Active, Reason}, State) ->
NewState = case lists:keyfind(Active, #job.pid, State#state.active) of
#job{name=OldDbName, node=OldNode} = Job ->
couch_log:log(warn, "~s ~s ~s ~w", [?MODULE, OldDbName, OldNode, Reason]),
couch_log:warning("~s ~s ~s ~w", [?MODULE, OldDbName, OldNode, Reason]),
case Reason of {pending_changes, Count} ->
maybe_resubmit(State, Job#job{pid = nil, count = Count});
_ ->
@@ -150,7 +150,7 @@ handle_info({'EXIT', Active, Reason}, State) ->
handle_replication_exit(NewState, Active);

handle_info(Msg, State) ->
couch_log:log(notice, "unexpected msg at replication manager ~p", [Msg]),
couch_log:notice("unexpected msg at replication manager ~p", [Msg]),
{noreply, State}.

terminate(_Reason, State) ->
@@ -221,7 +221,7 @@ add_to_queue(State, #job{name=DbName, node=Node, pid=From} = Job) ->
if From =/= nil -> gen_server:reply(From, ok); true -> ok end,
State;
false ->
couch_log:log(debug, "adding ~s -> ~p to mem3_sync queue", [DbName, Node]),
couch_log:debug("adding ~s -> ~p to mem3_sync queue", [DbName, Node]),
State#state{
dict = dict:store({DbName,Node}, ok, D),
waiting = in(Job, WQ)
@@ -339,6 +339,6 @@ maybe_redirect(Node) ->
undefined ->
Node;
Redirect ->
couch_log:log(debug, "Redirecting push from ~p to ~p", [Node, Redirect]),
couch_log:debug("Redirecting push from ~p to ~p", [Node, Redirect]),
list_to_existing_atom(Redirect)
end.
@@ -37,7 +37,7 @@ maybe_sync_int(#shard{name=Name}=Src, Dst) ->
end;
Else ->
Args = [DbName, Else],
couch_log:log(err, "Error checking security objects for ~s :: ~p", Args)
couch_log:error("Error checking security objects for ~s :: ~p", Args)
end.

go() ->
@@ -55,18 +55,18 @@ handle_db(DbName) ->
ok ->
ok;
{fixable, SecObj} ->
couch_log:log(info, "Sync security object for ~p: ~p", [DbName, SecObj]),
couch_log:info("Sync security object for ~p: ~p", [DbName, SecObj]),
case fabric:set_security(DbName, SecObj) of
ok -> ok;
Error ->
couch_log:log(err, "Error setting security object in ~p: ~p",
couch_log:error("Error setting security object in ~p: ~p",
[DbName, Error])
end;
broken ->
couch_log:log(err, "Bad security object in ~p: ~p", [DbName, SecObjs])
couch_log:error("Bad security object in ~p: ~p", [DbName, SecObjs])
end;
Error ->
couch_log:log(err, "Error getting security objects for ~p: ~p", [
couch_log:error("Error getting security objects for ~p: ~p", [
DbName, Error])
end.

@@ -155,7 +155,7 @@ n_val(undefined, NodeCount) ->
n_val(N, NodeCount) when is_list(N) ->
n_val(list_to_integer(N), NodeCount);
n_val(N, NodeCount) when is_integer(NodeCount), N > NodeCount ->
couch_log:log(error, "Request to create N=~p DB but only ~p node(s)", [N, NodeCount]),
couch_log:error("Request to create N=~p DB but only ~p node(s)", [N, NodeCount]),
NodeCount;
n_val(N, _) when N < 1 ->
1;

0 comments on commit 2c3b9cf

Please sign in to comment.