summaryrefslogtreecommitdiff
path: root/src/plop.erl
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-10-29 16:35:44 +0100
committerLinus Nordberg <linus@nordberg.se>2014-10-29 16:56:48 +0100
commit92f681e1cbb444317d2603994c60c02feeab32be (patch)
treeef62cdfece8c1f063cb27cf299094e1f4d7eed1a /src/plop.erl
parentb15f4636337c45b487651e8d442afed0d4141725 (diff)
parentcc2aaa2807bb13f4683c2d74a414d39d5b29a372 (diff)
Merge remote-tracking branch 'refs/remotes/map/external-merge3' into merging-external-merge
Conflicts: src/db.erl src/frontend.erl src/index.erl src/plop.erl src/storage.erl src/ts.erl
Diffstat (limited to 'src/plop.erl')
-rw-r--r--src/plop.erl12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plop.erl b/src/plop.erl
index 57febf5..0c85b21 100644
--- a/src/plop.erl
+++ b/src/plop.erl
@@ -189,12 +189,8 @@ get_logid() ->
testing_get_pubkey() ->
gen_server:call(?MODULE, {test, pubkey}).
-fill_in_entry({_Index, LeafHash, notfetched}) ->
- db:get_by_leaf_hash(LeafHash).
-
storage_nodes() ->
- {ok, Value} = application:get_env(plop, storage_nodes, {ok, []}),
- Value.
+ application:get_env(plop, storage_nodes, []).
storage_nodes_quorum() ->
{ok, Value} = application:get_env(plop, storage_nodes_quorum),
@@ -222,6 +218,7 @@ send_storage_entrycommitted(URLBase, EntryHash, TreeLeafHash) ->
[], [{sync, false}]).
store_at_all_nodes(Nodes, {LogEntry, TreeLeafHash, EntryHash}, From, State) ->
+ lager:debug("leafhash ~p", [TreeLeafHash]),
OwnRequestId = make_ref(),
Completion =
@@ -240,6 +237,7 @@ store_at_all_nodes(Nodes, {LogEntry, TreeLeafHash, EntryHash}, From, State) ->
{From, Completion,
storage_nodes_quorum()}}),
+ lager:debug("send requests to ~p", [Nodes]),
RequestIds = [send_storage_sendentry(URLBase, LogEntry, TreeLeafHash)
|| URLBase <- Nodes],
PlopWithRequests =
@@ -250,6 +248,9 @@ store_at_all_nodes(Nodes, {LogEntry, TreeLeafHash, EntryHash}, From, State) ->
end, PlopWithOwn, RequestIds),
PlopWithRequests.
+fill_in_entry({_Index, LeafHash, notfetched}) ->
+ db:get_by_leaf_hash(LeafHash).
+
%%%%%%%%%%%%%%%%%%%%
handle_call(stop, _From, Plop) ->
{stop, normal, stopped, Plop};
@@ -267,6 +268,7 @@ handle_call({get, logid}, _From,
{reply, LogID, Plop};
handle_call({add, {LogEntry, TreeLeafHash, EntryHash}}, From, Plop) ->
+ lager:debug("add leafhash ~p", [TreeLeafHash]),
case storage_nodes() of
[] ->
ok = db:add(TreeLeafHash, EntryHash, LogEntry, ht:size()),