Java 类org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl 实例源码

项目:hadoop    文件:RMStateStoreTestBase.java   
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;
}
项目:aliyun-oss-hadoop-fs    文件:RMStateStoreTestBase.java   
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;
}
项目:big-c    文件:RMStateStoreTestBase.java   
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;
}
项目:hadoop-plus    文件:TestRMAppTransitions.java   
@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.*");
}
项目:hops    文件:RMStateStoreTestBase.java   
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;
}
项目:hadoop-TCP    文件:TestRMAppTransitions.java   
@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.*");
}
项目:hardfs    文件:TestRMAppTransitions.java   
@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.*");
}
项目:hadoop    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:hadoop    文件:TestRMAppTransitions.java   
@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);
}
项目:hadoop    文件:TestZKRMStateStore.java   
@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();
}
项目:aliyun-oss-hadoop-fs    文件:TestPBImplRecords.java   
@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());
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestRMAppTransitions.java   
@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);
}
项目:aliyun-oss-hadoop-fs    文件:TestZKRMStateStore.java   
@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();
}
项目:big-c    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:big-c    文件:TestRMAppTransitions.java   
@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);
}
项目:big-c    文件:TestZKRMStateStore.java   
@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();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestRMAppTransitions.java   
@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);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:RMStateStoreTestBase.java   
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;
}
项目:hadoop-plus    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:hadoop-plus    文件:TestRMStateStore.java   
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);
}
项目:hops    文件:TestPBImplRecords.java   
@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());
}
项目:hops    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:hops    文件:TestRMAppTransitions.java   
@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);
}
项目:hops    文件:TestZKRMStateStore.java   
@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();
}
项目:hadoop-TCP    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:hadoop-TCP    文件:TestRMStateStore.java   
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);
}
项目:hardfs    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:hardfs    文件:TestRMStateStore.java   
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);
}
项目:hadoop-on-lustre2    文件:ApplicationStateDataPBImpl.java   
private void mergeLocalToBuilder() {
  if (this.applicationSubmissionContext != null) {
    builder.setApplicationSubmissionContext(
        ((ApplicationSubmissionContextPBImpl)applicationSubmissionContext)
        .getProto());
  }
}
项目:hadoop-on-lustre2    文件:TestRMAppTransitions.java   
@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);
}
项目:hadoop-on-lustre2    文件:RMStateStoreTestBase.java   
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;
}
项目:hadoop    文件:SubmitApplicationRequestPBImpl.java   
private ApplicationSubmissionContextPBImpl convertFromProtoFormat(ApplicationSubmissionContextProto p) {
  return new ApplicationSubmissionContextPBImpl(p);
}
项目:hadoop    文件:SubmitApplicationRequestPBImpl.java   
private ApplicationSubmissionContextProto convertToProtoFormat(ApplicationSubmissionContext t) {
  return ((ApplicationSubmissionContextPBImpl)t).getProto();
}
项目:hadoop    文件:MockRMApp.java   
@Override
public ApplicationSubmissionContext getApplicationSubmissionContext() {
  return new ApplicationSubmissionContextPBImpl();
}
项目:aliyun-oss-hadoop-fs    文件:SubmitApplicationRequestPBImpl.java   
private ApplicationSubmissionContextPBImpl convertFromProtoFormat(ApplicationSubmissionContextProto p) {
  return new ApplicationSubmissionContextPBImpl(p);
}
项目:aliyun-oss-hadoop-fs    文件:SubmitApplicationRequestPBImpl.java   
private ApplicationSubmissionContextProto convertToProtoFormat(ApplicationSubmissionContext t) {
  return ((ApplicationSubmissionContextPBImpl)t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:MockRMApp.java   
@Override
public ApplicationSubmissionContext getApplicationSubmissionContext() {
  return new ApplicationSubmissionContextPBImpl();
}
项目:big-c    文件:SubmitApplicationRequestPBImpl.java   
private ApplicationSubmissionContextPBImpl convertFromProtoFormat(ApplicationSubmissionContextProto p) {
  return new ApplicationSubmissionContextPBImpl(p);
}