YARN-10637. fs2cs: add queue autorefresh policy during conversion. Contributed by Qi Zhu.
This commit is contained in:
parent
605ed85c29
commit
9166bfeb74
@ -24,6 +24,7 @@
|
|||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AutoCreatedQueueDeletionPolicy;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AutoCreatedQueueDeletionPolicy;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
|
||||||
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueConfigurationAutoRefreshPolicy;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulerConfiguration;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulerConfiguration;
|
||||||
import org.apache.hadoop.yarn.util.resource.DominantResourceCalculator;
|
import org.apache.hadoop.yarn.util.resource.DominantResourceCalculator;
|
||||||
|
|
||||||
@ -111,6 +112,11 @@ public void convertSiteProperties(Configuration conf,
|
|||||||
CapacitySchedulerConfiguration.ASSIGN_MULTIPLE_ENABLED, false);
|
CapacitySchedulerConfiguration.ASSIGN_MULTIPLE_ENABLED, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make auto cs conf refresh enabled.
|
||||||
|
yarnSiteConfig.set(YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES,
|
||||||
|
addMonitorPolicy(QueueConfigurationAutoRefreshPolicy
|
||||||
|
.class.getCanonicalName(), yarnSiteConfig));
|
||||||
|
|
||||||
int maxAssign = conf.getInt(FairSchedulerConfiguration.MAX_ASSIGN,
|
int maxAssign = conf.getInt(FairSchedulerConfiguration.MAX_ASSIGN,
|
||||||
FairSchedulerConfiguration.DEFAULT_MAX_ASSIGN);
|
FairSchedulerConfiguration.DEFAULT_MAX_ASSIGN);
|
||||||
if (maxAssign != FairSchedulerConfiguration.DEFAULT_MAX_ASSIGN) {
|
if (maxAssign != FairSchedulerConfiguration.DEFAULT_MAX_ASSIGN) {
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
import org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy;
|
import org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AutoCreatedQueueDeletionPolicy;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AutoCreatedQueueDeletionPolicy;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
|
||||||
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueConfigurationAutoRefreshPolicy;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulerConfiguration;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulerConfiguration;
|
||||||
import org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator;
|
import org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator;
|
||||||
import org.apache.hadoop.yarn.util.resource.DominantResourceCalculator;
|
import org.apache.hadoop.yarn.util.resource.DominantResourceCalculator;
|
||||||
@ -69,6 +70,19 @@ public void testSiteContinuousSchedulingConversion() {
|
|||||||
".scheduling-interval-ms", -1));
|
".scheduling-interval-ms", -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSiteQueueConfAutoRefreshConversion() {
|
||||||
|
converter.convertSiteProperties(yarnConfig, yarnConvertedConfig, false,
|
||||||
|
false, false, null);
|
||||||
|
assertTrue(yarnConvertedConfig.get(YarnConfiguration.
|
||||||
|
RM_SCHEDULER_ENABLE_MONITORS), true);
|
||||||
|
assertTrue("Scheduling Policies contains queue conf auto refresh",
|
||||||
|
yarnConvertedConfig.
|
||||||
|
get(YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES)
|
||||||
|
.contains(QueueConfigurationAutoRefreshPolicy.
|
||||||
|
class.getCanonicalName()));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSitePreemptionConversion() {
|
public void testSitePreemptionConversion() {
|
||||||
yarnConfig.setBoolean(FairSchedulerConfiguration.PREEMPTION, true);
|
yarnConfig.setBoolean(FairSchedulerConfiguration.PREEMPTION, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user