use of org.apache.hadoop.yarn.server.resourcemanager.ResourceManager in project hadoop by apache.
the class TestGetGroups method setUpResourceManager.
@BeforeClass
public static void setUpResourceManager() throws InterruptedException {
conf = new YarnConfiguration();
resourceManager = new ResourceManager() {
@Override
protected void doSecureLogin() throws IOException {
}
;
};
// a reliable way to wait for resource manager to start
CountDownLatch rmStartedSignal = new CountDownLatch(1);
ServiceStateChangeListener rmStateChangeListener = new ServiceStateChangeListener() {
@Override
public void stateChanged(Service service) {
if (service.getServiceState() == STATE.STARTED) {
rmStartedSignal.countDown();
}
}
};
resourceManager.registerServiceListener(rmStateChangeListener);
resourceManager.init(conf);
new Thread() {
public void run() {
resourceManager.start();
}
;
}.start();
boolean rmStarted = rmStartedSignal.await(60000L, TimeUnit.MILLISECONDS);
Assert.assertTrue("ResourceManager failed to start up.", rmStarted);
LOG.info("ResourceManager RMAdmin address: " + conf.get(YarnConfiguration.RM_ADMIN_ADDRESS));
}
use of org.apache.hadoop.yarn.server.resourcemanager.ResourceManager in project hadoop by apache.
the class TestYarnClient method testClientStop.
@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();
}
use of org.apache.hadoop.yarn.server.resourcemanager.ResourceManager in project hadoop by apache.
the class AboutBlock method render.
@Override
protected void render(Block html) {
html._(MetricsOverviewTable.class);
ResourceManager rm = getInstance(ResourceManager.class);
ClusterInfo cinfo = new ClusterInfo(rm);
info("Cluster overview")._("Cluster ID:", cinfo.getClusterId())._("ResourceManager state:", cinfo.getState())._("ResourceManager HA state:", cinfo.getHAState())._("ResourceManager HA zookeeper connection state:", cinfo.getHAZookeeperConnectionState())._("ResourceManager RMStateStore:", cinfo.getRMStateStore())._("ResourceManager started on:", Times.format(cinfo.getStartedOn()))._("ResourceManager version:", cinfo.getRMBuildVersion() + " on " + cinfo.getRMVersionBuiltOn())._("Hadoop version:", cinfo.getHadoopBuildVersion() + " on " + cinfo.getHadoopVersionBuiltOn());
html._(InfoBlock.class);
}
use of org.apache.hadoop.yarn.server.resourcemanager.ResourceManager in project hadoop by apache.
the class TestSchedulingMonitor method testRMStarts.
@Test(timeout = 10000)
public void testRMStarts() {
Configuration conf = new YarnConfiguration();
conf.setBoolean(YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS, true);
conf.set(YarnConfiguration.RM_SCHEDULER_MONITOR_POLICIES, ProportionalCapacityPreemptionPolicy.class.getCanonicalName());
ResourceManager rm = new MockRM();
try {
rm.init(conf);
} catch (Exception e) {
fail("ResourceManager does not start when " + YarnConfiguration.RM_SCHEDULER_ENABLE_MONITORS + " is set to true");
}
}
use of org.apache.hadoop.yarn.server.resourcemanager.ResourceManager in project hadoop by apache.
the class TestMemoryRMStateStore method testNotifyStoreOperationFailed.
@Test
public void testNotifyStoreOperationFailed() throws Exception {
RMStateStore store = new MemoryRMStateStore() {
@Override
public synchronized void removeRMDelegationTokenState(RMDelegationTokenIdentifier rmDTIdentifier) throws Exception {
throw new Exception("testNotifyStoreOperationFailed");
}
};
Configuration conf = new Configuration();
conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
store.init(conf);
ResourceManager mockRM = mock(ResourceManager.class);
store.setResourceManager(mockRM);
RMDelegationTokenIdentifier mockTokenId = mock(RMDelegationTokenIdentifier.class);
store.removeRMDelegationToken(mockTokenId);
assertTrue("RMStateStore should have been in fenced state", store.isFencedState());
store = new MemoryRMStateStore() {
@Override
public synchronized void removeRMDelegationToken(RMDelegationTokenIdentifier rmDTIdentifier) {
notifyStoreOperationFailed(new Exception("testNotifyStoreOperationFailed"));
}
};
store.init(conf);
store.setResourceManager(mockRM);
store.removeRMDelegationToken(mockTokenId);
assertTrue("RMStateStore should have been in fenced state", store.isFencedState());
}
Aggregations