use of org.apache.oozie.service.PartitionDependencyManagerService in project oozie by apache.
the class TestCoordActionUpdatePushMissingDependency method testUpdateCoordTableAdvanced.
@Test
public void testUpdateCoordTableAdvanced() throws Exception {
String newHCatDependency1 = "hcat://hcat.server.com:5080/mydb/clicks/datastamp=11;region=us";
String newHCatDependency2 = "hcat://hcat.server.com:5080/mydb/clicks/datastamp=12;region=us";
HCatURI hcatUri1 = new HCatURI(newHCatDependency1);
HCatURI hcatUri2 = new HCatURI(newHCatDependency2);
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));
}
use of org.apache.oozie.service.PartitionDependencyManagerService in project oozie by apache.
the class TestCoordActionUpdatePushMissingDependency method testUpdateCoordTableBasic.
@Test
public void testUpdateCoordTableBasic() throws Exception {
String newHCatDependency = "hcat://hcat.server.com:5080/mydb/clicks/datastamp=12;region=us";
HCatURI hcatUri = new HCatURI(newHCatDependency);
String actionId = addInitRecords(newHCatDependency);
checkCoordAction(actionId, newHCatDependency, CoordinatorAction.Status.WAITING);
PartitionDependencyManagerService pdms = Services.get().get(PartitionDependencyManagerService.class);
pdms.addMissingDependency(hcatUri, actionId);
pdms.partitionAvailable("hcat.server.com:5080", "mydb", "clicks", getPartitionMap("src=search;datastamp=12;region=us"));
Collection<String> availableURIs = pdms.getAvailableDependencyURIs(actionId);
assertEquals(availableURIs.size(), 1);
assertTrue(availableURIs.contains(newHCatDependency));
new CoordActionUpdatePushMissingDependency(actionId).call();
checkCoordAction(actionId, "", CoordinatorAction.Status.READY);
assertNull(pdms.getAvailableDependencyURIs(actionId));
}
Aggregations