org.apache.hadoop.yarn.webapp.YarnWebParams Java Examples
The following examples show how to use
org.apache.hadoop.yarn.webapp.YarnWebParams.
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: TestAggregatedLogsBlock.java From big-c with Apache License 2.0 | 6 votes |
private AggregatedLogsBlockForTest getAggregatedLogsBlockForTest( Configuration configuration, String user, String containerId) { HttpServletRequest request = mock(HttpServletRequest.class); when(request.getRemoteUser()).thenReturn(user); AggregatedLogsBlockForTest aggregatedBlock = new AggregatedLogsBlockForTest( configuration); aggregatedBlock.setRequest(request); aggregatedBlock.moreParams().put(YarnWebParams.CONTAINER_ID, containerId); aggregatedBlock.moreParams().put(YarnWebParams.NM_NODENAME, "localhost:1234"); aggregatedBlock.moreParams().put(YarnWebParams.APP_OWNER, user); aggregatedBlock.moreParams().put("start", ""); aggregatedBlock.moreParams().put("end", ""); aggregatedBlock.moreParams().put(YarnWebParams.ENTITY_STRING, "entity"); return aggregatedBlock; }
Example #2
Source File: TestAHSWebApp.java From big-c with Apache License 2.0 | 6 votes |
@Test public void testContainerPage() throws Exception { Injector injector = WebAppTests.createMockInjector(ApplicationBaseProtocol.class, mockApplicationHistoryClientService(1, 1, 1)); ContainerPage containerPageInstance = injector.getInstance(ContainerPage.class); containerPageInstance.render(); WebAppTests.flushOutput(injector); containerPageInstance.set( YarnWebParams.CONTAINER_ID, ContainerId .newContainerId( ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1), 1).toString()); containerPageInstance.render(); WebAppTests.flushOutput(injector); }
Example #3
Source File: TestAHSWebApp.java From big-c with Apache License 2.0 | 6 votes |
@Test public void testAppAttemptPage() throws Exception { Injector injector = WebAppTests.createMockInjector(ApplicationBaseProtocol.class, mockApplicationHistoryClientService(1, 1, 5)); AppAttemptPage appAttemptPageInstance = injector.getInstance(AppAttemptPage.class); appAttemptPageInstance.render(); WebAppTests.flushOutput(injector); appAttemptPageInstance.set(YarnWebParams.APPLICATION_ATTEMPT_ID, ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1) .toString()); appAttemptPageInstance.render(); WebAppTests.flushOutput(injector); }
Example #4
Source File: TestAHSWebApp.java From big-c with Apache License 2.0 | 6 votes |
@Test public void testView() throws Exception { Injector injector = WebAppTests.createMockInjector(ApplicationBaseProtocol.class, mockApplicationHistoryClientService(5, 1, 1)); AHSView ahsViewInstance = injector.getInstance(AHSView.class); ahsViewInstance.render(); WebAppTests.flushOutput(injector); ahsViewInstance.set(YarnWebParams.APP_STATE, YarnApplicationState.FAILED.toString()); ahsViewInstance.render(); WebAppTests.flushOutput(injector); ahsViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin( YarnApplicationState.FAILED.toString(), YarnApplicationState.KILLED)); ahsViewInstance.render(); WebAppTests.flushOutput(injector); }
Example #5
Source File: AppPage.java From big-c with Apache License 2.0 | 6 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String appId = $(YarnWebParams.APPLICATION_ID); set( TITLE, appId.isEmpty() ? "Bad request: missing application ID" : join( "Application ", $(YarnWebParams.APPLICATION_ID))); set(DATATABLES_ID, "attempts ResourceRequests"); set(initID(DATATABLES, "attempts"), WebPageUtils.attemptsTableInit()); setTableStyles(html, "attempts", ".queue {width:6em}", ".ui {width:8em}"); setTableStyles(html, "ResourceRequests"); set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.APP_HISTORY_WEB_UI); }
Example #6
Source File: AppAttemptPage.java From big-c with Apache License 2.0 | 6 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String appAttemptId = $(YarnWebParams.APPLICATION_ATTEMPT_ID); set( TITLE, appAttemptId.isEmpty() ? "Bad request: missing application attempt ID" : join("Application Attempt ", $(YarnWebParams.APPLICATION_ATTEMPT_ID))); set(DATATABLES_ID, "containers"); set(initID(DATATABLES, "containers"), WebPageUtils.containersTableInit()); setTableStyles(html, "containers", ".queue {width:6em}", ".ui {width:8em}"); set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.APP_HISTORY_WEB_UI); }
Example #7
Source File: AppPage.java From big-c with Apache License 2.0 | 6 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String appId = $(YarnWebParams.APPLICATION_ID); set( TITLE, appId.isEmpty() ? "Bad request: missing application ID" : join( "Application ", $(YarnWebParams.APPLICATION_ID))); set(DATATABLES_ID, "attempts ResourceRequests"); set(initID(DATATABLES, "attempts"), WebPageUtils.attemptsTableInit()); setTableStyles(html, "attempts", ".queue {width:6em}", ".ui {width:8em}"); setTableStyles(html, "ResourceRequests"); set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.RM_WEB_UI); }
Example #8
Source File: AppAttemptPage.java From big-c with Apache License 2.0 | 6 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String appAttemptId = $(YarnWebParams.APPLICATION_ATTEMPT_ID); set( TITLE, appAttemptId.isEmpty() ? "Bad request: missing application attempt ID" : join("Application Attempt ", $(YarnWebParams.APPLICATION_ATTEMPT_ID))); set(DATATABLES_ID, "containers"); set(initID(DATATABLES, "containers"), WebPageUtils.containersTableInit()); setTableStyles(html, "containers", ".queue {width:6em}", ".ui {width:8em}"); set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.RM_WEB_UI); }
Example #9
Source File: RmController.java From big-c with Apache License 2.0 | 6 votes |
public void scheduler() { // limit applications to those in states relevant to scheduling set(YarnWebParams.APP_STATE, StringHelper.cjoin( YarnApplicationState.NEW.toString(), YarnApplicationState.NEW_SAVING.toString(), YarnApplicationState.SUBMITTED.toString(), YarnApplicationState.ACCEPTED.toString(), YarnApplicationState.RUNNING.toString())); ResourceManager rm = getInstance(ResourceManager.class); ResourceScheduler rs = rm.getResourceScheduler(); if (rs == null || rs instanceof CapacityScheduler) { setTitle("Capacity Scheduler"); render(CapacitySchedulerPage.class); return; } if (rs instanceof FairScheduler) { setTitle("Fair Scheduler"); render(FairSchedulerPage.class); return; } setTitle("Default Scheduler"); render(DefaultSchedulerPage.class); }
Example #10
Source File: TestAggregatedLogsBlock.java From hadoop with Apache License 2.0 | 6 votes |
private AggregatedLogsBlockForTest getAggregatedLogsBlockForTest( Configuration configuration, String user, String containerId) { HttpServletRequest request = mock(HttpServletRequest.class); when(request.getRemoteUser()).thenReturn(user); AggregatedLogsBlockForTest aggregatedBlock = new AggregatedLogsBlockForTest( configuration); aggregatedBlock.setRequest(request); aggregatedBlock.moreParams().put(YarnWebParams.CONTAINER_ID, containerId); aggregatedBlock.moreParams().put(YarnWebParams.NM_NODENAME, "localhost:1234"); aggregatedBlock.moreParams().put(YarnWebParams.APP_OWNER, user); aggregatedBlock.moreParams().put("start", ""); aggregatedBlock.moreParams().put("end", ""); aggregatedBlock.moreParams().put(YarnWebParams.ENTITY_STRING, "entity"); return aggregatedBlock; }
Example #11
Source File: TestAHSWebApp.java From hadoop with Apache License 2.0 | 6 votes |
@Test public void testContainerPage() throws Exception { Injector injector = WebAppTests.createMockInjector(ApplicationBaseProtocol.class, mockApplicationHistoryClientService(1, 1, 1)); ContainerPage containerPageInstance = injector.getInstance(ContainerPage.class); containerPageInstance.render(); WebAppTests.flushOutput(injector); containerPageInstance.set( YarnWebParams.CONTAINER_ID, ContainerId .newContainerId( ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1), 1).toString()); containerPageInstance.render(); WebAppTests.flushOutput(injector); }
Example #12
Source File: TestAHSWebApp.java From hadoop with Apache License 2.0 | 6 votes |
@Test public void testAppAttemptPage() throws Exception { Injector injector = WebAppTests.createMockInjector(ApplicationBaseProtocol.class, mockApplicationHistoryClientService(1, 1, 5)); AppAttemptPage appAttemptPageInstance = injector.getInstance(AppAttemptPage.class); appAttemptPageInstance.render(); WebAppTests.flushOutput(injector); appAttemptPageInstance.set(YarnWebParams.APPLICATION_ATTEMPT_ID, ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1) .toString()); appAttemptPageInstance.render(); WebAppTests.flushOutput(injector); }
Example #13
Source File: RmController.java From hadoop with Apache License 2.0 | 6 votes |
public void scheduler() { // limit applications to those in states relevant to scheduling set(YarnWebParams.APP_STATE, StringHelper.cjoin( YarnApplicationState.NEW.toString(), YarnApplicationState.NEW_SAVING.toString(), YarnApplicationState.SUBMITTED.toString(), YarnApplicationState.ACCEPTED.toString(), YarnApplicationState.RUNNING.toString())); ResourceManager rm = getInstance(ResourceManager.class); ResourceScheduler rs = rm.getResourceScheduler(); if (rs == null || rs instanceof CapacityScheduler) { setTitle("Capacity Scheduler"); render(CapacitySchedulerPage.class); return; } if (rs instanceof FairScheduler) { setTitle("Fair Scheduler"); render(FairSchedulerPage.class); return; } setTitle("Default Scheduler"); render(DefaultSchedulerPage.class); }
Example #14
Source File: AppPage.java From hadoop with Apache License 2.0 | 6 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String appId = $(YarnWebParams.APPLICATION_ID); set( TITLE, appId.isEmpty() ? "Bad request: missing application ID" : join( "Application ", $(YarnWebParams.APPLICATION_ID))); set(DATATABLES_ID, "attempts ResourceRequests"); set(initID(DATATABLES, "attempts"), WebPageUtils.attemptsTableInit()); setTableStyles(html, "attempts", ".queue {width:6em}", ".ui {width:8em}"); setTableStyles(html, "ResourceRequests"); set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.APP_HISTORY_WEB_UI); }
Example #15
Source File: AppAttemptPage.java From hadoop with Apache License 2.0 | 6 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String appAttemptId = $(YarnWebParams.APPLICATION_ATTEMPT_ID); set( TITLE, appAttemptId.isEmpty() ? "Bad request: missing application attempt ID" : join("Application Attempt ", $(YarnWebParams.APPLICATION_ATTEMPT_ID))); set(DATATABLES_ID, "containers"); set(initID(DATATABLES, "containers"), WebPageUtils.containersTableInit()); setTableStyles(html, "containers", ".queue {width:6em}", ".ui {width:8em}"); set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.APP_HISTORY_WEB_UI); }
Example #16
Source File: AppAttemptPage.java From hadoop with Apache License 2.0 | 6 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String appAttemptId = $(YarnWebParams.APPLICATION_ATTEMPT_ID); set( TITLE, appAttemptId.isEmpty() ? "Bad request: missing application attempt ID" : join("Application Attempt ", $(YarnWebParams.APPLICATION_ATTEMPT_ID))); set(DATATABLES_ID, "containers"); set(initID(DATATABLES, "containers"), WebPageUtils.containersTableInit()); setTableStyles(html, "containers", ".queue {width:6em}", ".ui {width:8em}"); set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.RM_WEB_UI); }
Example #17
Source File: AppPage.java From hadoop with Apache License 2.0 | 6 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String appId = $(YarnWebParams.APPLICATION_ID); set( TITLE, appId.isEmpty() ? "Bad request: missing application ID" : join( "Application ", $(YarnWebParams.APPLICATION_ID))); set(DATATABLES_ID, "attempts ResourceRequests"); set(initID(DATATABLES, "attempts"), WebPageUtils.attemptsTableInit()); setTableStyles(html, "attempts", ".queue {width:6em}", ".ui {width:8em}"); setTableStyles(html, "ResourceRequests"); set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.RM_WEB_UI); }
Example #18
Source File: TestAHSWebApp.java From hadoop with Apache License 2.0 | 6 votes |
@Test public void testView() throws Exception { Injector injector = WebAppTests.createMockInjector(ApplicationBaseProtocol.class, mockApplicationHistoryClientService(5, 1, 1)); AHSView ahsViewInstance = injector.getInstance(AHSView.class); ahsViewInstance.render(); WebAppTests.flushOutput(injector); ahsViewInstance.set(YarnWebParams.APP_STATE, YarnApplicationState.FAILED.toString()); ahsViewInstance.render(); WebAppTests.flushOutput(injector); ahsViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin( YarnApplicationState.FAILED.toString(), YarnApplicationState.KILLED)); ahsViewInstance.render(); WebAppTests.flushOutput(injector); }
Example #19
Source File: TestRMWebApp.java From big-c with Apache License 2.0 | 5 votes |
@Test public void testView() { Injector injector = WebAppTests.createMockInjector(RMContext.class, mockRMContext(15, 1, 2, 8*GiB), new Module() { @Override public void configure(Binder binder) { try { ResourceManager mockRm = mockRm(3, 1, 2, 8*GiB); binder.bind(ResourceManager.class).toInstance(mockRm); binder.bind(ApplicationBaseProtocol.class) .toInstance(mockRm.getClientRMService()); } catch (IOException e) { throw new IllegalStateException(e); } } }); RmView rmViewInstance = injector.getInstance(RmView.class); rmViewInstance.set(YarnWebParams.APP_STATE, YarnApplicationState.RUNNING.toString()); rmViewInstance.render(); WebAppTests.flushOutput(injector); rmViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin( YarnApplicationState.ACCEPTED.toString(), YarnApplicationState.RUNNING.toString())); rmViewInstance.render(); WebAppTests.flushOutput(injector); }
Example #20
Source File: ContainerPage.java From hadoop with Apache License 2.0 | 5 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String containerId = $(YarnWebParams.CONTAINER_ID); set(TITLE, containerId.isEmpty() ? "Bad request: missing container ID" : join("Container ", $(YarnWebParams.CONTAINER_ID))); }
Example #21
Source File: TestAHSWebApp.java From big-c with Apache License 2.0 | 5 votes |
@Test public void testAppPage() throws Exception { Injector injector = WebAppTests.createMockInjector(ApplicationBaseProtocol.class, mockApplicationHistoryClientService(1, 5, 1)); AppPage appPageInstance = injector.getInstance(AppPage.class); appPageInstance.render(); WebAppTests.flushOutput(injector); appPageInstance.set(YarnWebParams.APPLICATION_ID, ApplicationId .newInstance(0, 1).toString()); appPageInstance.render(); WebAppTests.flushOutput(injector); }
Example #22
Source File: NodeLabelsPage.java From hadoop with Apache License 2.0 | 5 votes |
@Override protected void render(Block html) { TBODY<TABLE<Hamlet>> tbody = html.table("#nodelabels"). thead(). tr(). th(".name", "Label Name"). th(".numOfActiveNMs", "Num Of Active NMs"). th(".totalResource", "Total Resource"). _()._(). tbody(); RMNodeLabelsManager nlm = rm.getRMContext().getNodeLabelManager(); for (NodeLabel info : nlm.pullRMNodeLabelsInfo()) { TR<TBODY<TABLE<Hamlet>>> row = tbody.tr().td( info.getLabelName().isEmpty() ? "<NO_LABEL>" : info .getLabelName()); int nActiveNMs = info.getNumActiveNMs(); if (nActiveNMs > 0) { row = row.td() .a(url("nodes", "?" + YarnWebParams.NODE_LABEL + "=" + info.getLabelName()), String.valueOf(nActiveNMs)) ._(); } else { row = row.td(String.valueOf(nActiveNMs)); } row.td(info.getResource().toString())._(); } tbody._()._(); }
Example #23
Source File: ContainerPage.java From big-c with Apache License 2.0 | 5 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String containerId = $(YarnWebParams.CONTAINER_ID); set(TITLE, containerId.isEmpty() ? "Bad request: missing container ID" : join("Container ", $(YarnWebParams.CONTAINER_ID))); }
Example #24
Source File: TestRMWebApp.java From big-c with Apache License 2.0 | 5 votes |
@Test public void testNodesPage() { // 10 nodes. Two of each type. final RMContext rmContext = mockRMContext(3, 2, 12, 8*GiB); Injector injector = WebAppTests.createMockInjector(RMContext.class, rmContext, new Module() { @Override public void configure(Binder binder) { try { binder.bind(ResourceManager.class).toInstance(mockRm(rmContext)); } catch (IOException e) { throw new IllegalStateException(e); } } }); // All nodes NodesPage instance = injector.getInstance(NodesPage.class); instance.render(); WebAppTests.flushOutput(injector); // Unhealthy nodes instance.moreParams().put(YarnWebParams.NODE_STATE, NodeState.UNHEALTHY.toString()); instance.render(); WebAppTests.flushOutput(injector); // Lost nodes instance.moreParams().put(YarnWebParams.NODE_STATE, NodeState.LOST.toString()); instance.render(); WebAppTests.flushOutput(injector); }
Example #25
Source File: NodeLabelsPage.java From big-c with Apache License 2.0 | 5 votes |
@Override protected void render(Block html) { TBODY<TABLE<Hamlet>> tbody = html.table("#nodelabels"). thead(). tr(). th(".name", "Label Name"). th(".numOfActiveNMs", "Num Of Active NMs"). th(".totalResource", "Total Resource"). _()._(). tbody(); RMNodeLabelsManager nlm = rm.getRMContext().getNodeLabelManager(); for (NodeLabel info : nlm.pullRMNodeLabelsInfo()) { TR<TBODY<TABLE<Hamlet>>> row = tbody.tr().td( info.getLabelName().isEmpty() ? "<NO_LABEL>" : info .getLabelName()); int nActiveNMs = info.getNumActiveNMs(); if (nActiveNMs > 0) { row = row.td() .a(url("nodes", "?" + YarnWebParams.NODE_LABEL + "=" + info.getLabelName()), String.valueOf(nActiveNMs)) ._(); } else { row = row.td(String.valueOf(nActiveNMs)); } row.td(info.getResource().toString())._(); } tbody._()._(); }
Example #26
Source File: TestRMWebApp.java From hadoop with Apache License 2.0 | 5 votes |
@Test public void testView() { Injector injector = WebAppTests.createMockInjector(RMContext.class, mockRMContext(15, 1, 2, 8*GiB), new Module() { @Override public void configure(Binder binder) { try { ResourceManager mockRm = mockRm(3, 1, 2, 8*GiB); binder.bind(ResourceManager.class).toInstance(mockRm); binder.bind(ApplicationBaseProtocol.class) .toInstance(mockRm.getClientRMService()); } catch (IOException e) { throw new IllegalStateException(e); } } }); RmView rmViewInstance = injector.getInstance(RmView.class); rmViewInstance.set(YarnWebParams.APP_STATE, YarnApplicationState.RUNNING.toString()); rmViewInstance.render(); WebAppTests.flushOutput(injector); rmViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin( YarnApplicationState.ACCEPTED.toString(), YarnApplicationState.RUNNING.toString())); rmViewInstance.render(); WebAppTests.flushOutput(injector); }
Example #27
Source File: TestRMWebApp.java From hadoop with Apache License 2.0 | 5 votes |
@Test public void testNodesPage() { // 10 nodes. Two of each type. final RMContext rmContext = mockRMContext(3, 2, 12, 8*GiB); Injector injector = WebAppTests.createMockInjector(RMContext.class, rmContext, new Module() { @Override public void configure(Binder binder) { try { binder.bind(ResourceManager.class).toInstance(mockRm(rmContext)); } catch (IOException e) { throw new IllegalStateException(e); } } }); // All nodes NodesPage instance = injector.getInstance(NodesPage.class); instance.render(); WebAppTests.flushOutput(injector); // Unhealthy nodes instance.moreParams().put(YarnWebParams.NODE_STATE, NodeState.UNHEALTHY.toString()); instance.render(); WebAppTests.flushOutput(injector); // Lost nodes instance.moreParams().put(YarnWebParams.NODE_STATE, NodeState.LOST.toString()); instance.render(); WebAppTests.flushOutput(injector); }
Example #28
Source File: ContainerPage.java From big-c with Apache License 2.0 | 5 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String containerId = $(YarnWebParams.CONTAINER_ID); set(TITLE, containerId.isEmpty() ? "Bad request: missing container ID" : join("Container ", $(YarnWebParams.CONTAINER_ID))); }
Example #29
Source File: ContainerPage.java From hadoop with Apache License 2.0 | 5 votes |
@Override protected void preHead(Page.HTML<_> html) { commonPreHead(html); String containerId = $(YarnWebParams.CONTAINER_ID); set(TITLE, containerId.isEmpty() ? "Bad request: missing container ID" : join("Container ", $(YarnWebParams.CONTAINER_ID))); }
Example #30
Source File: TestAHSWebApp.java From hadoop with Apache License 2.0 | 5 votes |
@Test public void testAppPage() throws Exception { Injector injector = WebAppTests.createMockInjector(ApplicationBaseProtocol.class, mockApplicationHistoryClientService(1, 5, 1)); AppPage appPageInstance = injector.getInstance(AppPage.class); appPageInstance.render(); WebAppTests.flushOutput(injector); appPageInstance.set(YarnWebParams.APPLICATION_ID, ApplicationId .newInstance(0, 1).toString()); appPageInstance.render(); WebAppTests.flushOutput(injector); }