Java Code Examples for org.apache.hadoop.yarn.webapp.GenericExceptionHandler

The following examples show how to use org.apache.hadoop.yarn.webapp.GenericExceptionHandler. These examples are extracted from open source projects. 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 Project: hadoop   Source File: WebServer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setup() {
  bind(NMWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(JAXBContextResolver.class);
  bind(ResourceView.class).toInstance(this.resourceView);
  bind(ApplicationACLsManager.class).toInstance(this.aclsManager);
  bind(LocalDirsHandlerService.class).toInstance(dirsHandler);
  route("/", NMController.class, "info");
  route("/node", NMController.class, "node");
  route("/allApplications", NMController.class, "allApplications");
  route("/allContainers", NMController.class, "allContainers");
  route(pajoin("/application", APPLICATION_ID), NMController.class,
      "application");
  route(pajoin("/container", CONTAINER_ID), NMController.class,
      "container");
  route(
      pajoin("/containerlogs", CONTAINER_ID, APP_OWNER, CONTAINER_LOG_TYPE),
      NMController.class, "logs");
}
 
Example 2
Source Project: hadoop   Source File: RMWebApp.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setup() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(RMWebApp.class).toInstance(this);

  if (rm != null) {
    bind(ResourceManager.class).toInstance(rm);
    bind(ApplicationBaseProtocol.class).toInstance(rm.getClientRMService());
  }
  route("/", RmController.class);
  route(pajoin("/nodes", NODE_STATE), RmController.class, "nodes");
  route(pajoin("/apps", APP_STATE), RmController.class);
  route("/cluster", RmController.class, "about");
  route(pajoin("/app", APPLICATION_ID), RmController.class, "app");
  route("/scheduler", RmController.class, "scheduler");
  route(pajoin("/queue", QUEUE_NAME), RmController.class, "queue");
  route("/nodelabels", RmController.class, "nodelabels");
  route(pajoin("/appattempt", APPLICATION_ATTEMPT_ID), RmController.class,
    "appattempt");
  route(pajoin("/container", CONTAINER_ID), RmController.class, "container");
}
 
Example 3
Source Project: hadoop   Source File: TestRMWebServicesNodeLabels.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  try {
    userName = UserGroupInformation.getCurrentUser().getShortUserName();
  } catch (IOException ioe) {
    throw new RuntimeException("Unable to get current user name "
        + ioe.getMessage(), ioe);
  }
  notUserName = userName + "abc123";
  conf = new YarnConfiguration();
  conf.set(YarnConfiguration.YARN_ADMIN_ACL, userName);
  rm = new MockRM(conf);
  bind(ResourceManager.class).toInstance(rm);
  filter("/*").through(
      TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
  serve("/*").with(GuiceContainer.class);
}
 
Example 4
Source Project: hadoop   Source File: TestRMWebServicesDelegationTokens.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  Configuration rmconf = new Configuration();
  rmconf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
    YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
  rmconf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
    ResourceScheduler.class);
  rmconf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
  rm = new MockRM(rmconf);
  bind(ResourceManager.class).toInstance(rm);
  if (isKerberosAuth == true) {
    filter("/*").through(TestKerberosAuthFilter.class);
  } else {
    filter("/*").through(TestSimpleAuthFilter.class);
  }
  serve("/*").with(GuiceContainer.class);
}
 
