if (instances > MAX_TASKS_PER_JOB.get()) {
throw new ScheduleException("Job exceeds task limit of " + MAX_TASKS_PER_JOB.get());
}
QuotaCheckResult quotaCheck = quotaManager.checkQuota(task, instances);
if (quotaCheck.getResult() == INSUFFICIENT_QUOTA) {
throw new ScheduleException("Insufficient resource quota: " + quotaCheck.getDetails().or(""));
}
}