YARN-9824. Fall back to configured queue ordering policy class name
(cherry picked from commitf8f8598ea5
) (cherry picked from commit1dbf87c9ff
) (cherry picked from commitd75693bd6e
)
This commit is contained in:
parent
dbf921844c
commit
c412fab728
|
@ -1355,20 +1355,23 @@ public class CapacitySchedulerConfiguration extends ReservationSchedulerConfigur
|
||||||
}
|
}
|
||||||
|
|
||||||
String policyType = get(getQueuePrefix(queue) + ORDERING_POLICY,
|
String policyType = get(getQueuePrefix(queue) + ORDERING_POLICY,
|
||||||
defaultPolicy);
|
defaultPolicy).trim();
|
||||||
|
|
||||||
QueueOrderingPolicy qop;
|
QueueOrderingPolicy qop;
|
||||||
if (policyType.trim().equals(QUEUE_UTILIZATION_ORDERING_POLICY)) {
|
if (policyType.equals(QUEUE_UTILIZATION_ORDERING_POLICY)) {
|
||||||
// Doesn't respect priority
|
// Doesn't respect priority
|
||||||
qop = new PriorityUtilizationQueueOrderingPolicy(false);
|
qop = new PriorityUtilizationQueueOrderingPolicy(false);
|
||||||
} else if (policyType.trim().equals(
|
} else if (policyType.equals(
|
||||||
QUEUE_PRIORITY_UTILIZATION_ORDERING_POLICY)) {
|
QUEUE_PRIORITY_UTILIZATION_ORDERING_POLICY)) {
|
||||||
qop = new PriorityUtilizationQueueOrderingPolicy(true);
|
qop = new PriorityUtilizationQueueOrderingPolicy(true);
|
||||||
} else {
|
} else {
|
||||||
String message =
|
try {
|
||||||
"Unable to construct queue ordering policy=" + policyType + " queue="
|
qop = (QueueOrderingPolicy) Class.forName(policyType).newInstance();
|
||||||
+ queue;
|
} catch (Exception e) {
|
||||||
throw new YarnRuntimeException(message);
|
String message = "Unable to construct queue ordering policy="
|
||||||
|
+ policyType + " queue=" + queue;
|
||||||
|
throw new YarnRuntimeException(message, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return qop;
|
return qop;
|
||||||
|
|
Loading…
Reference in New Issue