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

Java RMContainerEvent类代码示例

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

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



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

示例1: containerLaunchedOnNode

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


示例2: containerLaunchedOnNode

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


示例3: pullNewlyAllocatedContainersAndNMTokens

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


示例4: updateContainerAndNMToken

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
private Container updateContainerAndNMToken(RMContainer rmContainer,
    boolean newContainer, boolean increasedContainer) {
  Container container = rmContainer.getContainer();
  ContainerType containerType = ContainerType.TASK;
  // The working knowledge is that masterContainer for AM is null as it
  // itself is the master container.
  if (isWaitingForAMContainer()) {
    containerType = ContainerType.APPLICATION_MASTER;
  }
  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,
            rmContainer.getNodeLabelExpression(), containerType));
    NMToken nmToken =
        rmContext.getNMTokenSecretManager().createAndGetNMToken(getUser(),
            getApplicationAttemptId(), container);
    if (nmToken != null) {
      updatedNMTokens.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 updated container " + container.getId(), e);
    return null;
  }
  
  if (newContainer) {
    rmContainer.handle(new RMContainerEvent(
        rmContainer.getContainerId(), RMContainerEventType.ACQUIRED));
  } else {
    rmContainer.handle(new RMContainerUpdatesAcquiredEvent(
        rmContainer.getContainerId(), increasedContainer));
  }
  return container;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:39,代码来源:SchedulerApplicationAttempt.java


示例5: sentRMContainerLaunched

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
private void sentRMContainerLaunched(MockRM rm, ContainerId containerId) {
  CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
  RMContainer rmContainer = cs.getRMContainer(containerId);
  if (rmContainer != null) {
    rmContainer.handle(
        new RMContainerEvent(containerId, RMContainerEventType.LAUNCHED));
  } else {
    Assert.fail("Cannot find RMContainer");
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:11,代码来源:TestApplicationMasterService.java


示例6: pullNewlyAllocatedContainers

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
synchronized public List<Container> pullNewlyAllocatedContainers() {
  List<Container> returnContainerList = new ArrayList<Container>(
      newlyAllocatedContainers.size());
  for (RMContainer rmContainer : newlyAllocatedContainers) {
    rmContainer.handle(new RMContainerEvent(rmContainer.getContainerId(),
        RMContainerEventType.ACQUIRED));
    returnContainerList.add(rmContainer.getContainer());
  }
  newlyAllocatedContainers.clear();
  return returnContainerList;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:12,代码来源:FSSchedulerApp.java


示例7: containerLaunchedOnNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
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.
    this.rmContext.getDispatcher().getEventHandler()
      .handle(new RMNodeCleanContainerEvent(nodeId, containerId));
    return;
  }

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


示例8: pullNewlyAllocatedContainersAndNMTokens

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的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()));
      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:Seagate,项目名称:hadoop-on-lustre2,代码行数:34,代码来源:SchedulerApplicationAttempt.java


