当前位置: 首页>>代码示例>>Java>>正文


Java类org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler代码示例

以下是Javaorg.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler的代码示例。类PreemptableResourceScheduler属于org.apache.hadoop.yarn.server.resourcemanager.scheduler包,如果您正苦于以下问题:Java PreemptableResourceScheduler类的具体用法?Java PreemptableResourceScheduler怎么用?Java PreemptableResourceScheduler使用的例子?那么恭喜您, 这里整理的类代码示例例程将为您提供帮助。

本文一共展示了PreemptableResourceScheduler的15个开源代码实例,这些例子默认根据受欢迎程度排序。您可以为喜欢的代码打CALL点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public void init(Configuration config,
    EventHandler<ContainerPreemptEvent> disp,
    PreemptableResourceScheduler sched) {
  LOG.info("Preemption monitor:" + this.getClass().getCanonicalName());
  assert null == scheduler : "Unexpected duplicate call to init";
  if (!(sched instanceof CapacityScheduler)) {
    throw new YarnRuntimeException("Class " +
        sched.getClass().getCanonicalName() + " not instance of " +
        CapacityScheduler.class.getCanonicalName());
  }
  dispatcher = disp;
  scheduler = (CapacityScheduler) sched;
  maxIgnoredOverCapacity = config.getDouble(MAX_IGNORED_OVER_CAPACITY, 0.1);
  naturalTerminationFactor =
    config.getDouble(NATURAL_TERMINATION_FACTOR, 0.2);
  maxWaitTime = config.getLong(WAIT_TIME_BEFORE_KILL, 15000);
  monitoringInterval = config.getLong(MONITORING_INTERVAL, 3000);
  percentageClusterPreemptionAllowed =
    config.getFloat(TOTAL_PREEMPTION_PER_ROUND, (float) 0.1);
  observeOnly = config.getBoolean(OBSERVE_ONLY, false);
  rc = scheduler.getResourceCalculator();
  labels = null;
}
 
开发者ID:naver,项目:hadoop,完整代码来源:ProportionalCapacityPreemptionPolicy.java


示例2: init

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public void init(Configuration config, RMContext context,
    PreemptableResourceScheduler sched) {
  LOG.info("Preemption monitor:" + this.getClass().getCanonicalName());
  assert null == scheduler : "Unexpected duplicate call to init";
  if (!(sched instanceof CapacityScheduler)) {
    throw new YarnRuntimeException("Class " +
        sched.getClass().getCanonicalName() + " not instance of " +
        CapacityScheduler.class.getCanonicalName());
  }
  rmContext = context;
  scheduler = (CapacityScheduler) sched;
  maxIgnoredOverCapacity = config.getDouble(MAX_IGNORED_OVER_CAPACITY, 0.1);
  naturalTerminationFactor =
    config.getDouble(NATURAL_TERMINATION_FACTOR, 0.2);
  maxWaitTime = config.getLong(WAIT_TIME_BEFORE_KILL, 15000);
  monitoringInterval = config.getLong(MONITORING_INTERVAL, 3000);
  percentageClusterPreemptionAllowed =
    config.getFloat(TOTAL_PREEMPTION_PER_ROUND, (float) 0.1);
  observeOnly = config.getBoolean(OBSERVE_ONLY, false);
  rc = scheduler.getResourceCalculator();
  nlm = scheduler.getRMContext().getNodeLabelManager();
}
 
开发者ID:aliyun-beta,项目:aliyun-oss-hadoop-fs,完整代码来源:ProportionalCapacityPreemptionPolicy.java


示例3: init

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public void init(Configuration config,
    EventHandler<ContainerPreemptEvent> disp,
    PreemptableResourceScheduler sched) {
  LOG.info("Preemption monitor:" + this.getClass().getCanonicalName());
  assert null == scheduler : "Unexpected duplicate call to init";
  if (!(sched instanceof CapacityScheduler)) {
    throw new YarnRuntimeException("Class " +
        sched.getClass().getCanonicalName() + " not instance of " +
        CapacityScheduler.class.getCanonicalName());
  }
  dispatcher = disp;
  scheduler = (CapacityScheduler) sched;
  maxIgnoredOverCapacity = config.getDouble(MAX_IGNORED_OVER_CAPACITY, 0.1);
  naturalTerminationFactor =
    config.getDouble(NATURAL_TERMINATION_FACTOR, 0.2);
  maxWaitTime = config.getLong(WAIT_TIME_BEFORE_KILL, 15000);
  monitoringInterval = config.getLong(MONITORING_INTERVAL, 3000);
  percentageClusterPreemptionAllowed =
    config.getFloat(TOTAL_PREEMPTION_PER_ROUND, (float) 0.1);
  observeOnly = config.getBoolean(OBSERVE_ONLY, false);
  rc = scheduler.getResourceCalculator();
}
 
