From 4e255d8f327b2bb6c179839db5b8d66383a391c4 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Wed, 12 May 2010 21:48:32 -0400 Subject: create_db quorum check done, as well as initial install_fullmap function --- src/mem3.erl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/mem3.erl') diff --git a/src/mem3.erl b/src/mem3.erl index a95b5fb0..189bcf8e 100644 --- a/src/mem3.erl +++ b/src/mem3.erl @@ -20,7 +20,7 @@ %% API -export([start_link/0, start_link/1, stop/0, stop/1, reset/0]). --export([join/3, clock/0, state/0, nodes/0, start_gossip/0]). +-export([join/3, clock/0, state/0, nodes/0, fullnodes/0, start_gossip/0]). %-export([partitions/0, fullmap/0]). %-export([nodes/0, nodes_for_part/1, nodes_for_part/2, all_nodes_parts/1]). %-export([parts_for_node/1]). @@ -123,6 +123,13 @@ nodes() -> gen_server:call(?SERVER, nodes). +%% @doc get the list of cluster nodes (according to membership module) +%% This may differ from erlang:nodes() +%% Guaranteed to be in order of State's node list (1st elem in 3-tuple) +fullnodes() -> + gen_server:call(?SERVER, fullnodes). + + % %% @doc get all the responsible nodes for a given partition, including % %% replication partner nodes % nodes_for_part(Part) -> @@ -207,6 +214,10 @@ handle_call(nodes, _From, #mem{nodes=Nodes} = State) -> {_,NodeList,_} = lists:unzip3(lists:keysort(1, Nodes)), {reply, {ok, NodeList}, State}; +%% fullnodes +handle_call(fullnodes, _From, #mem{nodes=Nodes} = State) -> + {reply, {ok, Nodes}, State}; + %% gossip handle_call({gossip, RemoteState}, {Pid,_Tag} = From, LocalState) -> showroom_log:message(info, "membership: received gossip from ~p", -- cgit v1.2.3