@Test public void group_node_down_edge_implicitly_marks_down_rest_of_nodes_in_group() { GroupAvailabilityCalculator calc = calcForHierarchicCluster( DistributionBuilder.withGroups(3).eachWithNodeCount(2), 0.51); assertThat(calc.nodesThatShouldBeDown(clusterState( "distributor:6 storage:6 .4.s:d")), equalTo(indices(5))); }
public Set<Integer> nodesThatShouldBeDown(ClusterState state) { if (distribution == null) { return Collections.emptySet(); } if (isFlatCluster(distribution.getRootGroup())) { return new HashSet<>(); } InsufficientAvailabilityGroupVisitor visitor = new InsufficientAvailabilityGroupVisitor(state); distribution.visitGroups(visitor); return visitor.implicitlyDownNodeIndices(); }
GroupAvailabilityCalculator { public Set<Integer> nodesThatShouldBeDown(ClusterState state) { if (distribution == null) { return Collections.emptySet(); } if (isFlatCluster(distribution.getRootGroup())) { return new HashSet<>(); } InsufficientAvailabilityGroupVisitor visitor = new InsufficientAvailabilityGroupVisitor(state); distribution.visitGroups(visitor); return visitor.implicitlyDownNodeIndices(); } }
GroupAvailabilityCalculator { public Set<Integer> nodesThatShouldBeDown(ClusterState state) { if (distribution == null) { return Collections.emptySet(); } if (isFlatCluster(distribution.getRootGroup())) { return new HashSet<>(); } InsufficientAvailabilityGroupVisitor visitor = new InsufficientAvailabilityGroupVisitor(state); distribution.visitGroups(visitor); return visitor.implicitlyDownNodeIndices(); } private  GroupAvailabilityCalculator(Distribution distribution,
                                        double minNodeRatioPerGroup); }
GroupAvailabilityCalculator { public Set<Integer> nodesThatShouldBeDown(ClusterState state) { if (distribution == null) { return Collections.emptySet(); } if (isFlatCluster(distribution.getRootGroup())) { return new HashSet<>(); } InsufficientAvailabilityGroupVisitor visitor = new InsufficientAvailabilityGroupVisitor(state); distribution.visitGroups(visitor); return visitor.implicitlyDownNodeIndices(); } private  GroupAvailabilityCalculator(Distribution distribution,
                                        double minNodeRatioPerGroup); static Builder builder(); Set<Integer> nodesThatShouldBeDown(ClusterState state); }
GroupAvailabilityCalculator { public Set<Integer> nodesThatShouldBeDown(ClusterState state) { if (distribution == null) { return Collections.emptySet(); } if (isFlatCluster(distribution.getRootGroup())) { return new HashSet<>(); } InsufficientAvailabilityGroupVisitor visitor = new InsufficientAvailabilityGroupVisitor(state); distribution.visitGroups(visitor); return visitor.implicitlyDownNodeIndices(); } private  GroupAvailabilityCalculator(Distribution distribution,
                                        double minNodeRatioPerGroup); static Builder builder(); Set<Integer> nodesThatShouldBeDown(ClusterState state);  }