Java Code Examples for org.apache.hadoop.yarn.webapp.util.WebAppUtils#getRMWebAppURLWithScheme()

The following examples show how to use org.apache.hadoop.yarn.webapp.util.WebAppUtils#getRMWebAppURLWithScheme() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestYarnConfiguration.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Test
public void testRMWebUrlSpecified() throws Exception {
  YarnConfiguration conf = new YarnConfiguration();
  // seems a bit odd but right now we are forcing webapp for RM to be
  // RM_ADDRESS
  // for host and use the port from the RM_WEBAPP_ADDRESS
  conf.set(YarnConfiguration.RM_WEBAPP_ADDRESS, "fortesting:24543");
  conf.set(YarnConfiguration.RM_ADDRESS, "rmtesting:9999");
  String rmWebUrl = WebAppUtils.getRMWebAppURLWithScheme(conf);
  String[] parts = rmWebUrl.split(":");
  Assert.assertEquals("RM Web URL Port is incrrect", 24543,
      Integer.valueOf(parts[parts.length - 1]).intValue());
  Assert.assertNotSame(
      "RM Web Url not resolved correctly. Should not be rmtesting",
      "http://rmtesting:24543", rmWebUrl);
}
 
Example 2
Source File: TestYarnConfiguration.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Test
public void testRMWebUrlSpecified() throws Exception {
  YarnConfiguration conf = new YarnConfiguration();
  // seems a bit odd but right now we are forcing webapp for RM to be
  // RM_ADDRESS
  // for host and use the port from the RM_WEBAPP_ADDRESS
  conf.set(YarnConfiguration.RM_WEBAPP_ADDRESS, "fortesting:24543");
  conf.set(YarnConfiguration.RM_ADDRESS, "rmtesting:9999");
  String rmWebUrl = WebAppUtils.getRMWebAppURLWithScheme(conf);
  String[] parts = rmWebUrl.split(":");
  Assert.assertEquals("RM Web URL Port is incrrect", 24543,
      Integer.valueOf(parts[parts.length - 1]).intValue());
  Assert.assertNotSame(
      "RM Web Url not resolved correctly. Should not be rmtesting",
      "http://rmtesting:24543", rmWebUrl);
}
 
Example 3
Source File: TestYarnConfiguration.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Test
public void testDefaultRMWebUrl() throws Exception {
  YarnConfiguration conf = new YarnConfiguration();
  String rmWebUrl = WebAppUtils.getRMWebAppURLWithScheme(conf);
  // shouldn't have a "/" on the end of the url as all the other uri routinnes
  // specifically add slashes and Jetty doesn't handle double slashes.
  Assert.assertNotSame("RM Web Url is not correct", "http://0.0.0.0:8088",
      rmWebUrl);
}
 
Example 4
Source File: TestYarnConfiguration.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Test
public void testDefaultRMWebUrl() throws Exception {
  YarnConfiguration conf = new YarnConfiguration();
  String rmWebUrl = WebAppUtils.getRMWebAppURLWithScheme(conf);
  // shouldn't have a "/" on the end of the url as all the other uri routinnes
  // specifically add slashes and Jetty doesn't handle double slashes.
  Assert.assertNotSame("RM Web Url is not correct", "http://0.0.0.0:8088",
      rmWebUrl);
}