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