Search in sources :

Example 1 with MockAMLauncher

use of org.apache.hadoop.yarn.sls.resourcemanager.MockAMLauncher in project hadoop by apache.

the class SLSRunner method startRM.

private void startRM() throws IOException, ClassNotFoundException {
    Configuration rmConf = new YarnConfiguration();
    String schedulerClass = rmConf.get(YarnConfiguration.RM_SCHEDULER);
    // exercise/track behaviors that are not common to the scheduler api
    if (Class.forName(schedulerClass) == CapacityScheduler.class) {
        rmConf.set(YarnConfiguration.RM_SCHEDULER, SLSCapacityScheduler.class.getName());
    } else {
        rmConf.set(YarnConfiguration.RM_SCHEDULER, ResourceSchedulerWrapper.class.getName());
        rmConf.set(SLSConfiguration.RM_SCHEDULER, schedulerClass);
    }
    rmConf.set(SLSConfiguration.METRICS_OUTPUT_DIR, metricsOutputDir);
    final SLSRunner se = this;
    rm = new ResourceManager() {

        @Override
        protected ApplicationMasterLauncher createAMLauncher() {
            return new MockAMLauncher(se, this.rmContext, amMap);
        }
    };
    rm.init(rmConf);
    rm.start();
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) SLSConfiguration(org.apache.hadoop.yarn.sls.conf.SLSConfiguration) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) MockAMLauncher(org.apache.hadoop.yarn.sls.resourcemanager.MockAMLauncher) ApplicationMasterLauncher(org.apache.hadoop.yarn.server.resourcemanager.amlauncher.ApplicationMasterLauncher) ResourceManager(org.apache.hadoop.yarn.server.resourcemanager.ResourceManager) ResourceSchedulerWrapper(org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper) SLSCapacityScheduler(org.apache.hadoop.yarn.sls.scheduler.SLSCapacityScheduler)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)1 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)1 ResourceManager (org.apache.hadoop.yarn.server.resourcemanager.ResourceManager)1 ApplicationMasterLauncher (org.apache.hadoop.yarn.server.resourcemanager.amlauncher.ApplicationMasterLauncher)1 SLSConfiguration (org.apache.hadoop.yarn.sls.conf.SLSConfiguration)1 MockAMLauncher (org.apache.hadoop.yarn.sls.resourcemanager.MockAMLauncher)1 ResourceSchedulerWrapper (org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper)1 SLSCapacityScheduler (org.apache.hadoop.yarn.sls.scheduler.SLSCapacityScheduler)1