• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ApplicationSubmissionContextPBImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl的典型用法代码示例。如果您正苦于以下问题:Java ApplicationSubmissionContextPBImpl类的具体用法?Java ApplicationSubmissionContextPBImpl怎么用?Java ApplicationSubmissionContextPBImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ApplicationSubmissionContextPBImpl类属于org.apache.hadoop.yarn.api.records.impl.pb包,在下文中一共展示了ApplicationSubmissionContextPBImpl类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: storeApp

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
protected RMApp storeApp(RMStateStore store, ApplicationId appId,
    long submitTime,
    long startTime) throws Exception {
  ApplicationSubmissionContext context =
      new ApplicationSubmissionContextPBImpl();
  context.setApplicationId(appId);

  RMApp mockApp = mock(RMApp.class);
  when(mockApp.getApplicationId()).thenReturn(appId);
  when(mockApp.getSubmitTime()).thenReturn(submitTime);
  when(mockApp.getStartTime()).thenReturn(startTime);
  when(mockApp.getApplicationSubmissionContext()).thenReturn(context);
  when(mockApp.getUser()).thenReturn("test");
  store.storeNewApplication(mockApp);
  return mockApp;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:RMStateStoreTestBase.java


示例2: storeApp

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
protected RMApp storeApp(RMStateStore store, ApplicationId appId,
    long submitTime,
    long startTime) throws Exception {
  ApplicationSubmissionContext context =
      new ApplicationSubmissionContextPBImpl();
  context.setApplicationId(appId);

  RMApp mockApp = mock(RMApp.class);
  when(mockApp.getApplicationId()).thenReturn(appId);
  when(mockApp.getSubmitTime()).thenReturn(submitTime);
  when(mockApp.getStartTime()).thenReturn(startTime);
  when(mockApp.getApplicationSubmissionContext()).thenReturn(context);
  when(mockApp.getUser()).thenReturn("test");
  when(mockApp.getCallerContext())
      .thenReturn(new CallerContext.Builder("context").build());
  store.storeNewApplication(mockApp);
  return mockApp;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:19,代码来源:RMStateStoreTestBase.java


示例3: testUnmanagedApp

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Test
public void testUnmanagedApp() throws IOException {
  ApplicationSubmissionContext subContext = new ApplicationSubmissionContextPBImpl();
  subContext.setUnmanagedAM(true);

  // test success path
  LOG.info("--- START: testUnmanagedAppSuccessPath ---");
  final String diagMsg = "some diagnostics";
  RMApp application = testCreateAppFinished(subContext, diagMsg);
  Assert.assertTrue("Finished app missing diagnostics",
      application.getDiagnostics().indexOf(diagMsg) != -1);

  // test app fails after 1 app attempt failure
  LOG.info("--- START: testUnmanagedAppFailPath ---");
  application = testCreateAppRunning(subContext);
  RMAppEvent event = new RMAppFailedAttemptEvent(
      application.getApplicationId(), RMAppEventType.ATTEMPT_FAILED, "");
  application.handle(event);
  rmDispatcher.await();
  RMAppAttempt appAttempt = application.getCurrentAppAttempt();
  Assert.assertEquals(1, appAttempt.getAppAttemptId().getAttemptId());
  assertFailed(application,
      ".*Unmanaged application.*Failing the application.*");
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:25,代码来源:TestRMAppTransitions.java


示例4: mergeLocalToBuilder

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:ApplicationStateDataPBImpl.java


示例5: testUnmanagedApp

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Test
public void testUnmanagedApp() throws IOException {
  ApplicationSubmissionContext subContext = new ApplicationSubmissionContextPBImpl();
  subContext.setUnmanagedAM(true);

  // test success path
  LOG.info("--- START: testUnmanagedAppSuccessPath ---");
  final String diagMsg = "some diagnostics";
  RMApp application = testCreateAppFinished(subContext, diagMsg);
  Assert.assertTrue("Finished app missing diagnostics",
      application.getDiagnostics().indexOf(diagMsg) != -1);

  // reset the counter of Mockito.verify
  reset(writer);
  reset(publisher);

  // test app fails after 1 app attempt failure
  LOG.info("--- START: testUnmanagedAppFailPath ---");
  application = testCreateAppRunning(subContext);
  RMAppEvent event = new RMAppFailedAttemptEvent(
      application.getApplicationId(), RMAppEventType.ATTEMPT_FAILED, "", false);
  application.handle(event);
  rmDispatcher.await();
  RMAppAttempt appAttempt = application.getCurrentAppAttempt();
  Assert.assertEquals(1, appAttempt.getAppAttemptId().getAttemptId());
  sendAppUpdateSavedEvent(application);
  assertFailed(application,
      ".*Unmanaged application.*Failing the application.*");
  assertAppFinalStateSaved(application);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:31,代码来源:TestRMAppTransitions.java


示例6: testDuplicateRMAppDeletion

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Test
public void testDuplicateRMAppDeletion() throws Exception {
  TestZKRMStateStoreTester zkTester = new TestZKRMStateStoreTester();
  long submitTime = System.currentTimeMillis();
  long startTime = System.currentTimeMillis() + 1234;
  RMStateStore store = zkTester.getRMStateStore();
  TestDispatcher dispatcher = new TestDispatcher();
  store.setRMDispatcher(dispatcher);

  ApplicationAttemptId attemptIdRemoved = ConverterUtils
      .toApplicationAttemptId("appattempt_1352994193343_0002_000001");
  ApplicationId appIdRemoved = attemptIdRemoved.getApplicationId();
  storeApp(store, appIdRemoved, submitTime, startTime);
  storeAttempt(store, attemptIdRemoved,
      "container_1352994193343_0002_01_000001", null, null, dispatcher);

  ApplicationSubmissionContext context =
      new ApplicationSubmissionContextPBImpl();
  context.setApplicationId(appIdRemoved);
  ApplicationStateData appStateRemoved =
      ApplicationStateData.newInstance(
          submitTime, startTime, context, "user1");
  appStateRemoved.attempts.put(attemptIdRemoved, null);
  store.removeApplicationStateInternal(appStateRemoved);
  try {
    store.removeApplicationStateInternal(appStateRemoved);
  } catch (KeeperException.NoNodeException nne) {
    Assert.fail("NoNodeException should not happen.");
  }
  store.close();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:32,代码来源:TestZKRMStateStore.java


示例7: testApplicationSubmissionContextPBImpl

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Test
public void testApplicationSubmissionContextPBImpl() throws Exception {
  validatePBImplRecord(ApplicationSubmissionContextPBImpl.class,
      ApplicationSubmissionContextProto.class);
  
  ApplicationSubmissionContext ctx =
      ApplicationSubmissionContext.newInstance(null, null, null, null, null,
          false, false, 0, Resources.none(), null, false, null, null);
  
  Assert.assertNotNull(ctx.getResource());
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:12,代码来源:TestPBImplRecords.java


示例8: testDuplicateRMAppDeletion

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Test
public void testDuplicateRMAppDeletion() throws Exception {
  TestZKRMStateStoreTester zkTester = new TestZKRMStateStoreTester();
  long submitTime = System.currentTimeMillis();
  long startTime = System.currentTimeMillis() + 1234;
  RMStateStore store = zkTester.getRMStateStore();
  TestDispatcher dispatcher = new TestDispatcher();
  store.setRMDispatcher(dispatcher);

  ApplicationAttemptId attemptIdRemoved = ConverterUtils
      .toApplicationAttemptId("appattempt_1352994193343_0002_000001");
  ApplicationId appIdRemoved = attemptIdRemoved.getApplicationId();
  storeApp(store, appIdRemoved, submitTime, startTime);
  storeAttempt(store, attemptIdRemoved,
      "container_1352994193343_0002_01_000001", null, null, dispatcher);

  ApplicationSubmissionContext context =
      new ApplicationSubmissionContextPBImpl();
  context.setApplicationId(appIdRemoved);

  ApplicationStateData appStateRemoved =
      ApplicationStateData.newInstance(
          submitTime, startTime, context, "user1");
  appStateRemoved.attempts.put(attemptIdRemoved, null);
  store.removeApplicationStateInternal(appStateRemoved);
  try {
    store.removeApplicationStateInternal(appStateRemoved);
  } catch (KeeperException.NoNodeException nne) {
    Assert.fail("NoNodeException should not happen.");
  }
  store.close();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:33,代码来源:TestZKRMStateStore.java


示例9: testUnmanagedApp

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Test
public void testUnmanagedApp() throws IOException {
  ApplicationSubmissionContext subContext = new ApplicationSubmissionContextPBImpl();
  subContext.setUnmanagedAM(true);

  // test success path
  LOG.info("--- START: testUnmanagedAppSuccessPath ---");
  final String diagMsg = "some diagnostics";
  RMApp application = testCreateAppFinished(subContext, diagMsg);
  Assert.assertTrue("Finished app missing diagnostics",
      application.getDiagnostics().indexOf(diagMsg) != -1);

  // reset the counter of Mockito.verify
  reset(writer);
  reset(publisher);

  // test app fails after 1 app attempt failure
  LOG.info("--- START: testUnmanagedAppFailPath ---");
  application = testCreateAppRunning(subContext);
  RMAppEvent event = new RMAppFailedAttemptEvent(
      application.getApplicationId(), RMAppEventType.ATTEMPT_FAILED, "", false);
  application.handle(event);
  rmDispatcher.await();
  RMAppAttempt appAttempt = application.getCurrentAppAttempt();
  Assert.assertEquals(1, appAttempt.getAppAttemptId().getAttemptId());
  sendAppUpdateSavedEvent(application);
  assertFailed(application,
      ".*Unmanaged application.*Failing the application.*");
  assertAppFinalStateSaved(application);
  assertWroteFlagFileForFailedAM(application);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:32,代码来源:TestRMAppTransitions.java


示例10: storeApp

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
RMApp storeApp(RMStateStore store, ApplicationId appId, long submitTime,
    long startTime) throws Exception {
  ApplicationSubmissionContext context =
      new ApplicationSubmissionContextPBImpl();
  context.setApplicationId(appId);

  RMApp mockApp = mock(RMApp.class);
  when(mockApp.getApplicationId()).thenReturn(appId);
  when(mockApp.getSubmitTime()).thenReturn(submitTime);
  when(mockApp.getStartTime()).thenReturn(startTime);
  when(mockApp.getApplicationSubmissionContext()).thenReturn(context);
  when(mockApp.getUser()).thenReturn("test");
  store.storeNewApplication(mockApp);
  return mockApp;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:16,代码来源:RMStateStoreTestBase.java


示例11: storeApp

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
void storeApp(RMStateStore store, ApplicationId appId, long time)
                                                            throws Exception {
  ApplicationSubmissionContext context = new ApplicationSubmissionContextPBImpl();
  context.setApplicationId(appId);

  RMApp mockApp = mock(RMApp.class);
  when(mockApp.getApplicationId()).thenReturn(appId);
  when(mockApp.getSubmitTime()).thenReturn(time);
  when(mockApp.getApplicationSubmissionContext()).thenReturn(context);
  when(mockApp.getUser()).thenReturn("test");
  store.storeApplication(mockApp);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:13,代码来源:TestRMStateStore.java


示例12: testDuplicateRMAppDeletion

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Test
public void testDuplicateRMAppDeletion() throws Exception {
  TestZKRMStateStoreTester zkTester = new TestZKRMStateStoreTester();
  long submitTime = System.currentTimeMillis();
  long startTime = System.currentTimeMillis() + 1234;
  RMStateStore store = zkTester.getRMStateStore();
  TestDispatcher dispatcher = new TestDispatcher();
  store.setRMDispatcher(dispatcher);

  ApplicationAttemptId attemptIdRemoved = ApplicationAttemptId.fromString(
      "appattempt_1352994193343_0002_000001");
  ApplicationId appIdRemoved = attemptIdRemoved.getApplicationId();
  storeApp(store, appIdRemoved, submitTime, startTime);
  storeAttempt(store, attemptIdRemoved,
      "container_1352994193343_0002_01_000001", null, null, dispatcher);

  ApplicationSubmissionContext context =
      new ApplicationSubmissionContextPBImpl();
  context.setApplicationId(appIdRemoved);

  ApplicationStateData appStateRemoved =
      ApplicationStateData.newInstance(
          submitTime, startTime, context, "user1");
  appStateRemoved.attempts.put(attemptIdRemoved, null);
  store.removeApplicationStateInternal(appStateRemoved);
  try {
    store.removeApplicationStateInternal(appStateRemoved);
  } catch (KeeperException.NoNodeException nne) {
    Assert.fail("NoNodeException should not happen.");
  }
  store.close();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:33,代码来源:TestZKRMStateStore.java


示例13: testUnmanagedApp

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Test
public void testUnmanagedApp() throws IOException {
  ApplicationSubmissionContext subContext = new ApplicationSubmissionContextPBImpl();
  subContext.setUnmanagedAM(true);

  // test success path
  LOG.info("--- START: testUnmanagedAppSuccessPath ---");
  final String diagMsg = "some diagnostics";
  RMApp application = testCreateAppFinished(subContext, diagMsg);
  Assert.assertTrue("Finished app missing diagnostics",
      application.getDiagnostics().indexOf(diagMsg) != -1);

  // reset the counter of Mockito.verify
  reset(writer);

  // test app fails after 1 app attempt failure
  LOG.info("--- START: testUnmanagedAppFailPath ---");
  application = testCreateAppRunning(subContext);
  RMAppEvent event = new RMAppFailedAttemptEvent(
      application.getApplicationId(), RMAppEventType.ATTEMPT_FAILED, "", false);
  application.handle(event);
  rmDispatcher.await();
  RMAppAttempt appAttempt = application.getCurrentAppAttempt();
  Assert.assertEquals(1, appAttempt.getAppAttemptId().getAttemptId());
  sendAppUpdateSavedEvent(application);
  assertFailed(application,
      ".*Unmanaged application.*Failing the application.*");
  assertAppFinalStateSaved(application);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:30,代码来源:TestRMAppTransitions.java


示例14: convertFromProtoFormat

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
private ApplicationSubmissionContextPBImpl convertFromProtoFormat(ApplicationSubmissionContextProto p) {
  return new ApplicationSubmissionContextPBImpl(p);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:SubmitApplicationRequestPBImpl.java


示例15: convertToProtoFormat

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
private ApplicationSubmissionContextProto convertToProtoFormat(ApplicationSubmissionContext t) {
  return ((ApplicationSubmissionContextPBImpl)t).getProto();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:SubmitApplicationRequestPBImpl.java


示例16: getApplicationSubmissionContext

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; //导入依赖的package包/类
@Override
public ApplicationSubmissionContext getApplicationSubmissionContext() {
  return new ApplicationSubmissionContextPBImpl();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:MockRMApp.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GameData类代码示例发布时间:2022-05-22
下一篇:
Java CapacitySchedulerLeafQueueInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap