// Group Lock List
ArrayList<JobLock> jobLocks = new ArrayList<JobLock>();
// If this job requires work permits wrap it in a resource throttler
if(jobDescriptor.getNumRequiredPermits() > 0) {
PermitLock permits = _permitManager.getNamedPermit("default",
jobDescriptor.getNumRequiredPermits());
if(permits == null) {
throw new RuntimeException("Job " + jobDescriptor.getId() + " requires non-existant default");
} else if(permits.getDesiredNumPermits() > permits.getTotalNumberOfPermits()) {
throw new RuntimeException(
String.format(
"Job %s requires %s but azkaban only has a total of %s permits, so this job cannot ever run.",
jobDescriptor.getId(),
permits.getTotalNumberOfPermits(),
permits.getDesiredNumPermits()
)
);
} else {
jobLocks.add(permits);
}