@Test public void testAcceptSimpleNonReplicatedKeyspaceSingleDC() { mockKeyspace("user_keyspace", simpleStrategy(1), "table1"); assertThat(myReplicatedTableProviderImpl.accept("user_keyspace")).isFalse(); }
@Override public boolean accept(String keyspace) { if (keyspace.startsWith("system") && !SYSTEM_AUTH_KEYSPACE.equals(keyspace)) { return false; } KeyspaceMetadata keyspaceMetadata = myMetadata.getKeyspace(keyspace); if (keyspaceMetadata != null) { Map<String, String> replication = keyspaceMetadata.getReplication(); String replicationClass = replication.get(STRATEGY_CLASS); switch(replicationClass) { case SIMPLE_STRATEGY: return validateSimpleStrategy(replication); case NETWORK_TOPOLOGY_STRATEGY: return validateNetworkTopologyStrategy(keyspace, replication); default: LOG.warn("Replication strategy of type {} is not supported", replicationClass); break; } } return false; }
ReplicatedTableProviderImpl implements ReplicatedTableProvider { @Override public boolean accept(String keyspace) { if (keyspace.startsWith("system") && !SYSTEM_AUTH_KEYSPACE.equals(keyspace)) { return false; } KeyspaceMetadata keyspaceMetadata = myMetadata.getKeyspace(keyspace); if (keyspaceMetadata != null) { Map<String, String> replication = keyspaceMetadata.getReplication(); String replicationClass = replication.get(STRATEGY_CLASS); switch(replicationClass) { case SIMPLE_STRATEGY: return validateSimpleStrategy(replication); case NETWORK_TOPOLOGY_STRATEGY: return validateNetworkTopologyStrategy(keyspace, replication); default: LOG.warn("Replication strategy of type {} is not supported", replicationClass); break; } } return false; } }
ReplicatedTableProviderImpl implements ReplicatedTableProvider { @Override public boolean accept(String keyspace) { if (keyspace.startsWith("system") && !SYSTEM_AUTH_KEYSPACE.equals(keyspace)) { return false; } KeyspaceMetadata keyspaceMetadata = myMetadata.getKeyspace(keyspace); if (keyspaceMetadata != null) { Map<String, String> replication = keyspaceMetadata.getReplication(); String replicationClass = replication.get(STRATEGY_CLASS); switch(replicationClass) { case SIMPLE_STRATEGY: return validateSimpleStrategy(replication); case NETWORK_TOPOLOGY_STRATEGY: return validateNetworkTopologyStrategy(keyspace, replication); default: LOG.warn("Replication strategy of type {} is not supported", replicationClass); break; } } return false; } ReplicatedTableProviderImpl(Host host, Metadata metadata); }
ReplicatedTableProviderImpl implements ReplicatedTableProvider { @Override public boolean accept(String keyspace) { if (keyspace.startsWith("system") && !SYSTEM_AUTH_KEYSPACE.equals(keyspace)) { return false; } KeyspaceMetadata keyspaceMetadata = myMetadata.getKeyspace(keyspace); if (keyspaceMetadata != null) { Map<String, String> replication = keyspaceMetadata.getReplication(); String replicationClass = replication.get(STRATEGY_CLASS); switch(replicationClass) { case SIMPLE_STRATEGY: return validateSimpleStrategy(replication); case NETWORK_TOPOLOGY_STRATEGY: return validateNetworkTopologyStrategy(keyspace, replication); default: LOG.warn("Replication strategy of type {} is not supported", replicationClass); break; } } return false; } ReplicatedTableProviderImpl(Host host, Metadata metadata); @Override Set<TableReference> getAll(); @Override boolean accept(String keyspace); }
ReplicatedTableProviderImpl implements ReplicatedTableProvider { @Override public boolean accept(String keyspace) { if (keyspace.startsWith("system") && !SYSTEM_AUTH_KEYSPACE.equals(keyspace)) { return false; } KeyspaceMetadata keyspaceMetadata = myMetadata.getKeyspace(keyspace); if (keyspaceMetadata != null) { Map<String, String> replication = keyspaceMetadata.getReplication(); String replicationClass = replication.get(STRATEGY_CLASS); switch(replicationClass) { case SIMPLE_STRATEGY: return validateSimpleStrategy(replication); case NETWORK_TOPOLOGY_STRATEGY: return validateNetworkTopologyStrategy(keyspace, replication); default: LOG.warn("Replication strategy of type {} is not supported", replicationClass); break; } } return false; } ReplicatedTableProviderImpl(Host host, Metadata metadata); @Override Set<TableReference> getAll(); @Override boolean accept(String keyspace);  }