mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-3.0' into trunk
This commit is contained in:
commit
4d6fdaae90
|
|
@ -4071,28 +4071,32 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
|
||||||
|
|
||||||
if (keyspace != null)
|
if (keyspace != null)
|
||||||
{
|
{
|
||||||
Keyspace keyspaceInstance = Schema.instance.getKeyspaceInstance(keyspace);
|
Keyspace keyspaceInstance = Schema.instance.getKeyspaceInstance(keyspace);
|
||||||
if(keyspaceInstance == null)
|
if(keyspaceInstance == null)
|
||||||
throw new IllegalArgumentException("The keyspace " + keyspace + ", does not exist");
|
throw new IllegalArgumentException("The keyspace " + keyspace + ", does not exist");
|
||||||
|
|
||||||
if(keyspaceInstance.getReplicationStrategy() instanceof LocalStrategy)
|
if(keyspaceInstance.getReplicationStrategy() instanceof LocalStrategy)
|
||||||
throw new IllegalStateException("Ownership values for keyspaces with LocalStrategy are meaningless");
|
throw new IllegalStateException("Ownership values for keyspaces with LocalStrategy are meaningless");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<String> nonSystemKeyspaces = Schema.instance.getNonSystemKeyspaces();
|
List<String> nonSystemKeyspaces = Schema.instance.getNonSystemKeyspaces();
|
||||||
|
|
||||||
//system_traces is a non-system keyspace however it needs to be counted as one for this process
|
//system_traces is a non-system keyspace however it needs to be counted as one for this process
|
||||||
int specialTableCount = 0;
|
int specialTableCount = 0;
|
||||||
if (nonSystemKeyspaces.contains("system_traces"))
|
if (nonSystemKeyspaces.contains("system_traces"))
|
||||||
{
|
{
|
||||||
specialTableCount += 1;
|
specialTableCount += 1;
|
||||||
}
|
}
|
||||||
if (nonSystemKeyspaces.size() > specialTableCount)
|
if (nonSystemKeyspaces.size() > specialTableCount)
|
||||||
throw new IllegalStateException("Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless");
|
throw new IllegalStateException("Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless");
|
||||||
|
|
||||||
keyspace = "system_traces";
|
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();
|
TokenMetadata metadata = tokenMetadata.cloneOnlyTokenMap();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue