String fullDeps = newHCatDependency1 + CoordELFunctions.INSTANCE_SEPARATOR + newHCatDependency2;
String actionId = addInitRecords(fullDeps);
checkCoordAction(actionId, fullDeps, CoordinatorAction.Status.WAITING);
PartitionDependencyManagerService pdms = Services.get().get(PartitionDependencyManagerService.class);
pdms.addMissingDependency(hcatUri1, actionId);
pdms.addMissingDependency(hcatUri2, actionId);
pdms.partitionAvailable("hcat.server.com:5080", "mydb", "clicks",
getPartitionMap("src=search;datastamp=12;region=us"));
Collection<String> availableURIs = pdms.getAvailableDependencyURIs(actionId);
assertEquals(1, availableURIs.size());
assertTrue(availableURIs.contains(newHCatDependency2));
new CoordActionUpdatePushMissingDependency(actionId).call();
checkCoordAction(actionId, newHCatDependency1, CoordinatorAction.Status.WAITING);
// second partition available
pdms.partitionAvailable("hcat.server.com:5080", "mydb", "clicks",
getPartitionMap("src=search;datastamp=11;region=us"));
availableURIs = pdms.getAvailableDependencyURIs(actionId);
assertEquals(1, availableURIs.size());
assertTrue(availableURIs.contains(newHCatDependency1));
new CoordActionUpdatePushMissingDependency(actionId).call();
checkCoordAction(actionId, "", CoordinatorAction.Status.READY);
assertNull(pdms.getAvailableDependencyURIs(actionId));
}