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 2A14911C52 for ; Thu, 28 Aug 2014 12:22:29 +0000 (UTC) Received: (qmail 41704 invoked by uid 500); 28 Aug 2014 12:22:22 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 41179 invoked by uid 500); 28 Aug 2014 12:22:22 -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 40673 invoked by uid 99); 28 Aug 2014 12:22:22 -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:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id F0AE7A02DC5; 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:38 -0000 Message-Id: <06978708ce804cef91b6e98219179be9@git.apache.org> In-Reply-To: <29bb38a445e2454d9b33ebc655e7f389@git.apache.org> References: <29bb38a445e2454d9b33ebc655e7f389@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [18/50] mem3 commit: updated refs/heads/master to 64c0c74 Use a consistent commenting syntax Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/a29e6b75 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/a29e6b75 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/a29e6b75 Branch: refs/heads/master Commit: a29e6b7556862f82ce416f93ac5cf847f36a276e Parents: 94fc763 Author: Adam Kocoloski Authored: Mon Aug 19 09:43:08 2013 -0400 Committer: Robert Newson Committed: Wed Jul 23 18:46:26 2014 +0100 ---------------------------------------------------------------------- src/mem3_rebalance.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/a29e6b75/src/mem3_rebalance.erl ---------------------------------------------------------------------- diff --git a/src/mem3_rebalance.erl b/src/mem3_rebalance.erl index 08605be..123bf47 100644 --- a/src/mem3_rebalance.erl +++ b/src/mem3_rebalance.erl @@ -23,11 +23,11 @@ rebalance(DbName) -> rebalance(DbName, TargetNodes) when is_binary(DbName) -> rebalance(mem3:shards(DbName), TargetNodes); rebalance(Shards, TargetNodes) when is_list(Shards) -> - %% first migrate shards off of non-target nodes + % First migrate all shards off of non-target nodes {OK, MoveThese} = lists:partition(fun(#shard{node=Node}) -> lists:member(Node, TargetNodes) end, Shards), - % ensure every target node is present in the orddict + % Ensure every target node is present in the orddict ShardsByTargetNode0 = orddict:from_list([{N,[]} || N <- TargetNodes]), ShardsByTargetNode = lists:foldl(fun(Shard, Acc) -> orddict:append(Shard#shard.node, Shard, Acc)