Ejemplo n.º 1
0
  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);
  }
Ejemplo n.º 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());
 }
Ejemplo n.º 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();
  }
Ejemplo n.º 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);
  }
Ejemplo n.º 5
0
 @Inject QueuesBlock(ResourceManager rm, FSQInfo info) {
   fs = (FairScheduler)rm.getResourceScheduler();
   fsqinfo = info;
 }
Ejemplo n.º 6
0
 @After
 public void tearDown() throws Exception {
   resourceManager.stop();
 }
Ejemplo n.º 7
0
 @Before
 public void setUp() throws Exception {
   Store store = StoreFactory.getStore(new Configuration());
   resourceManager = new ResourceManager(store);
   resourceManager.init(new Configuration());
 }