@Test public void testWithRealData() throws IOException { CapacityCheckerTester tester = new CapacityCheckerTester(); String path = "./src/test/resources/zookeeper_dump.json"; tester.populateNodeRepositoryFromJsonFile(Paths.get(path)); var failurePath = tester.capacityChecker.worstCaseHostLossLeadingToFailure(); assertTrue(failurePath.isPresent()); assertTrue(tester.nodeRepository.getNodes(NodeType.host).containsAll(failurePath.get().hostsCausingFailure)); assertEquals(5, failurePath.get().hostsCausingFailure.size()); }
public Optional<HostFailurePath> worstCaseHostLossLeadingToFailure() { Map<Node, Integer> timesNodeCanBeRemoved = computeMaximalRepeatedRemovals(); return greedyHeuristicFindFailurePath(timesNodeCanBeRemoved); }
CapacityChecker { public Optional<HostFailurePath> worstCaseHostLossLeadingToFailure() { Map<Node, Integer> timesNodeCanBeRemoved = computeMaximalRepeatedRemovals(); return greedyHeuristicFindFailurePath(timesNodeCanBeRemoved); } }
CapacityChecker { public Optional<HostFailurePath> worstCaseHostLossLeadingToFailure() { Map<Node, Integer> timesNodeCanBeRemoved = computeMaximalRepeatedRemovals(); return greedyHeuristicFindFailurePath(timesNodeCanBeRemoved); } CapacityChecker(NodeList allNodes); }
CapacityChecker { public Optional<HostFailurePath> worstCaseHostLossLeadingToFailure() { Map<Node, Integer> timesNodeCanBeRemoved = computeMaximalRepeatedRemovals(); return greedyHeuristicFindFailurePath(timesNodeCanBeRemoved); } CapacityChecker(NodeList allNodes); List<Node> getHosts(); Optional<HostFailurePath> worstCaseHostLossLeadingToFailure(); List<Node> nodesFromHostnames(List<String> hostnames); Optional<HostFailurePath> findHostRemovalFailure(List<Node> hostsToRemove); }
CapacityChecker { public Optional<HostFailurePath> worstCaseHostLossLeadingToFailure() { Map<Node, Integer> timesNodeCanBeRemoved = computeMaximalRepeatedRemovals(); return greedyHeuristicFindFailurePath(timesNodeCanBeRemoved); } CapacityChecker(NodeList allNodes); List<Node> getHosts(); Optional<HostFailurePath> worstCaseHostLossLeadingToFailure(); List<Node> nodesFromHostnames(List<String> hostnames); Optional<HostFailurePath> findHostRemovalFailure(List<Node> hostsToRemove); public AllocationHistory allocationHistory; }