use of org.apache.hadoop.yarn.conf.YarnConfiguration in project hadoop by apache.
the class ProtocolHATestBase method setup.
@Before
public void setup() throws IOException {
failoverThread = null;
keepRunning = true;
conf = new YarnConfiguration();
conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
conf.setInt(YarnConfiguration.CLIENT_FAILOVER_MAX_ATTEMPTS, 5);
conf.set(YarnConfiguration.RM_HA_IDS, RM1_NODE_ID + "," + RM2_NODE_ID);
HATestUtil.setRpcAddressForRM(RM1_NODE_ID, RM1_PORT_BASE, conf);
HATestUtil.setRpcAddressForRM(RM2_NODE_ID, RM2_PORT_BASE, conf);
conf.setLong(YarnConfiguration.CLIENT_FAILOVER_SLEEPTIME_BASE_MS, 100L);
conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_FIXED_PORTS, true);
conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_USE_RPC, true);
}
use of org.apache.hadoop.yarn.conf.YarnConfiguration in project hadoop by apache.
the class TestRMFailover method setup.
@Before
public void setup() throws IOException {
fakeAppId = ApplicationId.newInstance(System.currentTimeMillis(), 0);
conf = new YarnConfiguration();
conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
conf.set(YarnConfiguration.RM_HA_IDS, RM1_NODE_ID + "," + RM2_NODE_ID);
HATestUtil.setRpcAddressForRM(RM1_NODE_ID, RM1_PORT_BASE, conf);
HATestUtil.setRpcAddressForRM(RM2_NODE_ID, RM2_PORT_BASE, conf);
conf.setLong(YarnConfiguration.CLIENT_FAILOVER_SLEEPTIME_BASE_MS, 100L);
conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_FIXED_PORTS, true);
conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_USE_RPC, true);
cluster = new MiniYARNCluster(TestRMFailover.class.getName(), 2, 1, 1, 1);
}
use of org.apache.hadoop.yarn.conf.YarnConfiguration in project hadoop by apache.
the class TestResourceManagerAdministrationProtocolPBClientImpl method setUpResourceManager.
/**
* Start resource manager server
*/
@BeforeClass
public static void setUpResourceManager() throws IOException, InterruptedException {
Configuration.addDefaultResource("config-with-security.xml");
Configuration configuration = new YarnConfiguration();
resourceManager = new ResourceManager() {
@Override
protected void doSecureLogin() throws IOException {
}
};
// a reliable way to wait for resource manager to fully start
final 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(configuration);
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: " + configuration.get(YarnConfiguration.RM_ADMIN_ADDRESS));
client = new ResourceManagerAdministrationProtocolPBClientImpl(1L, getProtocolAddress(configuration), configuration);
}
use of org.apache.hadoop.yarn.conf.YarnConfiguration in project hadoop by apache.
the class TestApplicationClientProtocolOnHA method initiate.
@Before
public void initiate() throws Exception {
startHACluster(1, true, false, false);
Configuration conf = new YarnConfiguration(this.conf);
client = createAndStartYarnClient(conf);
}
use of org.apache.hadoop.yarn.conf.YarnConfiguration 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));
}
Aggregations