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 6A51D18776 for ; Fri, 11 Dec 2015 09:31:32 +0000 (UTC) Received: (qmail 15629 invoked by uid 500); 11 Dec 2015 09:31:32 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 15552 invoked by uid 500); 11 Dec 2015 09:31:32 -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 15538 invoked by uid 99); 11 Dec 2015 09:31:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2015 09:31:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D4051E0449; Fri, 11 Dec 2015 09:31:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: slebresne@apache.org To: commits@cassandra.apache.org Date: Fri, 11 Dec 2015 09:31:31 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] cassandra git commit: Warn if system_traces not available for CASSANDRA-9628 Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 4f3e47bf9 -> b4d3ac40b Warn if system_traces not available for CASSANDRA-9628 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9135340a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9135340a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9135340a Branch: refs/heads/cassandra-2.2 Commit: 9135340a13531930f26fb8175b057342791ff044 Parents: f6deca3 Author: Carl Yeksigian Authored: Thu Oct 8 12:13:28 2015 -0400 Committer: Sylvain Lebresne Committed: Fri Dec 11 10:23:14 2015 +0100 ---------------------------------------------------------------------- .../cassandra/service/StorageService.java | 40 +++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/9135340a/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index 0d9e9ef..0698d11 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -4004,28 +4004,32 @@ public class StorageService extends NotificationBroadcasterSupport implements IE if (keyspace != null) { - Keyspace keyspaceInstance = Schema.instance.getKeyspaceInstance(keyspace); - if(keyspaceInstance == null) - throw new IllegalArgumentException("The keyspace " + keyspace + ", does not exist"); + Keyspace keyspaceInstance = Schema.instance.getKeyspaceInstance(keyspace); + if(keyspaceInstance == null) + throw new IllegalArgumentException("The keyspace " + keyspace + ", does not exist"); - if(keyspaceInstance.getReplicationStrategy() instanceof LocalStrategy) - throw new IllegalStateException("Ownership values for keyspaces with LocalStrategy are meaningless"); + if(keyspaceInstance.getReplicationStrategy() instanceof LocalStrategy) + throw new IllegalStateException("Ownership values for keyspaces with LocalStrategy are meaningless"); } else { - List nonSystemKeyspaces = Schema.instance.getNonSystemKeyspaces(); - - //system_traces is a non-system keyspace however it needs to be counted as one for this process - int specialTableCount = 0; - if (nonSystemKeyspaces.contains("system_traces")) - { - specialTableCount += 1; - } - if (nonSystemKeyspaces.size() > specialTableCount) - throw new IllegalStateException("Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless"); - - keyspace = "system_traces"; - } + List nonSystemKeyspaces = Schema.instance.getNonSystemKeyspaces(); + + //system_traces is a non-system keyspace however it needs to be counted as one for this process + int specialTableCount = 0; + if (nonSystemKeyspaces.contains("system_traces")) + { + specialTableCount += 1; + } + if (nonSystemKeyspaces.size() > specialTableCount) + throw new IllegalStateException("Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless"); + + keyspace = "system_traces"; + + Keyspace keyspaceInstance = Schema.instance.getKeyspaceInstance(keyspace); + if(keyspaceInstance == null) + throw new IllegalArgumentException("The node does not have " + keyspace + " yet, probably still bootstrapping"); + } TokenMetadata metadata = tokenMetadata.cloneOnlyTokenMap();