开发者ID:Nextzero,项目:hadoop-2.6.0-cdh5.4.3,完整代码来源:ProportionalCapacityPreemptionPolicy.java


示例4: createPolicyMonitors

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
protected void createPolicyMonitors() {
  if (scheduler instanceof PreemptableResourceScheduler
      && conf.getBoolean(YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS,
      YarnConfiguration.DEFAULT_RM_SCHEDULER_ENABLE_MONITORS)) {
    LOG.info("Loading policy monitors");
    List<SchedulingEditPolicy> policies = conf.getInstances(
        YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES,
        SchedulingEditPolicy.class);
    if (policies.size() > 0) {
      for (SchedulingEditPolicy policy : policies) {
        LOG.info("LOADING SchedulingEditPolicy:" + policy.getPolicyName());
        // periodically check whether we need to take action to guarantee
        // constraints
        SchedulingMonitor mon = new SchedulingMonitor(rmContext, policy);
        addService(mon);
      }
    } else {
      LOG.warn("Policy monitors configured (" +
          YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS +
          ") but none specified (" +
          YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES + ")");
    }
  }
}
 
开发者ID:hopshadoop,项目:hops,完整代码来源:ResourceManager.java


示例5: serviceInit

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void serviceInit(Configuration conf) throws Exception {
  scheduleEditPolicy.init(conf, rmContext.getDispatcher().getEventHandler(),
      (PreemptableResourceScheduler) rmContext.getScheduler());
  this.monitorInterval = scheduleEditPolicy.getMonitoringInterval();
  super.serviceInit(conf);
}
 
开发者ID:naver,项目:hadoop,完整代码来源:SchedulingMonitor.java


示例6: init

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public void init(Configuration config,
    EventHandler<ContainerPreemptEvent> disp,
    PreemptableResourceScheduler sched) {
  LOG.info("Preemption monitor:" + this.getClass().getCanonicalName());
  assert null == scheduler : "Unexpected duplicate call to init";
  if (!(sched instanceof CapacityScheduler)) {
    throw new YarnRuntimeException("Class " +
        sched.getClass().getCanonicalName() + " not instance of " +
        CapacityScheduler.class.getCanonicalName());
  }
  dispatcher = disp;
  scheduler = (CapacityScheduler) sched;
  maxIgnoredOverCapacity = config.getDouble(MAX_IGNORED_OVER_CAPACITY, 0.1);
  naturalTerminationFactor =
    config.getDouble(NATURAL_TERMINATION_FACTOR, 0.2);
  maxWaitTime = config.getLong(WAIT_TIME_BEFORE_KILL, 0);
  monitoringInterval = config.getLong(MONITORING_INTERVAL, 3000);
  percentageClusterPreemptionAllowed =
    config.getFloat(TOTAL_PREEMPTION_PER_ROUND, (float) 0.1);
  observeOnly = config.getBoolean(OBSERVE_ONLY, false);
  isSuspended = config.getBoolean(IS_SUPEND_ENABLED, true);
  isNaive      = scheduler.getConfiguration().getNaive("root");
  LOG.info("isNaive:"+isNaive);
  isTest       = scheduler.getConfiguration().getTest("root");
  LOG.info("isTest: "+isTest);
  isTestOnlyCpu= scheduler.getConfiguration().getTestOnlyCpu("root");
  LOG.info("isTestOnlyCpu:  "+isTestOnlyCpu);
  testNumber   = scheduler.getConfiguration().getTestNumber("root");
  LOG.info("testNumber:"+testNumber);
  testTime     = scheduler.getConfiguration().getTestTime("root");
  LOG.info("testTime:  "+testTime);
  
  LOG.info("isSuspenpded init: "+isSuspended);
  rc = scheduler.getResourceCalculator();
  labels = null;
}
 
开发者ID:yncxcw,项目:big-c,完整代码来源:ProportionalCapacityPreemptionPolicy.java


示例7: createPolicyMonitors

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
protected void createPolicyMonitors() {
  if (scheduler instanceof PreemptableResourceScheduler
      && conf.getBoolean(YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS,
      YarnConfiguration.DEFAULT_RM_SCHEDULER_ENABLE_MONITORS)) {
    LOG.info("Loading policy monitors");
    List<SchedulingEditPolicy> policies = conf.getInstances(
        YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES,
        SchedulingEditPolicy.class);
    if (policies.size() > 0) {
      rmDispatcher.register(ContainerPreemptEventType.class,
          new RMContainerPreemptEventDispatcher(
              (PreemptableResourceScheduler) scheduler));
      for (SchedulingEditPolicy policy : policies) {
        LOG.info("LOADING SchedulingEditPolicy:" + policy.getPolicyName());
        // periodically check whether we need to take action to guarantee
        // constraints
        SchedulingMonitor mon = new SchedulingMonitor(rmContext, policy);
        addService(mon);
      }
    } else {
      LOG.warn("Policy monitors configured (" +
          YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS +
          ") but none specified (" +
          YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES + ")");
    }
  }
}
 
