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


Java RMContainerState.RESERVED属性代码示例

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


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

示例1: completedContainer

/**
 * 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,代码行数:40,代码来源:FairScheduler.java

示例2: completedContainer

/**
 * Clean up a completed container.
 */
@Override
protected synchronized void completedContainer(RMContainer rmContainer,
    ContainerStatus containerStatus, RMContainerEventType event) {
  if (rmContainer == null) {
    LOG.info("Container " + containerStatus.getContainerId()
        + " completed with event " + event);
    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" +
        " finished application " + 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:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:41,代码来源:FairScheduler.java

示例3: assignContainers

@Override
public CSAssignment assignContainers(Resource clusterResource,
    FiCaSchedulerNode node, SchedulingMode schedulingMode,
    ResourceLimits resourceLimits, RMContainer reservedContainer) {
  if (reservedContainer != null) {
    if (reservedContainer.getState() == RMContainerState.RESERVED) {
      // It's a regular container
      return regularContainerAllocator.assignContainers(clusterResource,
          node, schedulingMode, resourceLimits, reservedContainer);
    } else {
      // It's a increase container
      return increaseContainerAllocator.assignContainers(clusterResource,
          node, schedulingMode, resourceLimits, reservedContainer);
    }
  } else {
    /*
     * Try to allocate increase container first, and if we failed to allocate
     * anything, we will try to allocate regular container
     */
    CSAssignment assign =
        increaseContainerAllocator.assignContainers(clusterResource, node,
            schedulingMode, resourceLimits, null);
    if (Resources.greaterThan(rc, clusterResource, assign.getResource(),
        Resources.none())) {
      return assign;
    }

    return regularContainerAllocator.assignContainers(clusterResource, node,
        schedulingMode, resourceLimits, null);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:31,代码来源:ContainerAllocator.java

示例4: completedContainer

/**
 * 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,container.getResource());
    updateRootQueueMetrics();
  }

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

示例5: completedContainer

/**
 * Clean up a completed container.
 */
private 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
  ApplicationAttemptId applicationAttemptId = container.getId().getApplicationAttemptId();
  FSSchedulerApp application = applications.get(applicationAttemptId);
  if (application == null) {
    LOG.info("Container " + container + " of" +
        " unknown application " + applicationAttemptId +
        " completed with event " + event);
    return;
  }

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

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

  LOG.info("Application " + applicationAttemptId +
      " released container " + container.getId() +
      " on node: " + node +
      " with event: " + event);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:39,代码来源:FairScheduler.java

示例6: completedContainerInternal

/**
 * Clean up a completed container.
 */
@Override
protected synchronized void completedContainerInternal(
    RMContainer rmContainer, ContainerStatus containerStatus,
    RMContainerEventType event) {

  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" +
        " finished application " + 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(rmContainer.getContainerId(), false);
    updateRootQueueMetrics();
  }

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

示例7: completedContainer

/**
 * Clean up a completed container.
 */
private 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
  FSSchedulerApp 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 = nodes.get(container.getNodeId());

  if (rmContainer.getState() == RMContainerState.RESERVED) {
    application.unreserve(node, rmContainer.getReservedPriority());
    node.unreserveResource(application);
  } 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:Seagate,项目名称:hadoop-on-lustre2,代码行数:40,代码来源:FairScheduler.java

示例8: completedContainer

@Override
public void completedContainer(Resource clusterResource, 
    FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
    ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue,
    boolean sortQueues) {
  if (application != null) {

    boolean removed = false;

    // Careful! Locking order is important!
    synchronized (this) {

      Container container = rmContainer.getContainer();

      // Inform the application & the node
      // Note: It's safe to assume that all state changes to RMContainer
      // happen under scheduler's lock... 
      // So, this is, in effect, a transaction across application & node
      if (rmContainer.getState() == RMContainerState.RESERVED) {
        removed = unreserve(application, rmContainer.getReservedPriority(),
            node, rmContainer);
      } else {
        removed =
            application.containerCompleted(rmContainer, containerStatus,
                event, node.getPartition());
        node.releaseContainer(container);
      }

      // Book-keeping
      if (removed) {
        releaseResource(clusterResource, application,
            container.getResource(), node.getLabels());
        LOG.info("completedContainer" +
            " container=" + container +
            " queue=" + this +
            " cluster=" + clusterResource);
      }
    }

    if (removed) {
      // Inform the parent queue _outside_ of the leaf-queue lock
      getParent().completedContainer(clusterResource, application, node,
        rmContainer, null, event, this, sortQueues);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:46,代码来源:LeafQueue.java

示例9: completedContainer

@Override
public void completedContainer(Resource clusterResource, 
    FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
    ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue,
    boolean sortQueues) {
  if (application != null) {
    // unreserve container increase request if it previously reserved.
    if (rmContainer.hasIncreaseReservation()) {
      unreserveIncreasedContainer(clusterResource, application, node,
          rmContainer);
    }
    
    // Remove container increase request if it exists
    application.removeIncreaseRequest(node.getNodeID(),
        rmContainer.getAllocatedPriority(), rmContainer.getContainerId());

    boolean removed = false;

    // Careful! Locking order is important!
    synchronized (this) {

      Container container = rmContainer.getContainer();

      // Inform the application & the node
      // Note: It's safe to assume that all state changes to RMContainer
      // happen under scheduler's lock... 
      // So, this is, in effect, a transaction across application & node
      if (rmContainer.getState() == RMContainerState.RESERVED) {
        removed = application.unreserve(rmContainer.getReservedPriority(),
            node, rmContainer);
      } else {
        removed =
            application.containerCompleted(rmContainer, containerStatus,
                event, node.getPartition());
        
        node.releaseContainer(container);
      }

      // Book-keeping
      if (removed) {
        
        // Inform the ordering policy
        orderingPolicy.containerReleased(application, rmContainer);
        
        releaseResource(clusterResource, application, container.getResource(),
            node.getPartition(), rmContainer, false);
      }
    }

    if (removed) {
      // Inform the parent queue _outside_ of the leaf-queue lock
      getParent().completedContainer(clusterResource, application, node,
        rmContainer, null, event, this, sortQueues);
    }
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:56,代码来源:LeafQueue.java

示例10: completedContainer

@Override
public void completedContainer(Resource clusterResource, 
    FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
    ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue,
    boolean sortQueues) {
  if (application != null) {

    boolean removed = false;

    // Careful! Locking order is important!
    synchronized (this) {

      Container container = rmContainer.getContainer();
      
      Resource toRelease = null;

      // Inform the application & the node
      // Note: It's safe to assume that all state changes to RMContainer
      // happen under scheduler's lock... 
      // So, this is, in effect, a transaction across application & node
      if (rmContainer.getState() == RMContainerState.RESERVED) {
        removed = unreserve(application, rmContainer.getReservedPriority(),
            node, rmContainer);
        toRelease = container.getResource();
      } else {
        //for container suspend event	       
        if (event == RMContainerEventType.SUSPEND){
         removed =
      	application.containerSuspend(rmContainer, containerStatus, event);
      	//suspend and resume in fifo order
          if(!suspendedApps.contains(application.getApplicationAttemptId())){
          	LOG.info(application.getApplicationAttemptId()+"into suspending list");
          	suspendedApps.add(application.getApplicationAttemptId());
          }
          //we suspend the container on this node
      	node.suspendContainer(container,rmContainer.getLastPreemptedResource());
      	toRelease = rmContainer.getLastPreemptedResource();
      	
        }else{
      	toRelease = rmContainer.getCurrentUsedResource();
      	removed =
      	            application.containerCompleted(rmContainer, containerStatus, event);
      	            node.releaseContainer(container,toRelease);
      	          //for container suspend event
      	 //in case of completing a suspended container 
        }
      }
      // Book-keeping
      if (removed) {
         //更新资源试用情况
        if(event == RMContainerEventType.SUSPEND){
        releaseResource(clusterResource, application,
      		  toRelease, node.getLabels(),true);
        }else{
        releaseResource(clusterResource, application,
          		  toRelease, node.getLabels(),false);  
        }
        LOG.info("completedContainer" +
            " container=" + container +
            " queue=" + this +
            " cluster=" + clusterResource);
      }
    }

    if (removed) {
      // Inform the parent queue _outside_ of the leaf-queue lock
      getParent().completedContainer(clusterResource, application, node,
        rmContainer, null, event, this, sortQueues);
    }
  }
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:71,代码来源:LeafQueue.java

示例11: completedContainer

@Override
public void completedContainer(Resource clusterResource, 
    FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
    ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue,
    boolean sortQueues) {
  if (application != null) {

    boolean removed = false;

    // Careful! Locking order is important!
    synchronized (this) {

      Container container = rmContainer.getContainer();

      // Inform the application & the node
      // Note: It's safe to assume that all state changes to RMContainer
      // happen under scheduler's lock... 
      // So, this is, in effect, a transaction across application & node
      if (rmContainer.getState() == RMContainerState.RESERVED) {
        removed = unreserve(application, rmContainer.getReservedPriority(),
            node, rmContainer);
      } else {
        removed =
          application.containerCompleted(rmContainer, containerStatus, event);
        node.releaseContainer(container);
      }

      // Book-keeping
      if (removed) {
        releaseResource(clusterResource, application,
            container.getResource(),
            labelManager.getLabelsOnNode(node.getNodeID()));
        LOG.info("completedContainer" +
            " container=" + container +
            " queue=" + this +
            " cluster=" + clusterResource);
      }
    }

    if (removed) {
      // Inform the parent queue _outside_ of the leaf-queue lock
      getParent().completedContainer(clusterResource, application, node,
        rmContainer, null, event, this, sortQueues);
    }
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:46,代码来源:LeafQueue.java

示例12: completedContainer

@Override
public void completedContainer(Resource clusterResource, 
    FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
    ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue) {
  if (application != null) {
    // Careful! Locking order is important!
    synchronized (this) {

      Container container = rmContainer.getContainer();

      boolean removed = false;
      // Inform the application & the node
      // Note: It's safe to assume that all state changes to RMContainer
      // happen under scheduler's lock... 
      // So, this is, in effect, a transaction across application & node
      if (rmContainer.getState() == RMContainerState.RESERVED) {
        removed = unreserve(application, rmContainer.getReservedPriority(),
            node, rmContainer);
      } else {
        removed =
          application.containerCompleted(rmContainer, containerStatus, event);
        node.releaseContainer(container);
      }

      // Book-keeping
      if (removed) {
        releaseResource(clusterResource,
            application, container.getResource());
        LOG.info("completedContainer" +
            " container=" + container +
            " resource=" + container.getResource() +
            " queue=" + this +
            " usedCapacity=" + getUsedCapacity() +
            " absoluteUsedCapacity=" + getAbsoluteUsedCapacity() +
            " used=" + usedResources +
            " cluster=" + clusterResource);
        // Inform the parent queue
        getParent().completedContainer(clusterResource, application,
            node, rmContainer, null, event, this);
      }
    }


  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:45,代码来源:LeafQueue.java

示例13: completedContainer

@Override
public void completedContainer(Resource clusterResource, 
    FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
    ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue,
    boolean sortQueues) {
  // Update SchedulerHealth for released / preempted container
  updateSchedulerHealthForCompletedContainer(rmContainer, containerStatus);

  if (application != null) {
    // unreserve container increase request if it previously reserved.
    if (rmContainer.hasIncreaseReservation()) {
      unreserveIncreasedContainer(clusterResource, application, node,
          rmContainer);
    }
    
    // Remove container increase request if it exists
    application.removeIncreaseRequest(node.getNodeID(),
        rmContainer.getAllocatedPriority(), rmContainer.getContainerId());

    boolean removed = false;

    // Careful! Locking order is important!
    synchronized (this) {

      Container container = rmContainer.getContainer();

      // Inform the application & the node
      // Note: It's safe to assume that all state changes to RMContainer
      // happen under scheduler's lock... 
      // So, this is, in effect, a transaction across application & node
      if (rmContainer.getState() == RMContainerState.RESERVED) {
        removed = application.unreserve(rmContainer.getReservedPriority(),
            node, rmContainer);
      } else {
        removed =
            application.containerCompleted(rmContainer, containerStatus,
                event, node.getPartition());

        node.releaseContainer(rmContainer.getContainerId(), false);
      }

      // Book-keeping
      if (removed) {

        // Inform the ordering policy
        orderingPolicy.containerReleased(application, rmContainer);
        
        releaseResource(clusterResource, application, container.getResource(),
            node.getPartition(), rmContainer, false);
      }
    }

    if (removed) {
      // Inform the parent queue _outside_ of the leaf-queue lock
      getParent().completedContainer(clusterResource, application, node,
        rmContainer, null, event, this, sortQueues);
    }
  }

  // Notify PreemptionManager
  csContext.getPreemptionManager().removeKillableContainer(
      new KillableContainer(rmContainer, node.getPartition(), queueName));
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:63,代码来源:LeafQueue.java

示例14: completedContainer

@Override
public void completedContainer(Resource clusterResource, 
    FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
    ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue) {
  if (application != null) {

    boolean removed = false;

    // Careful! Locking order is important!
    synchronized (this) {

      Container container = rmContainer.getContainer();

      // Inform the application & the node
      // Note: It's safe to assume that all state changes to RMContainer
      // happen under scheduler's lock... 
      // So, this is, in effect, a transaction across application & node
      if (rmContainer.getState() == RMContainerState.RESERVED) {
        removed = unreserve(application, rmContainer.getReservedPriority(),
            node, rmContainer);
      } else {
        removed =
          application.containerCompleted(rmContainer, containerStatus, event);
        node.releaseContainer(container);
      }

      // Book-keeping
      if (removed) {
        releaseResource(clusterResource,
            application, container.getResource());
        LOG.info("completedContainer" +
            " container=" + container +
            " resource=" + container.getResource() +
            " queue=" + this +
            " usedCapacity=" + getUsedCapacity() +
            " absoluteUsedCapacity=" + getAbsoluteUsedCapacity() +
            " used=" + usedResources +
            " cluster=" + clusterResource);
      }
    }

    if (removed) {
      // Inform the parent queue _outside_ of the leaf-queue lock
      getParent().completedContainer(clusterResource, application, node,
        rmContainer, null, event, this);
    }
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:48,代码来源:LeafQueue.java


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