YARN-10279. Avoid unnecessary QueueMappingEntity creations. Contributed by Marton Hudaky
(cherry picked from commit 6a8fd73b27
)
This commit is contained in:
parent
ee192c4826
commit
fa41e38450
@ -74,12 +74,7 @@ public static QueueMapping validateAndGetAutoCreatedQueueMapping(
|
|||||||
validateQueueMappingUnderParentQueue(queueManager.getQueue(
|
validateQueueMappingUnderParentQueue(queueManager.getQueue(
|
||||||
mapping.getParentQueue()), mapping.getParentQueue(),
|
mapping.getParentQueue()), mapping.getParentQueue(),
|
||||||
mapping.getFullPath());
|
mapping.getFullPath());
|
||||||
return QueueMapping.QueueMappingBuilder.create()
|
return mapping;
|
||||||
.type(mapping.getType())
|
|
||||||
.source(mapping.getSource())
|
|
||||||
.parentQueue(mapping.getParentQueue())
|
|
||||||
.queue(mapping.getQueue())
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -487,24 +487,14 @@ private static QueueMapping validateAndGetAutoCreatedQueueMapping(
|
|||||||
&& (mapping.getParentQueue().equals(PRIMARY_GROUP_MAPPING)
|
&& (mapping.getParentQueue().equals(PRIMARY_GROUP_MAPPING)
|
||||||
|| mapping.getParentQueue().equals(SECONDARY_GROUP_MAPPING))) {
|
|| mapping.getParentQueue().equals(SECONDARY_GROUP_MAPPING))) {
|
||||||
// dynamic parent queue
|
// dynamic parent queue
|
||||||
return QueueMappingBuilder.create()
|
return mapping;
|
||||||
.type(mapping.getType())
|
|
||||||
.source(mapping.getSource())
|
|
||||||
.queue(mapping.getQueue())
|
|
||||||
.parentQueue(mapping.getParentQueue())
|
|
||||||
.build();
|
|
||||||
} else if (mapping.hasParentQueue()) {
|
} else if (mapping.hasParentQueue()) {
|
||||||
//if parent queue is specified,
|
//if parent queue is specified,
|
||||||
// then it should exist and be an instance of ManagedParentQueue
|
// then it should exist and be an instance of ManagedParentQueue
|
||||||
QueuePlacementRuleUtils.validateQueueMappingUnderParentQueue(
|
QueuePlacementRuleUtils.validateQueueMappingUnderParentQueue(
|
||||||
queueManager.getQueue(mapping.getParentQueue()),
|
queueManager.getQueue(mapping.getParentQueue()),
|
||||||
mapping.getParentQueue(), mapping.getQueue());
|
mapping.getParentQueue(), mapping.getQueue());
|
||||||
return QueueMappingBuilder.create()
|
return mapping;
|
||||||
.type(mapping.getType())
|
|
||||||
.source(mapping.getSource())
|
|
||||||
.queue(mapping.getQueue())
|
|
||||||
.parentQueue(mapping.getParentQueue())
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user