Example 5
Source Project: hadoop   Source File: AHSWebApp.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setup() {
  bind(YarnJacksonJaxbJsonProvider.class);
  bind(AHSWebServices.class);
  bind(TimelineWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(ApplicationBaseProtocol.class).toInstance(historyClientService);
  bind(TimelineDataManager.class).toInstance(timelineDataManager);
  route("/", AHSController.class);
  route(pajoin("/apps", APP_STATE), AHSController.class);
  route(pajoin("/app", APPLICATION_ID), AHSController.class, "app");
  route(pajoin("/appattempt", APPLICATION_ATTEMPT_ID), AHSController.class,
    "appattempt");
  route(pajoin("/container", CONTAINER_ID), AHSController.class, "container");
  route(
    pajoin("/logs", NM_NODENAME, CONTAINER_ID, ENTITY_STRING, APP_OWNER,
      CONTAINER_LOG_TYPE), AHSController.class, "logs");
}
 
Example 6
Source Project: hadoop   Source File: AMWebApp.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setup() {
  bind(JAXBContextResolver.class);
  bind(GenericExceptionHandler.class);
  bind(AMWebServices.class);
  route("/", AppController.class);
  route("/app", AppController.class);
  route(pajoin("/job", JOB_ID), AppController.class, "job");
  route(pajoin("/conf", JOB_ID), AppController.class, "conf");
  route(pajoin("/jobcounters", JOB_ID), AppController.class, "jobCounters");
  route(pajoin("/singlejobcounter",JOB_ID, COUNTER_GROUP, COUNTER_NAME),
      AppController.class, "singleJobCounter");
  route(pajoin("/tasks", JOB_ID, TASK_TYPE, TASK_STATE), AppController.class, "tasks");
  route(pajoin("/attempts", JOB_ID, TASK_TYPE, ATTEMPT_STATE),
      AppController.class, "attempts");
  route(pajoin("/task", TASK_ID), AppController.class, "task");
  route(pajoin("/taskcounters", TASK_ID), AppController.class, "taskCounters");
  route(pajoin("/singletaskcounter",TASK_ID, COUNTER_GROUP, COUNTER_NAME),
      AppController.class, "singleTaskCounter");
}
 
Example 7
Source Project: hadoop   Source File: TestHsWebServicesAttempts.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(0, 1, 2, 1);
  webApp = mock(HsWebApp.class);
  when(webApp.name()).thenReturn("hsmockwebapp");

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 8
Source Project: hadoop   Source File: TestHsWebServices.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(0, 1, 1, 1);
  JobHistory jobHistoryService = new JobHistory();
  HistoryContext historyContext = (HistoryContext) jobHistoryService;
  webApp = new HsWebApp(historyContext);

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 9
Source Project: hadoop   Source File: TestHsWebServicesJobs.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(0, 1, 2, 1, false);
  webApp = mock(HsWebApp.class);
  when(webApp.name()).thenReturn("hsmockwebapp");

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 10
Source Project: hadoop   Source File: TestHsWebServicesJobsQuery.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(3, 2, 1);
  webApp = mock(HsWebApp.class);
  when(webApp.name()).thenReturn("hsmockwebapp");

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 11
Source Project: hadoop   Source File: TestHsWebServicesTasks.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(0, 1, 2, 1);
  webApp = mock(HsWebApp.class);
  when(webApp.name()).thenReturn("hsmockwebapp");

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 12
Source Project: big-c   Source File: WebServer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setup() {
  bind(NMWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(JAXBContextResolver.class);
  bind(ResourceView.class).toInstance(this.resourceView);
  bind(ApplicationACLsManager.class).toInstance(this.aclsManager);
  bind(LocalDirsHandlerService.class).toInstance(dirsHandler);
  route("/", NMController.class, "info");
  route("/node", NMController.class, "node");
  route("/allApplications", NMController.class, "allApplications");
  route("/allContainers", NMController.class, "allContainers");
  route(pajoin("/application", APPLICATION_ID), NMController.class,
      "application");
  route(pajoin("/container", CONTAINER_ID), NMController.class,
      "container");
  route(
      pajoin("/containerlogs", CONTAINER_ID, APP_OWNER, CONTAINER_LOG_TYPE),
      NMController.class, "logs");
}
 
Example 13
Source Project: big-c   Source File: RMWebApp.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setup() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(RMWebApp.class).toInstance(this);

  if (rm != null) {
    bind(ResourceManager.class).toInstance(rm);
    bind(ApplicationBaseProtocol.class).toInstance(rm.getClientRMService());
  }
  route("/", RmController.class);
  route(pajoin("/nodes", NODE_STATE), RmController.class, "nodes");
  route(pajoin("/apps", APP_STATE), RmController.class);
  route("/cluster", RmController.class, "about");
  route(pajoin("/app", APPLICATION_ID), RmController.class, "app");
  route("/scheduler", RmController.class, "scheduler");
  route(pajoin("/queue", QUEUE_NAME), RmController.class, "queue");
  route("/nodelabels", RmController.class, "nodelabels");
  route(pajoin("/appattempt", APPLICATION_ATTEMPT_ID), RmController.class,
    "appattempt");
  route(pajoin("/container", CONTAINER_ID), RmController.class, "container");
}
 
Example 14
Source Project: big-c   Source File: TestRMWebServicesNodeLabels.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  try {
    userName = UserGroupInformation.getCurrentUser().getShortUserName();
  } catch (IOException ioe) {
    throw new RuntimeException("Unable to get current user name "
        + ioe.getMessage(), ioe);
  }
  notUserName = userName + "abc123";
  conf = new YarnConfiguration();
  conf.set(YarnConfiguration.YARN_ADMIN_ACL, userName);
  rm = new MockRM(conf);
  bind(ResourceManager.class).toInstance(rm);
  filter("/*").through(
      TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
  serve("/*").with(GuiceContainer.class);
}
 
Example 15
Source Project: big-c   Source File: TestRMWebServicesDelegationTokens.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  Configuration rmconf = new Configuration();
  rmconf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
    YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
  rmconf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
    ResourceScheduler.class);
  rmconf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
  rm = new MockRM(rmconf);
  bind(ResourceManager.class).toInstance(rm);
  if (isKerberosAuth == true) {
    filter("/*").through(TestKerberosAuthFilter.class);
  } else {
    filter("/*").through(TestSimpleAuthFilter.class);
  }
  serve("/*").with(GuiceContainer.class);
}
 
