Addendum to YARN-9730. Support forcing configured partitions to be exclusive based on app node label
(cherry picked from commit d86a1acc866cbda845fb3896dc824baf12217383) (cherry picked from commitf4f210d2e5
) (cherry picked from commit95ec7050b5
)
This commit is contained in:
parent
eedbf9d195
commit
a0e592db5a
|
@ -587,9 +587,13 @@ public class RMContextImpl implements RMContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getExclusiveEnforcedPartitions() {
|
public Set<String> getExclusiveEnforcedPartitions() {
|
||||||
String[] configuredPartitions = getYarnConfiguration().getStrings(
|
|
||||||
YarnConfiguration.EXCLUSIVE_ENFORCED_PARTITIONS);
|
|
||||||
Set<String> exclusiveEnforcedPartitions = new HashSet<>();
|
Set<String> exclusiveEnforcedPartitions = new HashSet<>();
|
||||||
|
Configuration conf = getYarnConfiguration();
|
||||||
|
if (conf == null) {
|
||||||
|
return new HashSet<>();
|
||||||
|
}
|
||||||
|
String[] configuredPartitions = conf.getStrings(
|
||||||
|
YarnConfiguration.EXCLUSIVE_ENFORCED_PARTITIONS);
|
||||||
if (configuredPartitions != null) {
|
if (configuredPartitions != null) {
|
||||||
for (String partition : configuredPartitions) {
|
for (String partition : configuredPartitions) {
|
||||||
exclusiveEnforcedPartitions.add(partition);
|
exclusiveEnforcedPartitions.add(partition);
|
||||||
|
|
Loading…
Reference in New Issue