couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [02/48] mem3 commit: updated refs/heads/windsor-merge to ff02b9a
Date Fri, 01 Aug 2014 09:10:48 GMT
Fix _membership/$DBNAME api endpoint

This switches the JSON key to be a binary, as required by jiffy.

Also, remove extraneous <<"parts">> path from the url.

Show full shard range.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/51e436f9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/51e436f9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/51e436f9

Branch: refs/heads/windsor-merge
Commit: 51e436f9f578f00cba6b8087c3266346a802f267
Parents: 7fa726f
Author: Russell Branca <chewbranca@gmail.com>
Authored: Thu Apr 11 14:18:12 2013 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Wed Jul 23 18:11:47 2014 +0100

----------------------------------------------------------------------
 src/mem3_httpd.erl | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/51e436f9/src/mem3_httpd.erl
----------------------------------------------------------------------
diff --git a/src/mem3_httpd.erl b/src/mem3_httpd.erl
index 94196fa..f182f7f 100644
--- a/src/mem3_httpd.erl
+++ b/src/mem3_httpd.erl
@@ -28,7 +28,7 @@ handle_membership_req(#httpd{method='GET',
         {cluster_nodes, lists:sort(ClusterNodes)}
     ]});
 handle_membership_req(#httpd{method='GET',
-        path_parts=[<<"_membership">>, <<"parts">>, DbName]} = Req)
->
+        path_parts=[<<"_membership">>, DbName]} = Req) ->
     ClusterNodes = try mem3:nodes()
     catch _:_ -> {ok,[]} end,
     Shards = mem3:shards(DbName),
@@ -46,6 +46,8 @@ handle_membership_req(#httpd{method='GET',
 json_shards([], AccIn) ->
     List = dict:to_list(AccIn),
     {lists:sort(List)};
-json_shards([#shard{node=Node, range=[B,_E]} | Rest], AccIn) ->
+json_shards([#shard{node=Node, range=[B,E]} | Rest], AccIn) ->
     HexBeg = couch_util:to_hex(<<B:32/integer>>),
-    json_shards(Rest, dict:append(HexBeg, Node, AccIn)).
+    HexEnd = couch_util:to_hex(<<E:32/integer>>),
+    Range = list_to_binary(HexBeg ++ "-" ++ HexEnd),
+    json_shards(Rest, dict:append(Range, Node, AccIn)).


Mime
View raw message