@Test public void delegates_to_host_provisioner_and_writes_back_result() { var tester = new DynamicProvisioningTester().addInitialNodes(); tester.hostProvisioner.with(Behaviour.failDeprovisioning); Node host3 = tester.nodeRepository.getNode("host3").orElseThrow(); Node host4 = tester.nodeRepository.getNode("host4").orElseThrow(); Node host41 = tester.nodeRepository.getNode("host4-1").orElseThrow(); assertTrue("No IP addresses assigned", Stream.of(host3, host4, host41).map(node -> node.ipConfig().primary()).allMatch(Set::isEmpty)); Node host3new = host3.with(host3.ipConfig().with(Set.of("::3:0"))); Node host4new = host4.with(host4.ipConfig().with(Set.of("::4:0"))); Node host41new = host41.with(host41.ipConfig().with(Set.of("::4:1", "::4:2"))); tester.maintainer.maintain(); assertEquals(host3new, tester.nodeRepository.getNode("host3").get()); assertEquals(host4new, tester.nodeRepository.getNode("host4").get()); assertEquals(host41new, tester.nodeRepository.getNode("host4-1").get()); }
@Override protected boolean maintain() { try (Mutex lock = nodeRepository().lockUnallocated()) { NodeList nodes = nodeRepository().list(); resumeProvisioning(nodes, lock); convergeToCapacity(nodes); } return true; }
DynamicProvisioningMaintainer extends NodeRepositoryMaintainer { @Override protected boolean maintain() { try (Mutex lock = nodeRepository().lockUnallocated()) { NodeList nodes = nodeRepository().list(); resumeProvisioning(nodes, lock); convergeToCapacity(nodes); } return true; } }
DynamicProvisioningMaintainer extends NodeRepositoryMaintainer { @Override protected boolean maintain() { try (Mutex lock = nodeRepository().lockUnallocated()) { NodeList nodes = nodeRepository().list(); resumeProvisioning(nodes, lock); convergeToCapacity(nodes); } return true; } DynamicProvisioningMaintainer(NodeRepository nodeRepository,
                                  Duration interval,
                                  HostProvisioner hostProvisioner,
                                  FlagSource flagSource,
                                  Metric metric); }
DynamicProvisioningMaintainer extends NodeRepositoryMaintainer { @Override protected boolean maintain() { try (Mutex lock = nodeRepository().lockUnallocated()) { NodeList nodes = nodeRepository().list(); resumeProvisioning(nodes, lock); convergeToCapacity(nodes); } return true; } DynamicProvisioningMaintainer(NodeRepository nodeRepository,
                                  Duration interval,
                                  HostProvisioner hostProvisioner,
                                  FlagSource flagSource,
                                  Metric metric);  }
DynamicProvisioningMaintainer extends NodeRepositoryMaintainer { @Override protected boolean maintain() { try (Mutex lock = nodeRepository().lockUnallocated()) { NodeList nodes = nodeRepository().list(); resumeProvisioning(nodes, lock); convergeToCapacity(nodes); } return true; } DynamicProvisioningMaintainer(NodeRepository nodeRepository,
                                  Duration interval,
                                  HostProvisioner hostProvisioner,
                                  FlagSource flagSource,
                                  Metric metric);   }