Skip to content

Commit

Permalink
Merge branch 'develop' into eas-bucket-type-merged
Browse files Browse the repository at this point in the history
Conflicts:
	src/riak_core_bucket.erl
  • Loading branch information
engelsanchez committed Sep 7, 2013
2 parents 40d3220 + 47283e7 commit b557151
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 27 deletions.
2 changes: 1 addition & 1 deletion ebin/riak_core.app
Expand Up @@ -3,7 +3,7 @@
{application, riak_core,
[
{description, "Riak Core"},
{vsn, "1.4.1"},
{vsn, "1.4.2"},
{modules, [
app_helper,
bloom,
Expand Down
12 changes: 6 additions & 6 deletions rebar.config
Expand Up @@ -6,14 +6,14 @@

{deps, [
{lager, "2.0.0", {git, "git://github.com/basho/lager", {tag, "2.0.0"}}},
{poolboy, ".*", {git, "git://github.com/basho/poolboy", {branch, "master"}}},
{poolboy, ".*", {git, "git://github.com/basho/poolboy", {branch, "develop"}}},
{protobuffs, "0.8.*", {git, "git://github.com/basho/erlang_protobuffs",
{branch, "master"}}},
{basho_stats, ".*", {git, "git://github.com/basho/basho_stats", "HEAD"}},
{riak_sysmon, ".*", {git, "git://github.com/basho/riak_sysmon", {branch, "master"}}},
{tag, "0.8.1p1"}}},
{basho_stats, ".*", {git, "git://github.com/basho/basho_stats", {branch, "develop"}}},
{riak_sysmon, ".*", {git, "git://github.com/basho/riak_sysmon", {branch, "develop"}}},
{webmachine, ".*", {git, "git://github.com/basho/webmachine",
{tag, "1.10.3"}}},
{folsom, ".*", {git, "git://github.com/basho/folsom.git", {tag, "0.7.4p1"}}},
{tag, "1.10.4p1"}}},
{folsom, ".*", {git, "git://github.com/basho/folsom.git", {tag, "0.7.4p2"}}},
{ranch, "0.4.0-p1", {git, "git://github.com/basho/ranch.git", {tag, "0.4.0-p1"}}}

]}.
33 changes: 20 additions & 13 deletions src/riak_core_handoff_sender.erl
Expand Up @@ -316,21 +316,28 @@ visit_item(K, V, Acc) ->

case Filter(K) of
true ->
BinObj = Module:encode_handoff_item(K, V),

ItemQueue2 = [BinObj | ItemQueue],
ItemQueueLength2 = ItemQueueLength + 1,
ItemQueueByteSize2 = ItemQueueByteSize + byte_size(BinObj),

Acc2 = Acc#ho_acc{item_queue_length=ItemQueueLength2,
item_queue_byte_size=ItemQueueByteSize2},

case Module:encode_handoff_item(K, V) of
corrupted ->
{Bucket, Key} = K,
lager:warning("Unreadable object ~p/~p discarded",
[Bucket, Key]),
Acc;
BinObj ->

ItemQueue2 = [BinObj | ItemQueue],
ItemQueueLength2 = ItemQueueLength + 1,
ItemQueueByteSize2 = ItemQueueByteSize + byte_size(BinObj),

Acc2 = Acc#ho_acc{item_queue_length=ItemQueueLength2,
item_queue_byte_size=ItemQueueByteSize2},

%% Unit size is bytes:
HandoffBatchThreshold = app_helper:get_env(riak_core, handoff_batch_threshold, 1024*1024),
HandoffBatchThreshold = app_helper:get_env(riak_core, handoff_batch_threshold, 1024*1024),

case ItemQueueByteSize2 =< HandoffBatchThreshold of
true -> Acc2#ho_acc{item_queue=ItemQueue2};
false -> send_objects(ItemQueue2, Acc2)
case ItemQueueByteSize2 =< HandoffBatchThreshold of
true -> Acc2#ho_acc{item_queue=ItemQueue2};
false -> send_objects(ItemQueue2, Acc2)
end
end;

false ->
Expand Down
2 changes: 1 addition & 1 deletion src/riak_core_stat_cache.erl
Expand Up @@ -272,7 +272,7 @@ cache_test_() ->
{setup,
fun() ->
folsom:start(),
[meck:new(Mock, [passthrough]) || Mock <- ?MOCKS],
[meck:new(Mock, [non_strict, passthrough]) || Mock <- ?MOCKS],
riak_core_stat_cache:start_link()
end,
fun(_) ->
Expand Down
10 changes: 7 additions & 3 deletions src/riak_core_stat_q.erl
Expand Up @@ -90,6 +90,10 @@ get_stat(Stat) ->
Pid = riak_core_stat_calc_sup:calc_proc(Stat),
riak_core_stat_calc_proc:value(Pid).

throw_folsom_error({error, _, _} = Err) ->
throw(Err);
throw_folsom_error(Other) -> Other.

%% Encapsulate getting a stat value from folsom.
%%
%% If for any reason we can't get a stats value
Expand All @@ -99,21 +103,21 @@ get_stat(Stat) ->
%% stats that are broken?
calc_stat({Name, gauge}) ->
try
GaugeVal = folsom_metrics:get_metric_value(Name),
GaugeVal = throw_folsom_error(folsom_metrics:get_metric_value(Name)),
calc_gauge(GaugeVal)
catch ErrClass:ErrReason ->
log_error(Name, ErrClass, ErrReason),
unavailable
end;
calc_stat({Name, histogram}) ->
try
folsom_metrics:get_histogram_statistics(Name)
throw_folsom_error(folsom_metrics:get_histogram_statistics(Name))
catch ErrClass:ErrReason ->
log_error(Name, ErrClass, ErrReason),
unavailable
end;
calc_stat({Name, _Type}) ->
try folsom_metrics:get_metric_value(Name)
try throw_folsom_error(folsom_metrics:get_metric_value(Name))
catch ErrClass:ErrReason ->
log_error(Name, ErrClass, ErrReason),
unavailable
Expand Down
4 changes: 2 additions & 2 deletions src/riak_core_vnode.erl
Expand Up @@ -988,10 +988,10 @@ current_state(Pid) ->
gen_fsm:sync_send_all_state_event(Pid, current_state).

pool_death_test() ->
meck:new(test_vnode),
meck:new(test_vnode, [non_strict, no_link]),
meck:expect(test_vnode, init, fun(_) -> {ok, [], [{pool, test_pool_mod, 1, []}]} end),
meck:expect(test_vnode, terminate, fun(_, _) -> normal end),
meck:new(test_pool_mod),
meck:new(test_pool_mod, [non_strict, no_link]),
meck:expect(test_pool_mod, init_worker, fun(_, _, _) -> {ok, []} end),

{ok, Pid} = ?MODULE:test_link(test_vnode, 0),
Expand Down
2 changes: 1 addition & 1 deletion test/node_watcher_qc.erl
Expand Up @@ -55,7 +55,7 @@ prop_main() ->
riak_core_node_watcher_events:start_link(),

%% meck used for health watch / threshold
meck:new(mod_health),
meck:new(mod_health, [non_strict]),

?FORALL(Cmds, commands(?MODULE),
begin
Expand Down

0 comments on commit b557151

Please sign in to comment.