コード例 #1
0
ファイル: TestRMWebServices.java プロジェクト: imace/hops
  public void verifyClusterGeneric(
      long clusterid,
      long startedon,
      String state,
      String haState,
      String hadoopVersionBuiltOn,
      String hadoopBuildVersion,
      String hadoopVersion,
      String resourceManagerVersionBuiltOn,
      String resourceManagerBuildVersion,
      String resourceManagerVersion) {

    assertEquals("clusterId doesn't match: ", ResourceManager.getClusterTimeStamp(), clusterid);
    assertEquals("startedOn doesn't match: ", ResourceManager.getClusterTimeStamp(), startedon);
    assertTrue("stated doesn't match: " + state, state.matches(STATE.INITED.toString()));
    assertTrue("HA state doesn't match: " + haState, haState.matches("INITIALIZING"));

    WebServicesTestUtils.checkStringMatch(
        "hadoopVersionBuiltOn", VersionInfo.getDate(), hadoopVersionBuiltOn);
    WebServicesTestUtils.checkStringEqual(
        "hadoopBuildVersion", VersionInfo.getBuildVersion(), hadoopBuildVersion);
    WebServicesTestUtils.checkStringMatch("hadoopVersion", VersionInfo.getVersion(), hadoopVersion);

    WebServicesTestUtils.checkStringMatch(
        "resourceManagerVersionBuiltOn", YarnVersionInfo.getDate(), resourceManagerVersionBuiltOn);
    WebServicesTestUtils.checkStringEqual(
        "resourceManagerBuildVersion",
        YarnVersionInfo.getBuildVersion(),
        resourceManagerBuildVersion);
    WebServicesTestUtils.checkStringMatch(
        "resourceManagerVersion", YarnVersionInfo.getVersion(), resourceManagerVersion);
  }
コード例 #2
0
 private org.apache.hadoop.yarn.server.resourcemanager.NodeManager registerNode(
     String hostName, int containerManagerPort, int nmHttpPort, String rackName, int memory)
     throws IOException {
   return new org.apache.hadoop.yarn.server.resourcemanager.NodeManager(
       hostName,
       containerManagerPort,
       nmHttpPort,
       rackName,
       memory,
       resourceManager.getResourceTrackerService(),
       resourceManager.getRMContext());
 }
コード例 #3
0
  @Test
  public void testClientStop() {
    Configuration conf = new Configuration();
    ResourceManager rm = new ResourceManager();
    rm.init(conf);
    rm.start();

    YarnClient client = YarnClient.createYarnClient();
    client.init(conf);
    client.start();
    client.stop();
    rm.stop();
  }
コード例 #4
0
  @Before
  public void setup() throws IOException {
    FairScheduler scheduler = new FairScheduler();
    Configuration conf = createConfiguration();
    // All tests assume only one assignment per node update
    conf.set(FairSchedulerConfiguration.ASSIGN_MULTIPLE, "false");
    ResourceManager resourceManager = new ResourceManager();
    resourceManager.init(conf);
    ((AsyncDispatcher) resourceManager.getRMContext().getDispatcher()).start();
    scheduler.reinitialize(conf, resourceManager.getRMContext());

    String queueName = "root.queue1";
    QueueManager mockMgr = mock(QueueManager.class);
    when(mockMgr.getMaxResources(queueName)).thenReturn(maxResource);
    when(mockMgr.getMinResources(queueName)).thenReturn(Resources.none());

    schedulable = new FSLeafQueue(queueName, mockMgr, scheduler, null);
  }
コード例 #5
0
 @Inject QueuesBlock(ResourceManager rm, FSQInfo info) {
   fs = (FairScheduler)rm.getResourceScheduler();
   fsqinfo = info;
 }
コード例 #6
0
 @After
 public void tearDown() throws Exception {
   resourceManager.stop();
 }
コード例 #7
0
 @Before
 public void setUp() throws Exception {
   Store store = StoreFactory.getStore(new Configuration());
   resourceManager = new ResourceManager(store);
   resourceManager.init(new Configuration());
 }