Permalink
Browse files

handling null in wf name suffix

  • Loading branch information...
1 parent f19193c commit 6543073d086d0657767ceac39f9229412fbe3768 Shwetha GS committed Oct 12, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 oozie/src/main/java/org/apache/ivory/converter/AbstractOozieEntityMapper.java
@@ -127,12 +127,11 @@ public boolean map(Cluster cluster, Path bundlePath) throws IvoryException {
}
for (COORDINATORAPP coordinatorapp : coordinators) {
Path coordPath = getCoordPath(bundlePath, coordinatorapp.getName());
- marshal(cluster, coordinatorapp, coordPath,
- entity.getName() + EntityUtil.getWorkflowNameSuffix(coordinatorapp.getName(), entity) + ".xml");
+ String coordXmlName = marshal(cluster, coordinatorapp, coordPath, EntityUtil.getWorkflowNameSuffix(coordinatorapp.getName(), entity));
createTempDir(cluster, coordPath);
COORDINATOR bundleCoord = new COORDINATOR();
bundleCoord.setName(coordinatorapp.getName());
- bundleCoord.setAppPath(getHDFSPath(coordPath) + "/" + EntityUtil.getWorkflowNameSuffix(coordinatorapp.getName(), entity) + ".xml");
+ bundleCoord.setAppPath(getHDFSPath(coordPath) + "/" + coordXmlName);
bundleApp.getCoordinator().add(bundleCoord);
copySharedLibs(cluster, coordPath);
@@ -260,9 +259,12 @@ private void createTempDir(Cluster cluster, Path coordPath) throws IvoryExceptio
}
}
- protected void marshal(Cluster cluster, COORDINATORAPP coord, Path outPath, String name) throws IvoryException {
-
+ protected String marshal(Cluster cluster, COORDINATORAPP coord, Path outPath, String name) throws IvoryException {
+ if(StringUtils.isEmpty(name))
+ name = "coordinator";
+ name = name + ".xml";
marshal(cluster, new ObjectFactory().createCoordinatorApp(coord), coordJaxbContext, new Path(outPath, name));
+ return name;
}
protected void marshal(Cluster cluster, BUNDLEAPP bundle, Path outPath) throws IvoryException {

0 comments on commit 6543073

Please sign in to comment.