Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-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 ED8E411F8B for ; Tue, 22 Apr 2014 05:47:40 +0000 (UTC) Received: (qmail 40831 invoked by uid 500); 22 Apr 2014 05:47:40 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 40608 invoked by uid 500); 22 Apr 2014 05:47:39 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 40600 invoked by uid 99); 22 Apr 2014 05:47:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2014 05:47:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0A135839566; Tue, 22 Apr 2014 05:47:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dbrosius@apache.org To: commits@cassandra.apache.org Message-Id: <136814c3703c4905b44fd39b6253baa6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Nodetool rebuild_index requires named indexes argument Date: Tue, 22 Apr 2014 05:47:38 +0000 (UTC) Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 2b89cf6a8 -> 743d921ae Nodetool rebuild_index requires named indexes argument patch by Stunnicliffe reviewed by dbrosius for cassandra-7038 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/743d921a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/743d921a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/743d921a Branch: refs/heads/cassandra-2.1 Commit: 743d921ae8591545ff01022db9a41a84ef1edcd1 Parents: 2b89cf6 Author: Sam Tunnicliffe Authored: Tue Apr 22 01:46:31 2014 -0400 Committer: Dave Brosius Committed: Tue Apr 22 01:46:31 2014 -0400 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/tools/NodeTool.java | 15 ++++----------- 2 files changed, 5 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/743d921a/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 5d15eac..d94f13b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -46,6 +46,7 @@ * Fix AE when closing SSTable without releasing reference (CASSANDRA-7000) * Clean up IndexInfo on keyspace/table drops (CASSANDRA-6924) * Only snapshot relative SSTables when sequential repair (CASSANDRA-7024) + * Require nodetool rebuild_index to specify index names (CASSANDRA-7038) Merged from 2.0: * Put nodes in hibernate when join_ring is false (CASSANDRA-6961) * Allow compaction of system tables during startup (CASSANDRA-6913) http://git-wip-us.apache.org/repos/asf/cassandra/blob/743d921a/src/java/org/apache/cassandra/tools/NodeTool.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java index edcfec3..2c8d0c2 100644 --- a/src/java/org/apache/cassandra/tools/NodeTool.java +++ b/src/java/org/apache/cassandra/tools/NodeTool.java @@ -2130,24 +2130,17 @@ public class NodeTool } } - @Command(name = "rebuild_index", description = "A full rebuilds of native secondry index for a given column family") + @Command(name = "rebuild_index", description = "A full rebuild of native secondary indexes for a given column family") public static class RebuildIndex extends NodeToolCmd { - @Arguments(usage = " []", description = "The keyspace and column family name followed by an optional list of index names (IndexNameExample: Standard3.IdxName Standard3.IdxName1)") + @Arguments(usage = " ", description = "The keyspace and column family name followed by a list of index names (IndexNameExample: Standard3.IdxName Standard3.IdxName1)") List args = new ArrayList<>(); @Override public void execute(NodeProbe probe) { - checkArgument(args.size() >= 2, "rebuild_index requires ks and cf args"); - - List indexNames = new ArrayList<>(); - if (args.size() > 2) - { - indexNames.addAll(args.subList(2, args.size())); - } - - probe.rebuildIndex(args.get(0), args.get(1), toArray(indexNames, String.class)); + checkArgument(args.size() >= 3, "rebuild_index requires ks, cf and idx args"); + probe.rebuildIndex(args.get(0), args.get(1), toArray(args.subList(2, args.size()), String.class)); } }