diff options
author | Adam Kocoloski <adam@cloudant.com> | 2010-05-27 10:52:51 -0400 |
---|---|---|
committer | Adam Kocoloski <adam@cloudant.com> | 2010-05-27 11:00:49 -0400 |
commit | f399485a90f5d09f6b2df839511756642352031b (patch) | |
tree | 22cde88a85505f1049dcd67b717228cb1932ba49 /src/fabric_create.erl | |
parent | 00276b2582be213adf46c1f2333a65ceb86809e2 (diff) |
replace #part with #shard
Diffstat (limited to 'src/fabric_create.erl')
-rw-r--r-- | src/fabric_create.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fabric_create.erl b/src/fabric_create.erl index c2c01ccd..17c85b6a 100644 --- a/src/fabric_create.erl +++ b/src/fabric_create.erl @@ -20,7 +20,7 @@ create_db(DbName, Options) -> {ok, FullNodes} = mem3:fullnodes(), RefPartMap = send_create_calls(DbName, Options, Fullmap), Acc0 = {false, length(RefPartMap), - lists:usort([ {Beg, false} || {_,#part{b=Beg}} <- RefPartMap])}, + lists:usort([ {Beg, false} || {_,#shard{range=[Beg,_]}} <- RefPartMap])}, case fabric_util:receive_loop( RefPartMap, 1, fun handle_create_msg/3, Acc0, 5000, infinity) of {ok, _Results} -> @@ -37,7 +37,7 @@ create_db(DbName, Options) -> %% @doc create the partitions on all appropriate nodes (rexi calls) -spec send_create_calls(binary(), list(), fullmap()) -> [{reference(), part()}]. send_create_calls(DbName, Options, Fullmap) -> - lists:map(fun(#part{node=Node, b=Beg} = Part) -> + lists:map(fun(#shard{node=Node, range=[Beg,_]} = Part) -> ShardName = showroom_utils:shard_name(Beg, DbName), Ref = rexi:async_server_call({couch_server, Node}, {create, ShardName, Options}), @@ -55,7 +55,7 @@ handle_create_msg(_, {rexi_DOWN, _, _, _}, {Complete, _N, _Parts}) -> end; handle_create_msg(_, _, {true, 1, _Acc}) -> {stop, ok}; -handle_create_msg({_, #part{b=Beg}}, {ok, _}, {false, 1, PartResults0}) -> +handle_create_msg({_, #shard{range=[Beg,_]}}, {ok, _}, {false, 1, PartResults0}) -> PartResults = lists:keyreplace(Beg, 1, PartResults0, {Beg, true}), case is_complete(PartResults) of true -> {stop, ok}; @@ -63,7 +63,7 @@ handle_create_msg({_, #part{b=Beg}}, {ok, _}, {false, 1, PartResults0}) -> end; handle_create_msg(_RefPart, {ok, _}, {true, N, Parts}) -> {ok, {true, N-1, Parts}}; -handle_create_msg({_Ref, #part{b=Beg}}, {ok, _}, {false, Rem, PartResults0}) -> +handle_create_msg({_Ref, #shard{range=[Beg,_]}}, {ok, _}, {false, Rem, PartResults0}) -> PartResults = lists:keyreplace(Beg, 1, PartResults0, {Beg, true}), {ok, {is_complete(PartResults), Rem-1, PartResults}}. |