@Test public void rings() { assertEquals(ImmutableSet.of("ring1", "ring2", "ring3"), ZergHosts.from(HOSTS).rings()); }
public ImmutableSet<String> rings() { ImmutableSet.Builder<String> rings = ImmutableSet.builder(); for (ZergHost host : hosts) { for (String role : Iterables.filter(host.getRoles(), startsWith(CASSANDRA_RING_ROLE_PREFIX))) { rings.add(role.substring(CASSANDRA_RING_ROLE_PREFIX.length())); } } return rings.build(); }
ZergHosts { public ImmutableSet<String> rings() { ImmutableSet.Builder<String> rings = ImmutableSet.builder(); for (ZergHost host : hosts) { for (String role : Iterables.filter(host.getRoles(), startsWith(CASSANDRA_RING_ROLE_PREFIX))) { rings.add(role.substring(CASSANDRA_RING_ROLE_PREFIX.length())); } } return rings.build(); } }
ZergHosts { public ImmutableSet<String> rings() { ImmutableSet.Builder<String> rings = ImmutableSet.builder(); for (ZergHost host : hosts) { for (String role : Iterables.filter(host.getRoles(), startsWith(CASSANDRA_RING_ROLE_PREFIX))) { rings.add(role.substring(CASSANDRA_RING_ROLE_PREFIX.length())); } } return rings.build(); } private  ZergHosts(ImmutableSet<ZergHost> hosts); }
ZergHosts { public ImmutableSet<String> rings() { ImmutableSet.Builder<String> rings = ImmutableSet.builder(); for (ZergHost host : hosts) { for (String role : Iterables.filter(host.getRoles(), startsWith(CASSANDRA_RING_ROLE_PREFIX))) { rings.add(role.substring(CASSANDRA_RING_ROLE_PREFIX.length())); } } return rings.build(); } private  ZergHosts(ImmutableSet<ZergHost> hosts); static ZergHosts from(Collection<ZergHost> hosts); static @Nullable CassandraInstance toCassandraInstance(ZergHost host); ImmutableSet<String> rings(); ZergHosts filterRing(final String ring); ZergHosts filterRegion(final String region); ZergHosts filterScope(Map<String, String> ringScopes, String region, String ring); ImmutableSet<ZergHost> toSet(); ImmutableSet<CassandraInstance> toCassandraInstances(); }
ZergHosts { public ImmutableSet<String> rings() { ImmutableSet.Builder<String> rings = ImmutableSet.builder(); for (ZergHost host : hosts) { for (String role : Iterables.filter(host.getRoles(), startsWith(CASSANDRA_RING_ROLE_PREFIX))) { rings.add(role.substring(CASSANDRA_RING_ROLE_PREFIX.length())); } } return rings.build(); } private  ZergHosts(ImmutableSet<ZergHost> hosts); static ZergHosts from(Collection<ZergHost> hosts); static @Nullable CassandraInstance toCassandraInstance(ZergHost host); ImmutableSet<String> rings(); ZergHosts filterRing(final String ring); ZergHosts filterRegion(final String region); ZergHosts filterScope(Map<String, String> ringScopes, String region, String ring); ImmutableSet<ZergHost> toSet(); ImmutableSet<CassandraInstance> toCassandraInstances();  }