Example 16
Source Project: big-c   Source File: AHSWebApp.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setup() {
  bind(YarnJacksonJaxbJsonProvider.class);
  bind(AHSWebServices.class);
  bind(TimelineWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(ApplicationBaseProtocol.class).toInstance(historyClientService);
  bind(TimelineDataManager.class).toInstance(timelineDataManager);
  route("/", AHSController.class);
  route(pajoin("/apps", APP_STATE), AHSController.class);
  route(pajoin("/app", APPLICATION_ID), AHSController.class, "app");
  route(pajoin("/appattempt", APPLICATION_ATTEMPT_ID), AHSController.class,
    "appattempt");
  route(pajoin("/container", CONTAINER_ID), AHSController.class, "container");
  route(
    pajoin("/logs", NM_NODENAME, CONTAINER_ID, ENTITY_STRING, APP_OWNER,
      CONTAINER_LOG_TYPE), AHSController.class, "logs");
}
 
Example 17
Source Project: big-c   Source File: AMWebApp.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setup() {
  bind(JAXBContextResolver.class);
  bind(GenericExceptionHandler.class);
  bind(AMWebServices.class);
  route("/", AppController.class);
  route("/app", AppController.class);
  route(pajoin("/job", JOB_ID), AppController.class, "job");
  route(pajoin("/conf", JOB_ID), AppController.class, "conf");
  route(pajoin("/jobcounters", JOB_ID), AppController.class, "jobCounters");
  route(pajoin("/singlejobcounter",JOB_ID, COUNTER_GROUP, COUNTER_NAME),
      AppController.class, "singleJobCounter");
  route(pajoin("/tasks", JOB_ID, TASK_TYPE, TASK_STATE), AppController.class, "tasks");
  route(pajoin("/attempts", JOB_ID, TASK_TYPE, ATTEMPT_STATE),
      AppController.class, "attempts");
  route(pajoin("/task", TASK_ID), AppController.class, "task");
  route(pajoin("/taskcounters", TASK_ID), AppController.class, "taskCounters");
  route(pajoin("/singletaskcounter",TASK_ID, COUNTER_GROUP, COUNTER_NAME),
      AppController.class, "singleTaskCounter");
}
 
Example 18
Source Project: big-c   Source File: TestHsWebServicesAttempts.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(0, 1, 2, 1);
  webApp = mock(HsWebApp.class);
  when(webApp.name()).thenReturn("hsmockwebapp");

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 19
Source Project: big-c   Source File: TestHsWebServices.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(0, 1, 1, 1);
  JobHistory jobHistoryService = new JobHistory();
  HistoryContext historyContext = (HistoryContext) jobHistoryService;
  webApp = new HsWebApp(historyContext);

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 20
Source Project: big-c   Source File: TestHsWebServicesJobs.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(0, 1, 2, 1, false);
  webApp = mock(HsWebApp.class);
  when(webApp.name()).thenReturn("hsmockwebapp");

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 21
Source Project: big-c   Source File: TestHsWebServicesJobsQuery.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(3, 2, 1);
  webApp = mock(HsWebApp.class);
  when(webApp.name()).thenReturn("hsmockwebapp");

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 22
Source Project: big-c   Source File: TestHsWebServicesTasks.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets() {

  appContext = new MockHistoryContext(0, 1, 2, 1);
  webApp = mock(HsWebApp.class);
  when(webApp.name()).thenReturn("hsmockwebapp");

  bind(JAXBContextResolver.class);
  bind(HsWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(WebApp.class).toInstance(webApp);
  bind(AppContext.class).toInstance(appContext);
  bind(HistoryContext.class).toInstance(appContext);
  bind(Configuration.class).toInstance(conf);

  serve("/*").with(GuiceContainer.class);
}
 
Example 23
Source Project: attic-apex-core   Source File: StramWebServicesTest.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureServlets()
{
  LogicalPlan dag = new LogicalPlan();
  String workingDir = new File("target", StramWebServicesTest.class.getName()).getAbsolutePath();
  dag.setAttribute(LogicalPlan.APPLICATION_PATH, workingDir);
  dag.setAttribute(Context.OperatorContext.STORAGE_AGENT, new AsyncFSStorageAgent(workingDir, null));
  dag.setAttribute(LogicalPlan.METRICS_TRANSPORT, new AutoMetricBuiltInTransport("xyz"));
  final DummyStreamingContainerManager streamingContainerManager = new DummyStreamingContainerManager(dag);

  appContext = new TestAppContext(dag.getAttributes());
  bind(JAXBContextResolver.class);
  bind(StramWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(StramAppContext.class).toInstance(appContext);
  bind(StreamingContainerManager.class).toInstance(streamingContainerManager);
  bind(Configuration.class).toInstance(conf);
  serve("/*").with(GuiceContainer.class);
}
 
Example 24
Source Project: Bats   Source File: StramWebApp.java    License: Apache License 2.0 5 votes vote down vote up
/**
 *
 */
@Override
public void setup()
{
  bind(JAXBContextResolver.class);
  bind(GenericExceptionHandler.class);
  bind(WebServices.class);
  bind(StramWebServices.class);
  bind(StreamingContainerManager.class).toInstance(this.moduleManager);
}
 
Example 25
Source Project: ambari-metrics   Source File: AMSWebApp.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setup() {
  bind(YarnJacksonJaxbJsonProvider.class);
  bind(TimelineWebServices.class);
  bind(GenericExceptionHandler.class);
  bind(TimelineMetricStore.class).toInstance(timelineMetricStore);
  route("/", AMSController.class);
}
 
Example 26
Source Project: ambari-metrics   Source File: TestTimelineWebServices.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void configureServlets() {
  bind(YarnJacksonJaxbJsonProvider.class);
  bind(TimelineWebServices.class);
  bind(GenericExceptionHandler.class);
  try {
    metricStore = new TestTimelineMetricStore();
  } catch (Exception e) {
    Assert.fail();
  }
  bind(TimelineMetricStore.class).toInstance(metricStore);
  serve("/*").with(GuiceContainer.class);
}
 
Example 27
Source Project: XLearning   Source File: HsWebApp.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setup() {
  bind(HsWebServices.class);
  bind(JAXBContextResolver.class);
  bind(GenericExceptionHandler.class);
  bind(AppContext.class).toInstance(history);
  bind(HistoryContext.class).toInstance(history);
  route("/", HsController.class);
  route(pajoin("/job", APP_ID), HsController.class, "job");
  route(pajoin("/logs", NM_NODENAME, CONTAINER_ID, ENTITY_STRING, APP_OWNER,
      CONTAINER_LOG_TYPE), HsController.class, "logs");
}
 
Example 28
Source Project: hadoop   Source File: TestRMWebServicesFairScheduler.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void configureServlets() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  conf = new YarnConfiguration();
  conf.setClass(YarnConfiguration.RM_SCHEDULER, FairScheduler.class,
    ResourceScheduler.class);
  rm = new MockRM(conf);
  bind(ResourceManager.class).toInstance(rm);
  serve("/*").with(GuiceContainer.class);
}
 
Example 29
Source Project: hadoop   Source File: TestRMWebServices.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void configureServlets() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  Configuration conf = new Configuration();
  conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class,
      ResourceScheduler.class);
  rm = new MockRM(conf);
  bind(ResourceManager.class).toInstance(rm);
  serve("/*").with(GuiceContainer.class);
}
 
Example 30
Source Project: hadoop   Source File: TestRMWebServicesCapacitySched.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void configureServlets() {
  bind(JAXBContextResolver.class);
  bind(RMWebServices.class);
  bind(GenericExceptionHandler.class);
  csConf = new CapacitySchedulerConfiguration();
  setupQueueConfiguration(csConf);
  conf = new YarnConfiguration(csConf);
  conf.setClass(YarnConfiguration.RM_SCHEDULER, CapacityScheduler.class,
  ResourceScheduler.class);
  rm = new MockRM(conf);
  bind(ResourceManager.class).toInstance(rm);
  serve("/*").with(GuiceContainer.class);
}