fixing empty parallelism type records creation issue
@@ -836,12 +836,14 @@ public class ComputeResourceImpl implements ComputeResource {
Map<ApplicationParallelismType, String> parallelismPrefix = resourceJobManager.getParallelismPrefix();
if (parallelismPrefix!=null && parallelismPrefix.size() != 0) {
for (ApplicationParallelismType commandType : parallelismPrefix.keySet()) {
+ if (parallelismPrefix.get(commandType) != null && !parallelismPrefix.get(commandType).isEmpty()) {
ParallelismPrefixCommandResource r = new ParallelismPrefixCommandResource();
r.setCommandType(commandType.toString());
r.setCommand(parallelismPrefix.get(commandType));
r.setResourceJobManagerId(resource.getResourceJobManagerId());
r.save();
}
+ }
}
return resource.getResourceJobManagerId();
}
@@ -887,12 +889,14 @@ public class ComputeResourceImpl implements ComputeResource {
}else {
existingCommand = new ParallelismPrefixCommandResource();
}
+ if (parallelismPrefix.get(commandType) != null && !parallelismPrefix.get(commandType).isEmpty()) {
existingCommand.setCommandType(commandType.toString());
existingCommand.setCommand(parallelismPrefix.get(commandType));
existingCommand.setResourceJobManagerId(resource.getResourceJobManagerId());
existingCommand.save();
}
}
+ }
}catch (Exception e){
logger.error("Error while updating resource job manager..", e);
throw new AppCatalogException(e);
