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


Java RMContainerState.equals方法代码示例

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


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

示例1: waitForState

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerState; //导入方法依赖的package包/类
public void waitForState(MockNM nm, ContainerId containerId,
    RMContainerState containerState) throws Exception {
  RMContainer container = getResourceScheduler().getRMContainer(containerId);
  int timeoutSecs = 0;
  while(container == null && timeoutSecs++ < 20) {
    nm.nodeHeartbeat(true);
    container = getResourceScheduler().getRMContainer(containerId);
    System.out.println("Waiting for container " + containerId + " to be allocated.");
    Thread.sleep(100);
  }
  Assert.assertNotNull("Container shouldn't be null", container);
  timeoutSecs = 0;
  while (!containerState.equals(container.getState()) && timeoutSecs++ < 40) {
    System.out.println("Container : " + containerId + " State is : "
        + container.getState() + " Waiting for state : " + containerState);
    nm.nodeHeartbeat(true);
    Thread.sleep(300);
  }
  System.out.println("Container State is : " + container.getState());
  Assert.assertEquals("Container state is not correct (timedout)",
    containerState, container.getState());
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:23,代码来源:MockRM.java

示例2: waitForState

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerState; //导入方法依赖的package包/类
public boolean waitForState(MockNM nm, ContainerId containerId,
    RMContainerState containerState, int timeoutMillisecs) throws Exception {
  RMContainer container = getResourceScheduler().getRMContainer(containerId);
  int timeoutSecs = 0;
  while(container == null && timeoutSecs++ < timeoutMillisecs / 100) {
    nm.nodeHeartbeat(true);
    container = getResourceScheduler().getRMContainer(containerId);
    System.out.println("Waiting for container " + containerId + " to be allocated.");
    Thread.sleep(100);
    
    if (timeoutMillisecs <= timeoutSecs * 100) {
      return false;
    }
  }
  Assert.assertNotNull("Container shouldn't be null", container);
  while (!containerState.equals(container.getState())
      && timeoutSecs++ < timeoutMillisecs / 100) {
    System.out.println("Container : " + containerId + " State is : "
        + container.getState() + " Waiting for state : " + containerState);
    nm.nodeHeartbeat(true);
    Thread.sleep(100);
    
    if (timeoutMillisecs <= timeoutSecs * 100) {
      return false;
    }
  }
  
  System.out.println("Container State is : " + container.getState());
  Assert.assertEquals("Container state is not correct (timedout)",
    containerState, container.getState());
  return true;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:MockRM.java


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