Permalink
Browse files

replace tabs with spaces bz://124

  • Loading branch information...
1 parent 12d1ba8 commit 34208ddb05a602b62ffb9636556278771d6c93d3 Bryan Fink committed Jul 26, 2010
Showing with 39 additions and 39 deletions.
  1. +18 −18 priv/mapred_builtins.js
  2. +3 −3 src/riak.erl
  3. +1 −1 src/riak_kv_ets_backend.erl
  4. +2 −2 src/riak_kv_util.erl
  5. +15 −15 src/riak_object.erl
View
@@ -17,34 +17,34 @@ var Riak = function() {
if (obj && obj.constructor && obj.constructor.toString) {
var arr = obj.constructor.toString().match(/function\s*(\w+)/);
if (arr && arr.length == 2) {
- return arr[1];
+ return arr[1];
}
}
return undefined;
},
filterNotFound: function(values) {
return values.filter(function(value, index, data) {
- if (typeof value === 'object') {
- return value['not_found'] === undefined;
- }
- else {
- return true;
- } });
+ if (typeof value === 'object') {
+ return value['not_found'] === undefined;
+ }
+ else {
+ return true;
+ } });
},
mapValues: function(value, keyData, arg) {
if (value["not_found"]) {
- return [value];
+ return [value];
}
var data = value["values"][0]["data"];
if (Riak.getClassName(data) !== "Array") {
- return [data];
+ return [data];
}
else {
- return data;
+ return data;
}},
mapValuesJson: function(value, keyData, arg) {
if (value["not_found"]) {
- return [value];
+ return [value];
}
var newValues = Riak.mapValues(value, keyData, arg);
return newValues.map(function(nv) { return JSON.parse(nv); });
@@ -66,10 +66,10 @@ var Riak = function() {
reduceSum: function(values, arg) {
values = Riak.filterNotFound(values);
if (values.length > 0) {
- return [values.reduce(function(prev, curr, index, array) { return prev + curr; } )];
+ return [values.reduce(function(prev, curr, index, array) { return prev + curr; } )];
}
else {
- return [0];
+ return [0];
}},
reduceMin: function(values, arg) {
values.sort();
@@ -81,11 +81,11 @@ var Riak = function() {
},
reduceSort: function(value, arg) {
try {
- var c = eval(arg);
- return value.sort(c);
+ var c = eval(arg);
+ return value.sort(c);
}
catch (e) {
- return value.sort();
+ return value.sort();
}
},
reduceNumericSort: function(value, arg) {
@@ -99,10 +99,10 @@ var Riak = function() {
var start = arg[0];
var end = arg[1];
if (end > value.length) {
- return value;
+ return value;
}
else {
- return value.slice(start, end);
+ return value.slice(start, end);
}
}
};
View
@@ -60,11 +60,11 @@ get_app_env(Opt) -> get_app_env(Opt, undefined).
%% Will return Default if that option is unset.
get_app_env(Opt, Default) ->
case application:get_env(riak, Opt) of
- {ok, Val} -> Val;
+ {ok, Val} -> Val;
_ ->
case init:get_argument(Opt) of
- {ok, [[Val | _]]} -> Val;
- error -> Default
+ {ok, [[Val | _]]} -> Val;
+ error -> Default
end
end.
@@ -32,7 +32,7 @@
is_empty/1, drop/1, fold/3, callback/3]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
- terminate/2, code_change/3]).
+ terminate/2, code_change/3]).
% @type state() = term().
-record(state, {t}).
View
@@ -61,8 +61,8 @@ is_x_deleted(Obj) ->
obj_not_deleted(Obj) ->
case [{M, V} || {M, V} <- riak_object:get_contents(Obj),
dict:is_key(<<"X-Riak-Deleted">>, M) =:= false] of
- [] -> undefined;
- _ -> Obj
+ [] -> undefined;
+ _ -> Obj
end.
%% @spec try_cast(term(), term(), [node()], [{Index :: term(), Node :: node()}]) ->
View
@@ -139,8 +139,8 @@ reconcile(Objects, AllowMultiple) ->
Contents = case AllowMultiple of
false ->
[hd(lists:sort(fun compare_content_dates/2, AllContents))];
- true ->
- AllContents
+ true ->
+ AllContents
end,
VClock = vclock:merge([O#r_object.vclock || O <- RObjs]),
HdObj = hd(RObjs),
@@ -158,7 +158,7 @@ ancestors(Objects) ->
ToRemove = [[O2 || O2 <- Objects,
vclock:descends(O1#r_object.vclock,O2#r_object.vclock),
(vclock:descends(O2#r_object.vclock,O1#r_object.vclock) == false)]
- || O1 <- Objects],
+ || O1 <- Objects],
lists:flatten(ToRemove).
%% @spec reconcile([riak_object()]) -> [riak_object()]
@@ -189,21 +189,21 @@ merge(OldObject, NewObject) ->
NewObj1 = apply_updates(NewObject),
OldObject#r_object{contents= NewObj1#r_object.contents ++
OldObject#r_object.contents,
- vclock=vclock:merge([OldObject#r_object.vclock,
- NewObj1#r_object.vclock]),
- updatemetadata=dict:store(clean, true, dict:new()),
- updatevalue=undefined}.
+ vclock=vclock:merge([OldObject#r_object.vclock,
+ NewObj1#r_object.vclock]),
+ updatemetadata=dict:store(clean, true, dict:new()),
+ updatevalue=undefined}.
%% @spec apply_updates(riak_object()) -> riak_object()
%% @doc Promote pending updates (made with the update_value() and
%% update_metadata() calls) to this riak_object.
apply_updates(Object=#r_object{}) ->
VL = case Object#r_object.updatevalue of
- undefined ->
- [C#r_content.value || C <- Object#r_object.contents];
- _ ->
- [Object#r_object.updatevalue]
- end,
+ undefined ->
+ [C#r_content.value || C <- Object#r_object.contents];
+ _ ->
+ [Object#r_object.updatevalue]
+ end,
MD = case dict:find(clean, Object#r_object.updatemetadata) of
{ok,_} ->
MDs = [C#r_content.metadata || C <- Object#r_object.contents],
@@ -212,8 +212,8 @@ apply_updates(Object=#r_object{}) ->
_ -> [hd(MDs)]
end;
error ->
- [dict:erase(clean,Object#r_object.updatemetadata) || _X <- VL]
- end,
+ [dict:erase(clean,Object#r_object.updatemetadata) || _X <- VL]
+ end,
Contents = [#r_content{metadata=M,value=V} || {M,V} <- lists:zip(MD, VL)],
Object#r_object{contents=Contents,
updatemetadata=dict:store(clean, true, dict:new()),
@@ -411,7 +411,7 @@ syntactic_merge(CurrentObject, NewObject, FromClientId) ->
true -> increment_vclock(apply_updates(WinObject),FromClientId);
false -> WinObject
end;
- [] ->
+ [] ->
case riak_object:equal(CurrentObject, NewObject) of
true ->
NewObject;

0 comments on commit 34208dd

Please sign in to comment.