On 07/21/2013 02:42 PM, Siraaj Khandkar wrote:
On 07/21/2013 02:20 PM, Siraaj Khandkar wrote:
On 07/21/2013 07:24 AM, Russell Brown wrote:> Hi,
>
> On 21 Jul 2013, at 02:09, Siraaj Khandkar <[email protected]> wrote:
<snipped>
This is how I am testing it:
Compare = fun(PID, Bucket) ->
B = Bucket,
L1 = riakc_pb_socket:get_index(PID, B, {binary_index,
"bucket"}, B),
L2 = riakc_pb_socket:get_index(PID, B, {binary_index,
"bucket"}, B),
Err. Copy-n-paste error. This should, of course, be:
I = "bucket",
{ok, {keys, L1}}=riakc_pb_socket:get_index(PID, B, {binary_index, I}, B)
{ok, {keys, L2}}=riakc_pb_socket:get_index(PID, B, {binary_index, I}, B)
In the real code I'm actually calling a wrapper function that matches on
{ok, {keys, Keys}}.
io:format("L1: ~b, L2: ~b~n",[length(L1), length(L2)]),
Diff_L1_L2 = L1 -- L2,
Diff_L2_L1 = L2 -- L1,
io:format("=== L1 -- L2 ===~n~p~n~n", [Diff_L1_L2]),
io:format("=== L2 -- L1 ===~n~p~n~n", [Diff_L2_L1]),
Fetch = fun(Key) ->
case riakc_pb_socket:get(PID, B, Key) of
{ok, _} -> io:format("FOUND: ~p~n", [Key]);
{error, _} -> io:format("NOT FOUND: ~p~n", [Key])
end
end,
io:format("=== L1 -- L2 ===~n"),
lists:foreach(Fetch, Diff_L1_L2),
io:format("=== L2 -- L1 ===~n"),
lists:foreach(Fetch, Diff_L2_L1)
end.=
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com