当前位置: 首页>>代码示例>>Java>>正文


Java GetApplicationReportRequest.newInstance方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest.newInstance方法的典型用法代码示例。如果您正苦于以下问题:Java GetApplicationReportRequest.newInstance方法的具体用法?Java GetApplicationReportRequest.newInstance怎么用?Java GetApplicationReportRequest.newInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest的用法示例。


在下文中一共展示了GetApplicationReportRequest.newInstance方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyGetClientAMToken

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
private void verifyGetClientAMToken(String submitter, String queueAdmin,
    String queueName, boolean setupACLs) throws Exception {
  ApplicationId applicationId =
      submitAppAndGetAppId(submitter, queueName, setupACLs);
  final GetApplicationReportRequest appReportRequest =
      GetApplicationReportRequest.newInstance(applicationId);

  ApplicationClientProtocol submitterClient = getRMClientForUser(submitter);
  ApplicationClientProtocol adMinUserClient = getRMClientForUser(queueAdmin);

  GetApplicationReportResponse submitterGetReport =
      submitterClient.getApplicationReport(appReportRequest);
  GetApplicationReportResponse adMinUserGetReport =
      adMinUserClient.getApplicationReport(appReportRequest);

  Assert.assertEquals(submitterGetReport.getApplicationReport()
    .getClientToAMToken(), adMinUserGetReport.getApplicationReport()
    .getClientToAMToken());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:QueueACLsTestBase.java

示例2: testInvalidatedAMHostPortOnAMRestart

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Test (timeout = 60000)
public void testInvalidatedAMHostPortOnAMRestart() throws Exception {
  MockRM rm1 = new MockRM(conf);
  rm1.start();
  MockNM nm1 =
      new MockNM("127.0.0.1:1234", 15120, rm1.getResourceTrackerService());
  nm1.registerNode();

  // a failed app
  RMApp app2 = rm1.submitApp(200);
  MockAM am2 = MockRM.launchAndRegisterAM(app2, rm1, nm1);
  nm1
    .nodeHeartbeat(am2.getApplicationAttemptId(), 1, ContainerState.COMPLETE);
  am2.waitForState(RMAppAttemptState.FAILED);
  rm1.waitForState(app2.getApplicationId(), RMAppState.ACCEPTED);

  // before new attempt is launched, the app report returns the invalid AM
  // host and port.
  GetApplicationReportRequest request1 =
      GetApplicationReportRequest.newInstance(app2.getApplicationId());
  ApplicationReport report1 =
      rm1.getClientRMService().getApplicationReport(request1)
        .getApplicationReport();
  Assert.assertEquals("N/A", report1.getHost());
  Assert.assertEquals(-1, report1.getRpcPort());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:TestRM.java

示例3: testApplicationReport

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Test
public void testApplicationReport() throws IOException, YarnException {
  ApplicationId appId = null;
  appId = ApplicationId.newInstance(0, 1);
  GetApplicationReportRequest request =
      GetApplicationReportRequest.newInstance(appId);
  GetApplicationReportResponse response =
      clientService.getApplicationReport(request);
  ApplicationReport appReport = response.getApplicationReport();
  Assert.assertNotNull(appReport);
  Assert.assertEquals(123, appReport.getApplicationResourceUsageReport()
      .getMemorySeconds());
  Assert.assertEquals(345, appReport.getApplicationResourceUsageReport()
      .getVcoreSeconds());
  Assert.assertEquals(345, appReport.getApplicationResourceUsageReport()
      .getGcoreSeconds());
  Assert.assertEquals("application_0_0001", appReport.getApplicationId()
    .toString());
  Assert.assertEquals("test app type",
      appReport.getApplicationType().toString());
  Assert.assertEquals("test queue", appReport.getQueue().toString());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TestApplicationHistoryClientService.java

示例4: testApplicationReport

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Test
public void testApplicationReport() throws IOException, YarnException {
  ApplicationId appId = null;
  appId = ApplicationId.newInstance(0, 1);
  GetApplicationReportRequest request =
      GetApplicationReportRequest.newInstance(appId);
  GetApplicationReportResponse response =
      clientService.getApplicationReport(request);
  ApplicationReport appReport = response.getApplicationReport();
  Assert.assertNotNull(appReport);
  Assert.assertEquals(123, appReport.getApplicationResourceUsageReport()
      .getMemorySeconds());
  Assert.assertEquals(345, appReport.getApplicationResourceUsageReport()
      .getVcoreSeconds());
  Assert.assertEquals("application_0_0001", appReport.getApplicationId()
    .toString());
  Assert.assertEquals("test app type",
      appReport.getApplicationType().toString());
  Assert.assertEquals("test queue", appReport.getQueue().toString());
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:TestApplicationHistoryClientService.java

示例5: testApplicationReport

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Test
public void testApplicationReport() throws IOException, YarnException {
  ApplicationId appId = null;
  appId = ApplicationId.newInstance(0, 1);
  GetApplicationReportRequest request =
      GetApplicationReportRequest.newInstance(appId);
  GetApplicationReportResponse response =
      clientService.getClientHandler().getApplicationReport(request);
  ApplicationReport appReport = response.getApplicationReport();
  Assert.assertNotNull(appReport);
  Assert.assertEquals("application_0_0001", appReport.getApplicationId()
    .toString());
  Assert.assertEquals("test app type",
      appReport.getApplicationType().toString());
  Assert.assertEquals("test queue", appReport.getQueue().toString());
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:17,代码来源:TestApplicationHistoryClientService.java

示例6: testApplicationReport

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Test
public void testApplicationReport() throws IOException, YarnException {
  ApplicationId appId = null;
  appId = ApplicationId.newInstance(0, 1);
  GetApplicationReportRequest request =
      GetApplicationReportRequest.newInstance(appId);
  GetApplicationReportResponse response =
      clientService.getApplicationReport(request);
  ApplicationReport appReport = response.getApplicationReport();
  Assert.assertNotNull(appReport);
  Assert.assertEquals(123, appReport.getApplicationResourceUsageReport()
      .getMemorySeconds());
  Assert.assertEquals(345, appReport.getApplicationResourceUsageReport()
      .getVcoreSeconds());
  Assert.assertEquals(345, appReport.getApplicationResourceUsageReport()
             .getGPUSeconds());
  Assert.assertEquals("application_0_0001", appReport.getApplicationId()
    .toString());
  Assert.assertEquals("test app type",
      appReport.getApplicationType().toString());
  Assert.assertEquals("test queue", appReport.getQueue().toString());
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:23,代码来源:TestApplicationHistoryClientService.java

示例7: testApplicationReport

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Test
public void testApplicationReport() throws IOException, YarnException {
  ApplicationId appId = null;
  appId = ApplicationId.newInstance(0, 1);
  writeApplicationStartData(appId);
  writeApplicationFinishData(appId);
  GetApplicationReportRequest request =
      GetApplicationReportRequest.newInstance(appId);
  GetApplicationReportResponse response =
      historyServer.getClientService().getClientHandler()
        .getApplicationReport(request);
  ApplicationReport appReport = response.getApplicationReport();
  Assert.assertNotNull(appReport);
  Assert.assertEquals("application_0_0001", appReport.getApplicationId()
    .toString());
  Assert.assertEquals("test type", appReport.getApplicationType().toString());
  Assert.assertEquals("test queue", appReport.getQueue().toString());
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:19,代码来源:TestApplicationHistoryClientService.java

示例8: verifyAppReportAfterRMRestart

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
private ApplicationReport verifyAppReportAfterRMRestart(RMApp app, MockRM rm)
    throws Exception {
  GetApplicationReportRequest reportRequest =
      GetApplicationReportRequest.newInstance(app.getApplicationId());
  GetApplicationReportResponse response =
      rm.getClientRMService().getApplicationReport(reportRequest);
  ApplicationReport report = response.getApplicationReport();
  Assert.assertEquals(app.getStartTime(), report.getStartTime());
  Assert.assertEquals(app.getFinishTime(), report.getFinishTime());
  Assert.assertEquals(app.createApplicationState(),
    report.getYarnApplicationState());
  Assert.assertTrue(1 == report.getProgress());
  return response.getApplicationReport();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestRMRestart.java

示例9: getApplicationReport

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Override
public ApplicationReport getApplicationReport(ApplicationId appId)
    throws YarnException, IOException {
  GetApplicationReportRequest request = GetApplicationReportRequest
      .newInstance(appId);
  GetApplicationReportResponse response = ahsClient
      .getApplicationReport(request);
  return response.getApplicationReport();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:AHSClientImpl.java

示例10: testInvalidatedAMHostPortOnAMRestart

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Test (timeout = 60000)
public void testInvalidatedAMHostPortOnAMRestart() throws Exception {
  MockRM rm1 = new MockRM(conf);
  rm1.start();
  MockNM nm1 =
      new MockNM("127.0.0.1:1234", 15120, rm1.getResourceTrackerService());
  Assume.assumeFalse(rm1.getResourceScheduler() instanceof FairScheduler);
  nm1.registerNode();

  // a failed app
  RMApp app2 = rm1.submitApp(200);
  MockAM am2 = MockRM.launchAndRegisterAM(app2, rm1, nm1);
  nm1
    .nodeHeartbeat(am2.getApplicationAttemptId(), 1, ContainerState.COMPLETE);
  am2.waitForState(RMAppAttemptState.FAILED);
  rm1.waitForState(app2.getApplicationId(), RMAppState.ACCEPTED);

  // before new attempt is launched, the app report returns the invalid AM
  // host and port.
  GetApplicationReportRequest request1 =
      GetApplicationReportRequest.newInstance(app2.getApplicationId());
  ApplicationReport report1 =
      rm1.getClientRMService().getApplicationReport(request1)
        .getApplicationReport();
  Assert.assertEquals("N/A", report1.getHost());
  Assert.assertEquals(-1, report1.getRpcPort());
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:28,代码来源:TestRM.java

示例11: testInvalidatedAMHostPortOnAMRestart

import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; //导入方法依赖的package包/类
@Test (timeout = 60000)
public void testInvalidatedAMHostPortOnAMRestart() throws Exception {
  YarnConfiguration conf = new YarnConfiguration();
  MockRM rm1 = new MockRM(conf);
  rm1.start();
  MockNM nm1 =
      new MockNM("127.0.0.1:1234", 15120, rm1.getResourceTrackerService());
  nm1.registerNode();

  // a failed app
  RMApp app2 = rm1.submitApp(200);
  MockAM am2 = MockRM.launchAndRegisterAM(app2, rm1, nm1);
  nm1
    .nodeHeartbeat(am2.getApplicationAttemptId(), 1, ContainerState.COMPLETE);
  am2.waitForState(RMAppAttemptState.FAILED);
  rm1.waitForState(app2.getApplicationId(), RMAppState.ACCEPTED);

  // before new attempt is launched, the app report returns the invalid AM
  // host and port.
  GetApplicationReportRequest request1 =
      GetApplicationReportRequest.newInstance(app2.getApplicationId());
  ApplicationReport report1 =
      rm1.getClientRMService().getApplicationReport(request1)
        .getApplicationReport();
  Assert.assertEquals("N/A", report1.getHost());
  Assert.assertEquals(-1, report1.getRpcPort());
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:28,代码来源:TestRM.java


注:本文中的org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest.newInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。