Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finished initial supervisor tree.

  • Loading branch information...
commit 23f35007430aa7e0dea353698b409d31f27ad8a6 1 parent 2762f75
@massung massung authored
View
2  src/riak_core_handoff_listener_sup.erl
@@ -34,6 +34,6 @@ start_link () ->
%% @private
init ([]) ->
- {ok,{{simple_one_for_one,10,10},
+ {ok,{{one_for_one,10,10},
[?CHILD(riak_core_handoff_listener,worker)
]}}.
View
2  src/riak_core_handoff_receiver_sup.erl
@@ -30,7 +30,7 @@
-export([start_receiver/1
]).
--define(CHILD(I,Type), {I,{I,start_link,[]},permanent,brutal_kill,Type,[I]}).
+-define(CHILD(I,Type), {I,{I,start_link,[]},temporary,brutal_kill,Type,[I]}).
%% begins the supervisor, init/1 will be called
start_link () ->
View
18 src/riak_core_handoff_sender.erl
@@ -23,15 +23,19 @@
%% @doc send a partition's data via TCP-based handoff
-module(riak_core_handoff_sender).
--export([start_link/3, get_handoff_ssl_options/0]).
+-export([start_link/4, get_handoff_ssl_options/0]).
-include_lib("riak_core_vnode.hrl").
-include_lib("riak_core_handoff.hrl").
-define(ACK_COUNT, 1000).
-start_link(TargetNode, Module, Partition) ->
- Self = self(),
+start_link(TargetNode, Module, Partition, VnodePid) ->
SslOpts = get_handoff_ssl_options(),
- Pid = spawn_link(fun()->start_fold(TargetNode, Module,Partition, Self, SslOpts) end),
+ Pid = spawn_link(fun()->start_fold(TargetNode,
+ Module,
+ Partition,
+ VnodePid,
+ SslOpts)
+ end),
{ok, Pid}.
start_fold(TargetNode, Module, Partition, ParentPid, SslOpts) ->
@@ -86,17 +90,17 @@ start_fold(TargetNode, Module, Partition, ParentPid, SslOpts) ->
ok ->
lager:info("Handoff of partition ~p ~p from ~p to ~p "
"completed: sent ~p objects in ~.2f "
- "seconds",
+ "seconds",
[Module, Partition, node(), TargetNode,
SentCount, FoldTimeDiff]),
gen_fsm:send_event(ParentPid, handoff_complete);
{error, ErrReason} ->
lager:error("Handoff of partition ~p ~p from ~p to ~p "
"FAILED after sending ~p objects "
- "in ~.2f seconds: ~p",
+ "in ~.2f seconds: ~p",
[Module, Partition, node(), TargetNode,
SentCount, FoldTimeDiff, ErrReason]),
- gen_fsm:send_event(ParentPid, {handoff_error,
+ gen_fsm:send_event(ParentPid, {handoff_error,
fold_error, ErrReason})
end
catch
View
4 src/riak_core_handoff_sender_sup.erl
@@ -30,7 +30,7 @@
-export([start_sender/3
]).
--define(CHILD(I,Type), {I,{I,start_link,[]},permanent,brutal_kill,Type,[I]}).
+-define(CHILD(I,Type), {I,{I,start_link,[]},temporary,brutal_kill,Type,[I]}).
%% begins the supervisor, init/1 will be called
start_link () ->
@@ -44,4 +44,4 @@ init ([]) ->
%% start a sender process
start_sender (TargetNode,Module,Partition) ->
- supervisor:start_child(?MODULE,[TargetNode,Module,Partition]).
+ supervisor:start_child(?MODULE,[TargetNode,Module,Partition,self()]).
View
8 src/riak_core_handoff_sup.erl
@@ -26,10 +26,6 @@
init/1
]).
-%% public functions
--export([start_sender/0
- ]).
-
-define(CHILD(I,Type), {I,{I,start_link,[]},permanent,brutal_kill,Type,[I]}).
%% begins the supervisor, init/1 will be called
@@ -44,7 +40,3 @@ init ([]) ->
?CHILD(riak_core_handoff_listener_sup,supervisor),
?CHILD(riak_core_handoff_manager,worker)
]}}.
-
-%% start a sender process
-start_sender () ->
- supervisor:start_child(?MODULE,[]).
Please sign in to comment.
Something went wrong with that request. Please try again.