示例9: allocate

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
synchronized public RMContainer allocate(NodeType type, FSSchedulerNode node,
    Priority priority, ResourceRequest request,
    Container container) {
  // Update allowed locality level
  NodeType allowed = allowedLocalityLevel.get(priority);
  if (allowed != null) {
    if (allowed.equals(NodeType.OFF_SWITCH) &&
        (type.equals(NodeType.NODE_LOCAL) ||
            type.equals(NodeType.RACK_LOCAL))) {
      this.resetAllowedLocalityLevel(priority, type);
    }
    else if (allowed.equals(NodeType.RACK_LOCAL) &&
        type.equals(NodeType.NODE_LOCAL)) {
      this.resetAllowedLocalityLevel(priority, type);
    }
  }

  // Required sanity check - AM can call 'allocate' to update resource 
  // request without locking the scheduler, hence we need to check
  if (getTotalRequiredResources(priority) <= 0) {
    return null;
  }
  
  // Create RMContainer
  RMContainer rmContainer = new RMContainerImpl(container, 
      getApplicationAttemptId(), node.getNodeID(),
      appSchedulingInfo.getUser(), rmContext);

  // Add it to allContainers list.
  newlyAllocatedContainers.add(rmContainer);
  liveContainers.put(container.getId(), rmContainer);    

  // Update consumption and track allocations
  List<ResourceRequest> resourceRequestList = appSchedulingInfo.allocate(
      type, node, priority, request, container);
  this.attemptResourceUsage.incUsed(container.getResource());

  // Update resource requests related to "request" and store in RMContainer
  ((RMContainerImpl) rmContainer).setResourceRequests(resourceRequestList);

  // Inform the container
  rmContainer.handle(
      new RMContainerEvent(container.getId(), RMContainerEventType.START));

  if (LOG.isDebugEnabled()) {
    LOG.debug("allocate: applicationAttemptId=" 
        + container.getId().getApplicationAttemptId() 
        + " container=" + container.getId() + " host="
        + container.getNodeId().getHost() + " type=" + type);
  }
  RMAuditLogger.logSuccess(getUser(), 
      AuditConstants.ALLOC_CONTAINER, "SchedulerApp", 
      getApplicationId(), container.getId());
  
  return rmContainer;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:57,代码来源:FSAppAttempt.java


示例10: allocate

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
synchronized public RMContainer allocate(NodeType type, FiCaSchedulerNode node,
    Priority priority, ResourceRequest request, 
    Container container) {

  if (isStopped) {
    return null;
  }
  
  // Required sanity check - AM can call 'allocate' to update resource 
  // request without locking the scheduler, hence we need to check
  if (getTotalRequiredResources(priority) <= 0) {
    return null;
  }
  
  // Create RMContainer
  RMContainer rmContainer = new RMContainerImpl(container, this
      .getApplicationAttemptId(), node.getNodeID(),
      appSchedulingInfo.getUser(), this.rmContext);

  // Add it to allContainers list.
  newlyAllocatedContainers.add(rmContainer);
  liveContainers.put(container.getId(), rmContainer);    

  // Update consumption and track allocations
  List<ResourceRequest> resourceRequestList = appSchedulingInfo.allocate(
      type, node, priority, request, container);

  attemptResourceUsage.incUsed(node.getPartition(), container.getResource());

  // Update resource requests related to "request" and store in RMContainer
  ((RMContainerImpl)rmContainer).setResourceRequests(resourceRequestList);

  // Inform the container
  rmContainer.handle(
      new RMContainerEvent(container.getId(), RMContainerEventType.START));

  if (LOG.isDebugEnabled()) {
    LOG.debug("allocate: applicationAttemptId=" 
        + container.getId().getApplicationAttemptId() 
        + " container=" + container.getId() + " host="
        + container.getNodeId().getHost() + " type=" + type);
  }
  RMAuditLogger.logSuccess(getUser(),
      AuditConstants.ALLOC_CONTAINER, "SchedulerApp",
      getApplicationId(), container.getId());
  
  return rmContainer;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:49,代码来源:FiCaSchedulerApp.java


示例11: containerIncreasedOnNode

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
protected synchronized void containerIncreasedOnNode(ContainerId containerId,
    SchedulerNode node, Container increasedContainerReportedByNM) {
  // Get the application for the finished container
  SchedulerApplicationAttempt application =
      getCurrentAttemptForContainer(containerId);
  if (application == null) {
    LOG.info("Unknown application "
        + containerId.getApplicationAttemptId().getApplicationId()
        + " increased container " + containerId + " on node: " + node);
    this.rmContext.getDispatcher().getEventHandler()
        .handle(new RMNodeCleanContainerEvent(node.getNodeID(), containerId));
    return;
  }

  RMContainer rmContainer = getRMContainer(containerId);
  Resource rmContainerResource = rmContainer.getAllocatedResource();
  Resource nmContainerResource = increasedContainerReportedByNM.getResource();
  
  
  if (Resources.equals(nmContainerResource, rmContainerResource)){
    // NM reported expected container size, tell RMContainer. Which will stop
    // container expire monitor
    rmContainer.handle(new RMContainerEvent(containerId,
        RMContainerEventType.NM_DONE_CHANGE_RESOURCE));
  } else if (Resources.fitsIn(getResourceCalculator(), clusterResource,
      nmContainerResource, rmContainerResource)) {
    // when rmContainerResource >= nmContainerResource, we won't do anything,
    // it is possible a container increased is issued by RM, but AM hasn't
    // told NM.
  } else if (Resources.fitsIn(getResourceCalculator(), clusterResource,
      rmContainerResource, nmContainerResource)) {
    // When rmContainerResource <= nmContainerResource, it could happen when a
    // container decreased by RM before it is increased in NM.
    
    // Tell NM to decrease the container
    this.rmContext.getDispatcher().getEventHandler()
        .handle(new RMNodeDecreaseContainerEvent(node.getNodeID(),
            Arrays.asList(rmContainer.getContainer())));
  } else {
    // Something wrong happened, kill the container
    LOG.warn("Something wrong happened, container size reported by NM"
        + " is not expected, ContainerID=" + containerId
        + " rm-size-resource:" + rmContainerResource + " nm-size-reosurce:"
        + nmContainerResource);
    this.rmContext.getDispatcher().getEventHandler()
        .handle(new RMNodeCleanContainerEvent(node.getNodeID(), containerId));
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:49,代码来源:AbstractYarnScheduler.java


示例12: allocate

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
synchronized public RMContainer allocate(NodeType type, FiCaSchedulerNode node,
    Priority priority, ResourceRequest request, 
    Container container) {

  if (isStopped) {
    return null;
  }
  
  // Required sanity check - AM can call 'allocate' to update resource 
  // request without locking the scheduler, hence we need to check
  if (getTotalRequiredResources(priority) <= 0) {
    return null;
  }
  
  // Create RMContainer
  RMContainer rmContainer =
      new RMContainerImpl(container, this.getApplicationAttemptId(),
          node.getNodeID(), appSchedulingInfo.getUser(), this.rmContext,
          request.getNodeLabelExpression());

  updateAMContainerDiagnostics(AMState.ASSIGNED, null);

  // Add it to allContainers list.
  newlyAllocatedContainers.add(rmContainer);
  liveContainers.put(container.getId(), rmContainer);    

  // Update consumption and track allocations
  List<ResourceRequest> resourceRequestList = appSchedulingInfo.allocate(
      type, node, priority, request, container);

  attemptResourceUsage.incUsed(node.getPartition(), container.getResource());

  // Update resource requests related to "request" and store in RMContainer
  ((RMContainerImpl)rmContainer).setResourceRequests(resourceRequestList);

  // Inform the container
  rmContainer.handle(
      new RMContainerEvent(container.getId(), RMContainerEventType.START));

  if (LOG.isDebugEnabled()) {
    LOG.debug("allocate: applicationAttemptId=" 
        + container.getId().getApplicationAttemptId() 
        + " container=" + container.getId() + " host="
        + container.getNodeId().getHost() + " type=" + type);
  }
  RMAuditLogger.logSuccess(getUser(),
      AuditConstants.ALLOC_CONTAINER, "SchedulerApp",
      getApplicationId(), container.getId());
  
  return rmContainer;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:52,代码来源:FiCaSchedulerApp.java


示例13: allocate

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
synchronized public RMContainer allocate(NodeType type, FSSchedulerNode node,
    Priority priority, ResourceRequest request,
    Container container) {
  // Update allowed locality level
  NodeType allowed = allowedLocalityLevel.get(priority);
  if (allowed != null) {
    if (allowed.equals(NodeType.OFF_SWITCH) &&
        (type.equals(NodeType.NODE_LOCAL) ||
            type.equals(NodeType.RACK_LOCAL))) {
      this.resetAllowedLocalityLevel(priority, type);
    }
    else if (allowed.equals(NodeType.RACK_LOCAL) &&
        type.equals(NodeType.NODE_LOCAL)) {
      this.resetAllowedLocalityLevel(priority, type);
    }
  }

  // Required sanity check - AM can call 'allocate' to update resource 
  // request without locking the scheduler, hence we need to check
  if (getTotalRequiredResources(priority) <= 0) {
    return null;
  }
  
  // Create RMContainer
  RMContainer rmContainer = new RMContainerImpl(container, 
      getApplicationAttemptId(), node.getNodeID(),
      appSchedulingInfo.getUser(), rmContext);

  // Add it to allContainers list.
  newlyAllocatedContainers.add(rmContainer);
  liveContainers.put(container.getId(), rmContainer);    

  // Update consumption and track allocations
  List<ResourceRequest> resourceRequestList = appSchedulingInfo.allocate(
      type, node, priority, request, container);
  Resources.addTo(currentConsumption, container.getResource());

  // Update resource requests related to "request" and store in RMContainer
  ((RMContainerImpl) rmContainer).setResourceRequests(resourceRequestList);

  // Inform the container
  rmContainer.handle(
      new RMContainerEvent(container.getId(), RMContainerEventType.START));

  if (LOG.isDebugEnabled()) {
    LOG.debug("allocate: applicationAttemptId=" 
        + container.getId().getApplicationAttemptId() 
        + " container=" + container.getId() + " host="
        + container.getNodeId().getHost() + " type=" + type);
  }
  RMAuditLogger.logSuccess(getUser(), 
      AuditConstants.ALLOC_CONTAINER, "SchedulerApp", 
      getApplicationId(), container.getId());
  
  return rmContainer;
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:57,代码来源:FSAppAttempt.java


示例14: containerResume

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
synchronized public boolean containerResume(RMContainer rmContainer,Resource toResume){
 
 
 
 ContainerId containerId = rmContainer.getContainerId();
 
 if(isStopped){
  return false;
 }
 
 if(!isSuspending){
  return false;
 }
 
 if(!containersSuspended.contains(containerId)){
  return false;
 }
 //add resumed resource
 rmContainer.addResumedResource(toResume);
 
 //we try to update its resource consumption
 rmContainer.handle(
            new RMContainerEvent(containerId,RMContainerEventType.RESUME)  
     );

 //if all of its resource has been resumed
 if(!rmContainer.isSuspending()){
 //delete contaienr from containersSuspended
 this.containersSuspended.remove(containerId);
 }  
 
 //update resource usage
 queue.getMetrics().allocateResources(getUser(), 1, toResume, true);
 //update app resource usage
 Resources.addTo(currentConsumption,toResume);
 //inform RMContainer
 if(this.containersSuspended.size() == 0){  
  isSuspending = false;
  LOG.info("application "+this.getApplicationId()+"has been out of the suspended list");
 }
 
 LOG.info("app "+this.getApplicationAttemptId()+" consume resource"+currentConsumption);

   if (LOG.isDebugEnabled()) {
     LOG.debug("allocate: applicationAttemptId=" 
         + this.getApplicationAttemptId() 
         + " container=" + containerId + " host="
         + rmContainer.getContainer().getNodeId().getHost() 
       );
   }
 
 return true;
 
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:55,代码来源:FiCaSchedulerApp.java


示例15: allocate

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
synchronized public RMContainer allocate(NodeType type, FiCaSchedulerNode node,
    Priority priority, ResourceRequest request, 
    Container container) {

  if (isStopped) {
    return null;
  }
  
  // Required sanity check - AM can call 'allocate' to update resource 
  // request without locking the scheduler, hence we need to check
  if (getTotalRequiredResources(priority) <= 0) {
    return null;
  }
  
  // Create RMContainer
  RMContainer rmContainer = new RMContainerImpl(container, this
      .getApplicationAttemptId(), node.getNodeID(),
      appSchedulingInfo.getUser(), this.rmContext);

  // Add it to allContainers list.
  newlyAllocatedContainers.add(rmContainer);
  liveContainers.put(container.getId(), rmContainer);    

  // Update consumption and track allocations
  List<ResourceRequest> resourceRequestList = appSchedulingInfo.allocate(
      type, node, priority, request, container);
  Resources.addTo(currentConsumption, container.getResource());
  
  // Update resource requests related to "request" and store in RMContainer 
  ((RMContainerImpl)rmContainer).setResourceRequests(resourceRequestList);

  // Inform the container
  rmContainer.handle(
      new RMContainerEvent(container.getId(), RMContainerEventType.START));

  if (LOG.isDebugEnabled()) {
    LOG.debug("allocate: applicationAttemptId=" 
        + container.getId().getApplicationAttemptId() 
        + " container=" + container.getId() + " host="
        + container.getNodeId().getHost() + " type=" + type);
  }
  RMAuditLogger.logSuccess(getUser(), 
      AuditConstants.ALLOC_CONTAINER, "SchedulerApp", 
      getApplicationId(), container.getId());
  
  return rmContainer;
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:48,代码来源:FiCaSchedulerApp.java


示例16: allocate

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerEvent; //导入依赖的package包/类
synchronized public RMContainer allocate(NodeType type, FSSchedulerNode node,
    Priority priority, ResourceRequest request,
    Container container) {
  // Update allowed locality level
  NodeType allowed = allowedLocalityLevel.get(priority);
  if (allowed != null) {
    if (allowed.equals(NodeType.OFF_SWITCH) &&
        (type.equals(NodeType.NODE_LOCAL) ||
            type.equals(NodeType.RACK_LOCAL))) {
      this.resetAllowedLocalityLevel(priority, type);
    }
    else if (allowed.equals(NodeType.RACK_LOCAL) &&
        type.equals(NodeType.NODE_LOCAL)) {
      this.resetAllowedLocalityLevel(priority, type);
    }
  }

  // Required sanity check - AM can call 'allocate' to update resource 
  // request without locking the scheduler, hence we need to check
  if (getTotalRequiredResources(priority) <= 0) {
    return null;
  }
  
  // Create RMContainer
  RMContainer rmContainer = new RMContainerImpl(container, 
      getApplicationAttemptId(), node.getNodeID(), rmContext
      .getDispatcher().getEventHandler(), rmContext
      .getContainerAllocationExpirer());

  // Add it to allContainers list.
  newlyAllocatedContainers.add(rmContainer);
  liveContainers.put(container.getId(), rmContainer);    

  // Update consumption and track allocations

  LOG.info("TO allocate in FSSchedulerApp: type: " + type + ", node " + node + ", resource: "
          + request.getCapability());
  appSchedulingInfo.allocate(type, node, priority, request, container);
  Resources.addTo(currentConsumption, container.getResource());

  // Inform the container
  rmContainer.handle(
      new RMContainerEvent(container.getId(), RMContainerEventType.START));

  if (LOG.isDebugEnabled()) {
    LOG.debug("allocate: applicationAttemptId=" 
        + container.getId().getApplicationAttemptId() 
        + " container=" + container.getId() + " host="
        + container.getNodeId().getHost() + " type=" + type);
  }
  RMAuditLogger.logSuccess(getUser(), 
      AuditConstants.ALLOC_CONTAINER, "SchedulerApp", 
      getApplicationId(), container.getId());
  
  return rmContainer;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:57,代码来源:FSSchedulerApp.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java GeoEventCreator类代码示例发布时间:2022-05-22
下一篇:
Java UnivariateSolver类代码示例发布时间: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