开发者ID:Nextzero,项目:hadoop-2.6.0-cdh5.4.3,完整代码来源:ResourceManager.java


示例8: createPolicyMonitors

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
protected void createPolicyMonitors() {
  if (scheduler instanceof PreemptableResourceScheduler
      && conf.getBoolean(YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS,
        YarnConfiguration.DEFAULT_RM_SCHEDULER_ENABLE_MONITORS)) {
    LOG.info("Loading policy monitors");
    List<SchedulingEditPolicy> policies = conf.getInstances(
            YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES,
            SchedulingEditPolicy.class);
    if (policies.size() > 0) {
      this.rmDispatcher.register(ContainerPreemptEventType.class,
        new RMContainerPreemptEventDispatcher(
          (PreemptableResourceScheduler) scheduler));
      for (SchedulingEditPolicy policy : policies) {
        LOG.info("LOADING SchedulingEditPolicy:" + policy.getPolicyName());
        policy.init(conf, this.rmContext.getDispatcher().getEventHandler(),
            (PreemptableResourceScheduler) scheduler);
        // periodically check whether we need to take action to guarantee
        // constraints
        SchedulingMonitor mon = new SchedulingMonitor(policy);
        addService(mon);

      }
    } else {
      LOG.warn("Policy monitors configured (" +
          YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS +
          ") but none specified (" +
          YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES + ")");
    }
  }
}
 
开发者ID:ict-carch,项目:hadoop-plus,完整代码来源:ResourceManager.java


示例9: createPolicyMonitors

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
protected void createPolicyMonitors() {
  if (scheduler instanceof PreemptableResourceScheduler
      && conf.getBoolean(YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS,
      YarnConfiguration.DEFAULT_RM_SCHEDULER_ENABLE_MONITORS)) {
    LOG.info("Loading policy monitors");
    List<SchedulingEditPolicy> policies = conf.getInstances(
        YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES,
        SchedulingEditPolicy.class);
    if (policies.size() > 0) {
      rmDispatcher.register(ContainerPreemptEventType.class,
          new RMContainerPreemptEventDispatcher(
              (PreemptableResourceScheduler) scheduler));
      for (SchedulingEditPolicy policy : policies) {
        LOG.info("LOADING SchedulingEditPolicy:" + policy.getPolicyName());
        policy.init(conf, rmContext.getDispatcher().getEventHandler(),
            (PreemptableResourceScheduler) scheduler);
        // periodically check whether we need to take action to guarantee
        // constraints
        SchedulingMonitor mon = new SchedulingMonitor(policy);
        addService(mon);
      }
    } else {
      LOG.warn("Policy monitors configured (" +
          YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS +
          ") but none specified (" +
          YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES + ")");
    }
  }
}
 
开发者ID:Seagate,项目:hadoop-on-lustre2,完整代码来源:ResourceManager.java


示例10: init

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public void init(Configuration config,
EventHandler<ContainerPreemptEvent> dispatcher,
PreemptableResourceScheduler scheduler);
 
开发者ID:naver,项目:hadoop,完整代码来源:SchedulingEditPolicy.java


示例11: serviceInit

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public void serviceInit(Configuration conf) throws Exception {
  scheduleEditPolicy.init(conf, rmContext,
      (PreemptableResourceScheduler) rmContext.getScheduler());
  this.monitorInterval = scheduleEditPolicy.getMonitoringInterval();
  super.serviceInit(conf);
}
 
开发者ID:aliyun-beta,项目:aliyun-oss-hadoop-fs,完整代码来源:SchedulingMonitor.java


示例12: init

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public void init(Configuration config, RMContext context,
PreemptableResourceScheduler scheduler);
 
开发者ID:aliyun-beta,项目:aliyun-oss-hadoop-fs,完整代码来源:SchedulingEditPolicy.java


示例13: RMContainerPreemptEventDispatcher

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public RMContainerPreemptEventDispatcher(
    PreemptableResourceScheduler scheduler) {
  this.scheduler = scheduler;
}
 
开发者ID:Nextzero,项目:hadoop-2.6.0-cdh5.4.3,完整代码来源:ResourceManager.java


示例14: init

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
void init(Configuration config, RMContext context,
PreemptableResourceScheduler scheduler);
 
开发者ID:hopshadoop,项目:hops,完整代码来源:SchedulingEditPolicy.java


