@Test public void testGetAllSingleDCNoSystemOnlyKeyspaces() { Map<String, String> replication = networkTopologyStrategy(); replication.put("DC1", "3"); mockKeyspace("system_auth", replication, "roles", "role_members", "role_permissions"); mockKeyspace("system_distributed", replication, "parent_repair_history", "repair_history"); mockKeyspace("user_keyspace", replication, "table1", "table2"); TableReference[] expectedTableReferences = new TableReference[] { new TableReference("system_auth", "roles"), new TableReference("system_auth", "role_members"), new TableReference("system_auth", "role_permissions"), new TableReference("user_keyspace", "table1"), new TableReference("user_keyspace", "table2") }; assertThat(myReplicatedTableProviderImpl.getAll()).containsExactlyInAnyOrder(expectedTableReferences); }
@Override public Set<TableReference> getAll() { return myMetadata.getKeyspaces().stream() .filter(k -> accept(k.getName())) .flatMap(k -> k.getTables().stream()) .map(tb -> new TableReference(tb.getKeyspace().getName(), tb.getName())) .collect(Collectors.toSet()); }
ReplicatedTableProviderImpl implements ReplicatedTableProvider { @Override public Set<TableReference> getAll() { return myMetadata.getKeyspaces().stream() .filter(k -> accept(k.getName())) .flatMap(k -> k.getTables().stream()) .map(tb -> new TableReference(tb.getKeyspace().getName(), tb.getName())) .collect(Collectors.toSet()); } }
ReplicatedTableProviderImpl implements ReplicatedTableProvider { @Override public Set<TableReference> getAll() { return myMetadata.getKeyspaces().stream() .filter(k -> accept(k.getName())) .flatMap(k -> k.getTables().stream()) .map(tb -> new TableReference(tb.getKeyspace().getName(), tb.getName())) .collect(Collectors.toSet()); } ReplicatedTableProviderImpl(Host host, Metadata metadata); }
ReplicatedTableProviderImpl implements ReplicatedTableProvider { @Override public Set<TableReference> getAll() { return myMetadata.getKeyspaces().stream() .filter(k -> accept(k.getName())) .flatMap(k -> k.getTables().stream()) .map(tb -> new TableReference(tb.getKeyspace().getName(), tb.getName())) .collect(Collectors.toSet()); } ReplicatedTableProviderImpl(Host host, Metadata metadata); @Override Set<TableReference> getAll(); @Override boolean accept(String keyspace); }
ReplicatedTableProviderImpl implements ReplicatedTableProvider { @Override public Set<TableReference> getAll() { return myMetadata.getKeyspaces().stream() .filter(k -> accept(k.getName())) .flatMap(k -> k.getTables().stream()) .map(tb -> new TableReference(tb.getKeyspace().getName(), tb.getName())) .collect(Collectors.toSet()); } ReplicatedTableProviderImpl(Host host, Metadata metadata); @Override Set<TableReference> getAll(); @Override boolean accept(String keyspace);  }