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


Java SchedulerUtils.createPreemptedContainerStatus方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils.createPreemptedContainerStatus方法的典型用法代码示例。如果您正苦于以下问题:Java SchedulerUtils.createPreemptedContainerStatus方法的具体用法?Java SchedulerUtils.createPreemptedContainerStatus怎么用?Java SchedulerUtils.createPreemptedContainerStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils的用法示例。


在下文中一共展示了SchedulerUtils.createPreemptedContainerStatus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: warnOrKillContainer

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils; //导入方法依赖的package包/类
protected void warnOrKillContainer(RMContainer container) {
  ApplicationAttemptId appAttemptId = container.getApplicationAttemptId();
  FSAppAttempt app = getSchedulerApp(appAttemptId);
  FSLeafQueue queue = app.getQueue();
  LOG.info("Preempting container (prio=" + container.getContainer().getPriority() +
      "res=" + container.getContainer().getResource() +
      ") from queue " + queue.getName());
  
  Long time = app.getContainerPreemptionTime(container);

  if (time != null) {
    // if we asked for preemption more than maxWaitTimeBeforeKill ms ago,
    // proceed with kill
    if (time + waitTimeBeforeKill < getClock().getTime()) {
      ContainerStatus status =
        SchedulerUtils.createPreemptedContainerStatus(
          container.getContainerId(), SchedulerUtils.PREEMPTED_CONTAINER);

      recoverResourceRequestForContainer(container);
      // TODO: Not sure if this ever actually adds this to the list of cleanup
      // containers on the RMNode (see SchedulerNode.releaseContainer()).
      completedContainer(container, status, RMContainerEventType.KILL);
      LOG.info("Killing container" + container +
          " (after waiting for premption for " +
          (getClock().getTime() - time) + "ms)");
    }
  } else {
    // track the request in the FSAppAttempt itself
    app.addPreemption(container, getClock().getTime());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:32,代码来源:FairScheduler.java

示例2: warnOrKillContainer

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils; //导入方法依赖的package包/类
protected void warnOrKillContainer(RMContainer container) {
  ApplicationAttemptId appAttemptId = container.getApplicationAttemptId();
  FSAppAttempt app = getSchedulerApp(appAttemptId);
  FSLeafQueue queue = app.getQueue();
  LOG.info("Preempting container (prio=" + container.getContainer().getPriority() +
      "res=" + container.getContainer().getResource() +
      ") from queue " + queue.getName());
  
  Long time = app.getContainerPreemptionTime(container);

  if (time != null) {
    // if we asked for preemption more than maxWaitTimeBeforeKill ms ago,
    // proceed with kill
    if (time + waitTimeBeforeKill < getClock().getTime()) {
      ContainerStatus status =
        SchedulerUtils.createPreemptedContainerStatus(
          container.getContainerId(), SchedulerUtils.PREEMPTED_CONTAINER);

      // TODO: Not sure if this ever actually adds this to the list of cleanup
      // containers on the RMNode (see SchedulerNode.releaseContainer()).
      completedContainer(container, status, RMContainerEventType.KILL);
      LOG.info("Killing container" + container +
          " (after waiting for preemption for " +
          (getClock().getTime() - time) + "ms)");
    }
  } else {
    // track the request in the FSAppAttempt itself
    app.addPreemption(container, getClock().getTime());
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:31,代码来源:FairScheduler.java

示例3: warnOrKillContainer

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils; //导入方法依赖的package包/类
protected void warnOrKillContainer(RMContainer container) {
  ApplicationAttemptId appAttemptId = container.getApplicationAttemptId();
  FSAppAttempt app = getSchedulerApp(appAttemptId);
  FSLeafQueue queue = app.getQueue();
  LOG.info("Preempting container (prio=" + container.getContainer().getPriority() +
      "res=" + container.getContainer().getResource() +
      ") from queue " + queue.getName());
  
  Long time = app.getContainerPreemptionTime(container);

  if (time != null) {
    // if we asked for preemption more than maxWaitTimeBeforeKill ms ago,
    // proceed with kill
    if (time + waitTimeBeforeKill < getClock().getTime()) {
      ContainerStatus status =
        SchedulerUtils.createPreemptedContainerStatus(
          container.getContainerId(), SchedulerUtils.PREEMPTED_CONTAINER);

      // TODO: Not sure if this ever actually adds this to the list of cleanup
      // containers on the RMNode (see SchedulerNode.releaseContainer()).
      super.completedContainer(container, status, RMContainerEventType.KILL);
      LOG.info("Killing container" + container +
          " (after waiting for preemption for " +
          (getClock().getTime() - time) + "ms)");
    }
  } else {
    // track the request in the FSAppAttempt itself
    app.addPreemption(container, getClock().getTime());
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:31,代码来源:FairScheduler.java

示例4: markContainerForKillable

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils; //导入方法依赖的package包/类
public synchronized void markContainerForKillable(
    RMContainer killableContainer) {
  if (LOG.isDebugEnabled()) {
    LOG.debug(SchedulerEventType.MARK_CONTAINER_FOR_KILLABLE + ": container"
        + killableContainer.toString());
  }

  if (!isLazyPreemptionEnabled) {
    super.completedContainer(killableContainer, SchedulerUtils
        .createPreemptedContainerStatus(killableContainer.getContainerId(),
            SchedulerUtils.PREEMPTED_CONTAINER), RMContainerEventType.KILL);
  } else {
    FiCaSchedulerNode node = (FiCaSchedulerNode) getSchedulerNode(
        killableContainer.getAllocatedNode());

    FiCaSchedulerApp application = getCurrentAttemptForContainer(
        killableContainer.getContainerId());

    node.markContainerToKillable(killableContainer.getContainerId());

    // notify PreemptionManager
    // Get the application for the finished container
    if (null != application) {
      String leafQueueName = application.getCSLeafQueue().getQueueName();
      getPreemptionManager().addKillableContainer(
          new KillableContainer(killableContainer, node.getPartition(),
              leafQueueName));
    }    }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:30,代码来源:CapacityScheduler.java

示例5: warnOrKillContainer

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils; //导入方法依赖的package包/类
private void warnOrKillContainer(RMContainer container, FSSchedulerApp app,
    FSLeafQueue queue) {
  LOG.info("Preempting container (prio=" + container.getContainer().getPriority() +
      "res=" + container.getContainer().getResource() +
      ") from queue " + queue.getName());
  
  Long time = app.getContainerPreemptionTime(container);

  if (time != null) {
    // if we asked for preemption more than maxWaitTimeBeforeKill ms ago,
    // proceed with kill
    if (time + waitTimeBeforeKill < clock.getTime()) {
      ContainerStatus status =
        SchedulerUtils.createPreemptedContainerStatus(
          container.getContainerId(), SchedulerUtils.PREEMPTED_CONTAINER);

      // TODO: Not sure if this ever actually adds this to the list of cleanup
      // containers on the RMNode (see SchedulerNode.releaseContainer()).
      completedContainer(container, status, RMContainerEventType.KILL);
      LOG.info("Killing container" + container +
          " (after waiting for premption for " +
          (clock.getTime() - time) + "ms)");
    }
  } else {
    // track the request in the FSSchedulerApp itself
    app.addPreemption(container, clock.getTime());
  }
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:29,代码来源:FairScheduler.java


注:本文中的org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils.createPreemptedContainerStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。