示例15: init

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.PreemptableResourceScheduler; //导入依赖的package包/类
public void init(Configuration config, RMContext context,
    PreemptableResourceScheduler sched) {
  LOG.info("Preemption monitor:" + this.getClass().getCanonicalName());
  assert null == scheduler : "Unexpected duplicate call to init";
  if (!(sched instanceof CapacityScheduler)) {
    throw new YarnRuntimeException("Class " +
        sched.getClass().getCanonicalName() + " not instance of " +
        CapacityScheduler.class.getCanonicalName());
  }
  rmContext = context;
  scheduler = (CapacityScheduler) sched;
  CapacitySchedulerConfiguration csConfig = scheduler.getConfiguration();

  maxIgnoredOverCapacity = csConfig.getDouble(
      CapacitySchedulerConfiguration.PREEMPTION_MAX_IGNORED_OVER_CAPACITY,
      CapacitySchedulerConfiguration.DEFAULT_PREEMPTION_MAX_IGNORED_OVER_CAPACITY);

  naturalTerminationFactor = csConfig.getDouble(
      CapacitySchedulerConfiguration.PREEMPTION_NATURAL_TERMINATION_FACTOR,
      CapacitySchedulerConfiguration.DEFAULT_PREEMPTION_NATURAL_TERMINATION_FACTOR);

  maxWaitTime = csConfig.getLong(
      CapacitySchedulerConfiguration.PREEMPTION_WAIT_TIME_BEFORE_KILL,
      CapacitySchedulerConfiguration.DEFAULT_PREEMPTION_WAIT_TIME_BEFORE_KILL);

  monitoringInterval = csConfig.getLong(
      CapacitySchedulerConfiguration.PREEMPTION_MONITORING_INTERVAL,
      CapacitySchedulerConfiguration.DEFAULT_PREEMPTION_MONITORING_INTERVAL);

  percentageClusterPreemptionAllowed = csConfig.getFloat(
      CapacitySchedulerConfiguration.TOTAL_PREEMPTION_PER_ROUND,
      CapacitySchedulerConfiguration.DEFAULT_TOTAL_PREEMPTION_PER_ROUND);

  observeOnly = csConfig.getBoolean(
      CapacitySchedulerConfiguration.PREEMPTION_OBSERVE_ONLY,
      CapacitySchedulerConfiguration.DEFAULT_PREEMPTION_OBSERVE_ONLY);

  lazyPreempionEnabled = csConfig.getBoolean(
      CapacitySchedulerConfiguration.LAZY_PREEMPTION_ENALBED,
      CapacitySchedulerConfiguration.DEFAULT_LAZY_PREEMPTION_ENABLED);

  maxAllowableLimitForIntraQueuePreemption = csConfig.getFloat(
      CapacitySchedulerConfiguration.
      INTRAQUEUE_PREEMPTION_MAX_ALLOWABLE_LIMIT,
      CapacitySchedulerConfiguration.
      DEFAULT_INTRAQUEUE_PREEMPTION_MAX_ALLOWABLE_LIMIT);

  minimumThresholdForIntraQueuePreemption = csConfig.getFloat(
      CapacitySchedulerConfiguration.
      INTRAQUEUE_PREEMPTION_MINIMUM_THRESHOLD,
      CapacitySchedulerConfiguration.
      DEFAULT_INTRAQUEUE_PREEMPTION_MINIMUM_THRESHOLD);

  rc = scheduler.getResourceCalculator();
  nlm = scheduler.getRMContext().getNodeLabelManager();

  // Do we need to specially consider reserved containers?
  boolean selectCandidatesForResevedContainers = csConfig.getBoolean(
      CapacitySchedulerConfiguration.
      PREEMPTION_SELECT_CANDIDATES_FOR_RESERVED_CONTAINERS,
      CapacitySchedulerConfiguration.
      DEFAULT_PREEMPTION_SELECT_CANDIDATES_FOR_RESERVED_CONTAINERS);
  if (selectCandidatesForResevedContainers) {
    candidatesSelectionPolicies
        .add(new ReservedContainerCandidatesSelector(this));
  }

  // initialize candidates preemption selection policies
  candidatesSelectionPolicies.add(new FifoCandidatesSelector(this));

  // Do we need to specially consider intra queue
  boolean isIntraQueuePreemptionEnabled = csConfig.getBoolean(
      CapacitySchedulerConfiguration.INTRAQUEUE_PREEMPTION_ENABLED,
      CapacitySchedulerConfiguration.DEFAULT_INTRAQUEUE_PREEMPTION_ENABLED);
  if (isIntraQueuePreemptionEnabled) {
    candidatesSelectionPolicies.add(new IntraQueueCandidatesSelector(this));
  }
}
 
开发者ID:hopshadoop,项目:hops,完整代码来源:ProportionalCapacityPreemptionPolicy.java



注:本文示例均筛选自Github平台上各路大神开发的开源项目,代码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。