Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B6DE11C3D for ; Thu, 28 Aug 2014 12:22:22 +0000 (UTC) Received: (qmail 40080 invoked by uid 500); 28 Aug 2014 12:22:22 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 39975 invoked by uid 500); 28 Aug 2014 12:22:21 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 39923 invoked by uid 99); 28 Aug 2014 12:22:21 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Aug 2014 12:22:21 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A1B10A02DA1; Thu, 28 Aug 2014 12:22:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Date: Thu, 28 Aug 2014 12:22:22 -0000 Message-Id: In-Reply-To: <29bb38a445e2454d9b33ebc655e7f389@git.apache.org> References: <29bb38a445e2454d9b33ebc655e7f389@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/50] mem3 commit: updated refs/heads/master to 64c0c74 Add doc shard info endpoint Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/d4e7748f Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/d4e7748f Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/d4e7748f Branch: refs/heads/master Commit: d4e7748f096a2ff3bcbf8a00adc0f6bf805d4b7e Parents: 51e436f Author: Russell Branca Authored: Fri Apr 12 15:06:58 2013 -0400 Committer: Robert Newson Committed: Wed Jul 23 18:12:00 2014 +0100 ---------------------------------------------------------------------- src/mem3_httpd.erl | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/d4e7748f/src/mem3_httpd.erl ---------------------------------------------------------------------- diff --git a/src/mem3_httpd.erl b/src/mem3_httpd.erl index f182f7f..dc42924 100644 --- a/src/mem3_httpd.erl +++ b/src/mem3_httpd.erl @@ -37,6 +37,14 @@ handle_membership_req(#httpd{method='GET', {all_nodes, lists:sort([node()|nodes()])}, {cluster_nodes, lists:sort(ClusterNodes)}, {partitions, JsonShards} + ]}); +handle_membership_req(#httpd{method='GET', + path_parts=[<<"_membership">>, DbName, DocId]} = Req) -> + Shards = mem3:shards(DbName, DocId), + {[{Shard, Dbs}]} = json_shards(Shards, dict:new()), + couch_httpd:send_json(Req, {[ + {range, Shard}, + {nodes, Dbs} ]}). %%