Improving batch queue validator logic
@@ -81,12 +81,27 @@ public class BatchQueueValidator implements JobMetadataValidator {
computeResource = registryClient.getComputeResource(experiment.getUserConfigurationData().getComputationalResourceScheduling().getResourceHostId());
} else {
computeResource = registryClient.getComputeResource(processModel.getProcessResourceSchedule().getResourceHostId());
-
}
+
List<BatchQueue> batchQueues = computeResource.getBatchQueues();
+ if (computationalResourceScheduling == null) {
+ ValidatorResult queueNameResult = new ValidatorResult();
+ queueNameResult.setResult(false);
+ queueNameResult.setErrorDetails("No compute resource scheduling for experiment " + experiment.getExperimentId());
+ validatorResultList.add(queueNameResult);
+ return validatorResultList;
+ }
+
+ if (computationalResourceScheduling.getQueueName() == null) {
+ ValidatorResult queueNameResult = new ValidatorResult();
+ queueNameResult.setResult(false);
+ queueNameResult.setErrorDetails("No queue name for experiment " + experiment.getExperimentId());
+ validatorResultList.add(queueNameResult);
+ return validatorResultList;
+ }
+
if (batchQueues != null && !batchQueues.isEmpty()) {
- if (computationalResourceScheduling != null) {
String experimentQueueName = computationalResourceScheduling.getQueueName().trim();
int experimentWallTimeLimit = computationalResourceScheduling.getWallTimeLimit();
int experimentNodeCount = computationalResourceScheduling.getNodeCount();
@@ -185,7 +200,6 @@ public class BatchQueueValidator implements JobMetadataValidator {
}
validatorResultList.add(queueNameResult);
- }
} else {
// for some compute resources, you dnt need to specify queue names
ValidatorResult result = new ValidatorResult();
