• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RMContainerEventType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



RMContainerEventType类属于org.apache.hadoop.yarn.server.resourcemanager.rmcontainer包,在下文中一共展示了RMContainerEventType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: removeNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
private synchronized void removeNode(RMNode nodeInfo) {
  FiCaSchedulerNode node = getNode(nodeInfo.getNodeID());
  if (node == null) {
    return;
  }
  // Kill running containers
  for(RMContainer container : node.getRunningContainers()) {
    completedContainer(container, 
        SchedulerUtils.createAbnormalContainerStatus(
            container.getContainerId(), 
            SchedulerUtils.LOST_CONTAINER),
            RMContainerEventType.KILL);
  }
  
  //Remove the node
  this.nodes.remove(nodeInfo.getNodeID());
  updateMaximumAllocation(node, false);
  
  // Update cluster metrics
  Resources.subtractFrom(clusterResource, node.getRMNode().getTotalCapability());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:FifoScheduler.java


示例2: releaseContainers

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
protected void releaseContainers(List<ContainerId> containers,
    SchedulerApplicationAttempt attempt) {
  for (ContainerId containerId : containers) {
    RMContainer rmContainer = getRMContainer(containerId);
    if (rmContainer == null) {
      if (System.currentTimeMillis() - ResourceManager.getClusterTimeStamp()
          < nmExpireInterval) {
        LOG.info(containerId + " doesn't exist. Add the container"
            + " to the release request cache as it maybe on recovery.");
        synchronized (attempt) {
          attempt.getPendingRelease().add(containerId);
        }
      } else {
        RMAuditLogger.logFailure(attempt.getUser(),
          AuditConstants.RELEASE_CONTAINER,
          "Unauthorized access or invalid container", "Scheduler",
          "Trying to release container not owned by app or with invalid id.",
          attempt.getApplicationId(), containerId);
      }
    }
    completedContainer(rmContainer,
      SchedulerUtils.createAbnormalContainerStatus(containerId,
        SchedulerUtils.RELEASED_CONTAINER), RMContainerEventType.RELEASED);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:AbstractYarnScheduler.java


示例3: removeNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
private synchronized void removeNode(RMNode nodeInfo) {
  FiCaSchedulerNode node = getNode(nodeInfo.getNodeID());
  if (node == null) {
    return;
  }
  // Kill running containers
  for(RMContainer container : node.getRunningContainers()) {
    completedContainer(container, 
        SchedulerUtils.createAbnormalContainerStatus(
            container.getContainerId(), 
            SchedulerUtils.LOST_CONTAINER),
            RMContainerEventType.KILL);
  }
  
  //Remove the node
  this.nodes.remove(nodeInfo.getNodeID());
  updateMaximumAllocation(node, false);
  
  // Update cluster metrics
  Resources.subtractFrom(clusterResource, node.getTotalResource());
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:22,代码来源:FifoScheduler.java


示例4: completedContainer

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
@Override
public void completedContainer(Resource clusterResource,
    FiCaSchedulerApp application, FiCaSchedulerNode node, 
    RMContainer rmContainer, ContainerStatus containerStatus, 
    RMContainerEventType event, CSQueue completedChildQueue,
    boolean sortQueues) {
  if (application != null) {
    internalReleaseResource(clusterResource, node,
        rmContainer.getContainer().getResource(), false, completedChildQueue,
        sortQueues);

    // Inform the parent
    if (parent != null) {
      // complete my parent
      parent.completedContainer(clusterResource, application, 
          node, rmContainer, null, event, this, sortQueues);
    }    
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:20,代码来源:ParentQueue.java


示例5: handleExcessReservedContainer

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
private void handleExcessReservedContainer(Resource clusterResource,
    CSAssignment assignment, FiCaSchedulerNode node, FiCaSchedulerApp app) {
  if (assignment.getExcessReservation() != null) {
    RMContainer excessReservedContainer = assignment.getExcessReservation();
    
    if (excessReservedContainer.hasIncreaseReservation()) {
      unreserveIncreasedContainer(clusterResource,
          app, node, excessReservedContainer);
    } else {
      completedContainer(clusterResource, assignment.getApplication(),
          scheduler.getNode(excessReservedContainer.getAllocatedNode()),
          excessReservedContainer,
          SchedulerUtils.createAbnormalContainerStatus(
              excessReservedContainer.getContainerId(),
              SchedulerUtils.UNRESERVED_CONTAINER),
          RMContainerEventType.RELEASED, null, false);
    }

    assignment.setExcessReservation(null);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:22,代码来源:LeafQueue.java


示例6: adjusctContianerResouce

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
public synchronized void adjusctContianerResouce(ContainerId contianerId, Resource resource){
 
 RMContainer container = getRMContainer(contianerId);
 //get original resource
 Resource allocatedResource = container.getAllocatedResource();
 Resource marginalResource=Resources.subtract(allocatedResource, resource);
 
 if(marginalResource.getMemory() > 0 ){		  
  LOG.info("increase memory on continaer"+contianerId.getContainerId()+"by"+marginalResource.getMemory());		  
 }else{		  
  LOG.info("decrease memory on continaer"+contianerId.getContainerId()+"by"+marginalResource.getMemory());
 }
 
 if(marginalResource.getVirtualCores() > 0){
  LOG.info("increase cores on contianer"+contianerId.getContainerId()+"by"+marginalResource.getVirtualCores());
 }else{
  LOG.info("dncrease cores on contianer"+contianerId.getContainerId()+"by"+marginalResource.getVirtualCores());
 }
 
 SchedulerNode schedulerNode = getSchedulerNode(container.getAllocatedNode());
 //now inform the schedulerNode to adjust resurce assumption
 schedulerNode.addAvailableResource(marginalResource);
 //now inform RMContinaer to adjuct its allocatedResource
 container.handle(new RMContainerResourceUpdateEvent(contianerId, RMContainerEventType.RESOURCE_UPDATE, resource));
 	  
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:27,代码来源:AbstractYarnScheduler.java


示例7: removeNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
private synchronized void removeNode(RMNode nodeInfo) {
  FiCaSchedulerNode node = getNode(nodeInfo.getNodeID());
  if (node == null) {
    return;
  }
  // Kill running containers
  for(RMContainer container : node.getRunningContainers()) {
    containerCompleted(container, 
        SchedulerUtils.createAbnormalContainerStatus(
            container.getContainerId(), 
            SchedulerUtils.LOST_CONTAINER),
            RMContainerEventType.KILL);
  }
  
  //Remove the node
  this.nodes.remove(nodeInfo.getNodeID());
  
  // Update cluster metrics
  Resources.subtractFrom(clusterResource, node.getRMNode().getTotalCapability());
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:21,代码来源:FifoScheduler.java


示例8: containerLaunchedOnNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public synchronized void containerLaunchedOnNode(ContainerId containerId,
    NodeId nodeId) {
  // Inform the container
  RMContainer rmContainer = 
      getRMContainer(containerId);
  if (rmContainer == null) {
    // Some unknown container sneaked into the system. Kill it.
    rmContext.getDispatcher().getEventHandler()
      .handle(new RMNodeCleanContainerEvent(nodeId, containerId));
    return;
  }

  rmContainer.handle(new RMContainerEvent(containerId,
    RMContainerEventType.LAUNCHED));
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:17,代码来源:FSSchedulerApp.java


示例9: removeNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
private synchronized void removeNode(RMNode nodeInfo) {
  FiCaSchedulerNode node = getNode(nodeInfo.getNodeID());
  if (node == null) {
    return;
  }
  // Kill running containers
  for(RMContainer container : node.getCopiedListOfRunningContainers()) {
    super.completedContainer(container,
        SchedulerUtils.createAbnormalContainerStatus(
            container.getContainerId(), 
            SchedulerUtils.LOST_CONTAINER),
            RMContainerEventType.KILL);
  }
  
  //Remove the node
  this.nodes.remove(nodeInfo.getNodeID());
  updateMaximumAllocation(node, false);
  
  // Update cluster metrics
  Resources.subtractFrom(clusterResource, node.getTotalResource());
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:22,代码来源:FifoScheduler.java


示例10: completedContainer

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
@VisibleForTesting
@Private
// clean up a completed container
public void completedContainer(RMContainer rmContainer,
    ContainerStatus containerStatus, RMContainerEventType event) {

  if (rmContainer == null) {
    LOG.info("Container " + containerStatus.getContainerId()
        + " completed with event " + event
        + ", but corresponding RMContainer doesn't exist.");
    return;
  }

  completedContainerInternal(rmContainer, containerStatus, event);

  // If the container is getting killed in ACQUIRED state, the requester (AM
  // for regular containers and RM itself for AM container) will not know what
  // happened. Simply add the ResourceRequest back again so that requester
  // doesn't need to do anything conditionally.
  recoverResourceRequestForContainer(rmContainer);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:22,代码来源:AbstractYarnScheduler.java


示例11: completedContainerInternal

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
@Override
protected void completedContainerInternal(
    RMContainer rmContainer, ContainerStatus containerStatus,
    RMContainerEventType event) {
  Container container = rmContainer.getContainer();
  ContainerId containerId = container.getId();
  
  // Get the application for the finished container
  FiCaSchedulerApp application =
      getCurrentAttemptForContainer(container.getId());
  ApplicationId appId =
      containerId.getApplicationAttemptId().getApplicationId();
  if (application == null) {
    LOG.info("Container " + container + " of" + " finished application "
        + appId + " completed with event " + event);
    return;
  }
  
  // Get the node on which the container was allocated
  FiCaSchedulerNode node = getNode(container.getNodeId());
  
  // Inform the queue
  LeafQueue queue = (LeafQueue)application.getQueue();
  queue.completedContainer(clusterResource, application, node, 
      rmContainer, containerStatus, event, null, true);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:27,代码来源:CapacityScheduler.java


示例12: killToPreemptContainers

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
private void killToPreemptContainers(Resource clusterResource,
    FiCaSchedulerNode node,
    CSAssignment assignment) {
  if (assignment.getContainersToKill() != null) {
    StringBuilder sb = new StringBuilder("Killing containers: [");

    for (RMContainer c : assignment.getContainersToKill()) {
      FiCaSchedulerApp application = csContext.getApplicationAttempt(
          c.getApplicationAttemptId());
      LeafQueue q = application.getCSLeafQueue();
      q.completedContainer(clusterResource, application, node, c, SchedulerUtils
              .createPreemptedContainerStatus(c.getContainerId(),
                  SchedulerUtils.PREEMPTED_CONTAINER), RMContainerEventType.KILL,
          null, false);
      sb.append("(container=" + c.getContainerId() + " resource=" + c
          .getAllocatedResource() + ")");
    }

    sb.append("] for container=" + assignment.getAssignmentInformation()
        .getFirstAllocatedOrReservedContainerId() + " resource=" + assignment
        .getResource());
    LOG.info(sb.toString());

  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:26,代码来源:LeafQueue.java


示例13: doneApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
private synchronized void doneApplicationAttempt(
    ApplicationAttemptId applicationAttemptId,
    RMAppAttemptState rmAppAttemptFinalState, boolean keepContainers)
    throws IOException {
  FiCaSchedulerApp attempt = getApplicationAttempt(applicationAttemptId);
  SchedulerApplication<FiCaSchedulerApp> application =
      applications.get(applicationAttemptId.getApplicationId());
  if (application == null || attempt == null) {
    throw new IOException("Unknown application " + applicationAttemptId + 
    " has completed!");
  }

  // Kill all 'live' containers
  for (RMContainer container : attempt.getLiveContainers()) {
    if (keepContainers
        && container.getState().equals(RMContainerState.RUNNING)) {
      // do not kill the running container in the case of work-preserving AM
      // restart.
      LOG.info("Skip killing " + container.getContainerId());
      continue;
    }
    completedContainer(container,
      SchedulerUtils.createAbnormalContainerStatus(
        container.getContainerId(), SchedulerUtils.COMPLETED_APPLICATION),
      RMContainerEventType.KILL);
  }

  // Clean up pending requests, metrics etc.
  attempt.stop(rmAppAttemptFinalState);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:31,代码来源:FifoScheduler.java


示例14: containerLaunchedOnNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public synchronized void containerLaunchedOnNode(ContainerId containerId,
    NodeId nodeId) {
  // Inform the container
  RMContainer rmContainer = getRMContainer(containerId);
  if (rmContainer == null) {
    // Some unknown container sneaked into the system. Kill it.
    rmContext.getDispatcher().getEventHandler()
      .handle(new RMNodeCleanContainerEvent(nodeId, containerId));
    return;
  }

  rmContainer.handle(new RMContainerEvent(containerId,
      RMContainerEventType.LAUNCHED));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:SchedulerApplicationAttempt.java


示例15: pullNewlyAllocatedContainersAndNMTokens

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
public synchronized ContainersAndNMTokensAllocation
    pullNewlyAllocatedContainersAndNMTokens() {
  List<Container> returnContainerList =
      new ArrayList<Container>(newlyAllocatedContainers.size());
  List<NMToken> nmTokens = new ArrayList<NMToken>();
  for (Iterator<RMContainer> i = newlyAllocatedContainers.iterator(); i
    .hasNext();) {
    RMContainer rmContainer = i.next();
    Container container = rmContainer.getContainer();
    try {
      // create container token and NMToken altogether.
      container.setContainerToken(rmContext.getContainerTokenSecretManager()
        .createContainerToken(container.getId(), container.getNodeId(),
          getUser(), container.getResource(), container.getPriority(),
          rmContainer.getCreationTime(), this.logAggregationContext));
      NMToken nmToken =
          rmContext.getNMTokenSecretManager().createAndGetNMToken(getUser(),
            getApplicationAttemptId(), container);
      if (nmToken != null) {
        nmTokens.add(nmToken);
      }
    } catch (IllegalArgumentException e) {
      // DNS might be down, skip returning this container.
      LOG.error("Error trying to assign container token and NM token to" +
          " an allocated container " + container.getId(), e);
      continue;
    }
    returnContainerList.add(container);
    i.remove();
    rmContainer.handle(new RMContainerEvent(rmContainer.getContainerId(),
      RMContainerEventType.ACQUIRED));
  }
  return new ContainersAndNMTokensAllocation(returnContainerList, nmTokens);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:35,代码来源:SchedulerApplicationAttempt.java


示例16: warnOrKillContainer

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的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


示例17: completedContainer

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
/**
 * Clean up a completed container.
 */
@Override
protected synchronized void completedContainer(RMContainer rmContainer,
    ContainerStatus containerStatus, RMContainerEventType event) {
  if (rmContainer == null) {
    LOG.info("Null container completed...");
    return;
  }

  Container container = rmContainer.getContainer();

  // Get the application for the finished container
  FSAppAttempt application =
      getCurrentAttemptForContainer(container.getId());
  ApplicationId appId =
      container.getId().getApplicationAttemptId().getApplicationId();
  if (application == null) {
    LOG.info("Container " + container + " of" +
        " unknown application attempt " + appId +
        " completed with event " + event);
    return;
  }

  // Get the node on which the container was allocated
  FSSchedulerNode node = getFSSchedulerNode(container.getNodeId());

  if (rmContainer.getState() == RMContainerState.RESERVED) {
    application.unreserve(rmContainer.getReservedPriority(), node);
  } else {
    application.containerCompleted(rmContainer, containerStatus, event);
    node.releaseContainer(container);
    updateRootQueueMetrics();
  }

  LOG.info("Application attempt " + application.getApplicationAttemptId()
      + " released container " + container.getId() + " on node: " + node
      + " with event: " + event);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:41,代码来源:FairScheduler.java


示例18: removeNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
private synchronized void removeNode(RMNode rmNode) {
  FSSchedulerNode node = getFSSchedulerNode(rmNode.getNodeID());
  // This can occur when an UNHEALTHY node reconnects
  if (node == null) {
    return;
  }
  Resources.subtractFrom(clusterResource, rmNode.getTotalCapability());
  updateRootQueueMetrics();

  // Remove running containers
  List<RMContainer> runningContainers = node.getRunningContainers();
  for (RMContainer container : runningContainers) {
    completedContainer(container,
        SchedulerUtils.createAbnormalContainerStatus(
            container.getContainerId(),
            SchedulerUtils.LOST_CONTAINER),
        RMContainerEventType.KILL);
  }

  // Remove reservations, if any
  RMContainer reservedContainer = node.getReservedContainer();
  if (reservedContainer != null) {
    completedContainer(reservedContainer,
        SchedulerUtils.createAbnormalContainerStatus(
            reservedContainer.getContainerId(),
            SchedulerUtils.LOST_CONTAINER),
        RMContainerEventType.KILL);
  }

  nodes.remove(rmNode.getNodeID());
  queueMgr.getRootQueue().setSteadyFairShare(clusterResource);
  queueMgr.getRootQueue().recomputeSteadyShares();
  updateMaximumAllocation(node, false);
  LOG.info("Removed node " + rmNode.getNodeAddress() +
      " cluster capacity: " + clusterResource);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:37,代码来源:FairScheduler.java


示例19: nodeUpdate

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
/**
 * Process a heartbeat update from a node.
 */
private synchronized void nodeUpdate(RMNode nm) {
  long start = getClock().getTime();
  if (LOG.isDebugEnabled()) {
    LOG.debug("nodeUpdate: " + nm + " cluster capacity: " + clusterResource);
  }
  eventLog.log("HEARTBEAT", nm.getHostName());
  FSSchedulerNode node = getFSSchedulerNode(nm.getNodeID());
  
  List<UpdatedContainerInfo> containerInfoList = nm.pullContainerUpdates();
  List<ContainerStatus> newlyLaunchedContainers = new ArrayList<ContainerStatus>();
  List<ContainerStatus> completedContainers = new ArrayList<ContainerStatus>();
  for(UpdatedContainerInfo containerInfo : containerInfoList) {
    newlyLaunchedContainers.addAll(containerInfo.getNewlyLaunchedContainers());
    completedContainers.addAll(containerInfo.getCompletedContainers());
  } 
  // Processing the newly launched containers
  for (ContainerStatus launchedContainer : newlyLaunchedContainers) {
    containerLaunchedOnNode(launchedContainer.getContainerId(), node);
  }

  // Process completed containers
  for (ContainerStatus completedContainer : completedContainers) {
    ContainerId containerId = completedContainer.getContainerId();
    LOG.debug("Container FINISHED: " + containerId);
    completedContainer(getRMContainer(containerId),
        completedContainer, RMContainerEventType.FINISHED);
  }

  if (continuousSchedulingEnabled) {
    if (!completedContainers.isEmpty()) {
      attemptScheduling(node);
    }
  } else {
    attemptScheduling(node);
  }

  long duration = getClock().getTime() - start;
  fsOpDurations.addNodeUpdateDuration(duration);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:43,代码来源:FairScheduler.java


示例20: containerCompleted

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEventType; //导入依赖的package包/类
synchronized public void containerCompleted(RMContainer rmContainer,
    ContainerStatus containerStatus, RMContainerEventType event) {
  
  Container container = rmContainer.getContainer();
  ContainerId containerId = container.getId();
  
  // Remove from the list of newly allocated containers if found
  newlyAllocatedContainers.remove(rmContainer);
  
  // Inform the container
  rmContainer.handle(
      new RMContainerFinishedEvent(
          containerId,
          containerStatus, 
          event)
      );
  LOG.info("Completed container: " + rmContainer.getContainerId() + 
      " in state: " + rmContainer.getState() + " event:" + event);
  
  // Remove from the list of containers
  liveContainers.remove(rmContainer.getContainerId());

  RMAuditLogger.logSuccess(getUser(), 
      AuditConstants.RELEASE_CONTAINER, "SchedulerApp", 
      getApplicationId(), containerId);
  
  // Update usage metrics 
  Resource containerResource = rmContainer.getContainer().getResource();
  queue.getMetrics().releaseResources(getUser(), 1, containerResource);
  this.attemptResourceUsage.decUsed(containerResource);

  // remove from preemption map if it is completed
  preemptionMap.remove(rmContainer);

  // Clear resource utilization metrics cache.
  lastMemoryAggregateAllocationUpdateTime = -1;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:38,代码来源:FSAppAttempt.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockCommandProto类代码示例发布时间:2022-05-22
下一篇:
Java ContactInfoList类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap