Java 类org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest 实例源码

项目:hadoop    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByScheduler() throws Exception {
  failMove = true;

  // Submit application
  Application application = new Application("user1", resourceManager);
  application.submit();

  // Wait for app to be accepted
  RMApp app = resourceManager.rmContext.getRMApps()
          .get(application.getApplicationId());
  while (app.getState() != RMAppState.ACCEPTED) {
    Thread.sleep(100);
  }

  ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    // FIFO scheduler does not support moves
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(
            application.getApplicationId(), "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals("Move not supported", ex.getCause().getMessage());
  }
}
项目:hadoop    文件:TestMoveApplication.java   
@Test (timeout = 10000)
    public
    void testMoveSuccessful() throws Exception {
  MockRM rm1 = new MockRM(conf);
  rm1.start();
  RMApp app = rm1.submitApp(1024);
  ClientRMService clientRMService = rm1.getClientRMService();
  // FIFO scheduler does not support moves
  clientRMService
    .moveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
      .newInstance(app.getApplicationId(), "newqueue"));

  RMApp rmApp = rm1.getRMContext().getRMApps().get(app.getApplicationId());
  assertEquals("newqueue", rmApp.getQueue());
  rm1.stop();
}
项目:hadoop    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByPermissions() throws Exception {
  failMove = true;

  // Submit application
  final Application application = new Application("user1", resourceManager);
  application.submit();

  final ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    UserGroupInformation.createRemoteUser("otheruser").doAs(
        new PrivilegedExceptionAction<MoveApplicationAcrossQueuesResponse>() {
          @Override
          public MoveApplicationAcrossQueuesResponse run() throws Exception {
            return clientRMService.moveApplicationAcrossQueues(
                MoveApplicationAcrossQueuesRequest.newInstance(
                    application.getApplicationId(), "newqueue"));
          }

        });
    fail("Should have hit exception");
  } catch (Exception ex) {
    assertEquals(AccessControlException.class, ex.getCause().getCause().getClass());
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByScheduler() throws Exception {
  failMove = true;

  // Submit application
  Application application = new Application("user1", resourceManager);
  application.submit();

  // Wait for app to be accepted
  RMApp app = resourceManager.rmContext.getRMApps()
          .get(application.getApplicationId());
  while (app.getState() != RMAppState.ACCEPTED) {
    Thread.sleep(100);
  }

  ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    // FIFO scheduler does not support moves
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(
            application.getApplicationId(), "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals("Move not supported", ex.getCause().getMessage());
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestMoveApplication.java   
@Test (timeout = 10000)
    public
    void testMoveSuccessful() throws Exception {
  MockRM rm1 = new MockRM(conf);
  rm1.start();
  RMApp app = rm1.submitApp(1024);
  ClientRMService clientRMService = rm1.getClientRMService();
  // FIFO scheduler does not support moves
  clientRMService
    .moveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
      .newInstance(app.getApplicationId(), "newqueue"));

  RMApp rmApp = rm1.getRMContext().getRMApps().get(app.getApplicationId());
  assertEquals("newqueue", rmApp.getQueue());
  rm1.stop();
}
项目:aliyun-oss-hadoop-fs    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByPermissions() throws Exception {
  failMove = true;

  // Submit application
  final Application application = new Application("user1", resourceManager);
  application.submit();

  final ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    UserGroupInformation.createRemoteUser("otheruser").doAs(
        new PrivilegedExceptionAction<MoveApplicationAcrossQueuesResponse>() {
          @Override
          public MoveApplicationAcrossQueuesResponse run() throws Exception {
            return clientRMService.moveApplicationAcrossQueues(
                MoveApplicationAcrossQueuesRequest.newInstance(
                    application.getApplicationId(), "newqueue"));
          }

        });
    fail("Should have hit exception");
  } catch (Exception ex) {
    assertEquals(AccessControlException.class, ex.getCause().getCause().getClass());
  }
}
项目:big-c    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByScheduler() throws Exception {
  failMove = true;

  // Submit application
  Application application = new Application("user1", resourceManager);
  application.submit();

  // Wait for app to be accepted
  RMApp app = resourceManager.rmContext.getRMApps()
          .get(application.getApplicationId());
  while (app.getState() != RMAppState.ACCEPTED) {
    Thread.sleep(100);
  }

  ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    // FIFO scheduler does not support moves
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(
            application.getApplicationId(), "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals("Move not supported", ex.getCause().getMessage());
  }
}
项目:big-c    文件:TestMoveApplication.java   
@Test (timeout = 10000)
    public
    void testMoveSuccessful() throws Exception {
  MockRM rm1 = new MockRM(conf);
  rm1.start();
  RMApp app = rm1.submitApp(1024);
  ClientRMService clientRMService = rm1.getClientRMService();
  // FIFO scheduler does not support moves
  clientRMService
    .moveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
      .newInstance(app.getApplicationId(), "newqueue"));

  RMApp rmApp = rm1.getRMContext().getRMApps().get(app.getApplicationId());
  assertEquals("newqueue", rmApp.getQueue());
  rm1.stop();
}
项目:big-c    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByPermissions() throws Exception {
  failMove = true;

  // Submit application
  final Application application = new Application("user1", resourceManager);
  application.submit();

  final ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    UserGroupInformation.createRemoteUser("otheruser").doAs(
        new PrivilegedExceptionAction<MoveApplicationAcrossQueuesResponse>() {
          @Override
          public MoveApplicationAcrossQueuesResponse run() throws Exception {
            return clientRMService.moveApplicationAcrossQueues(
                MoveApplicationAcrossQueuesRequest.newInstance(
                    application.getApplicationId(), "newqueue"));
          }

        });
    fail("Should have hit exception");
  } catch (Exception ex) {
    assertEquals(AccessControlException.class, ex.getCause().getCause().getClass());
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByScheduler() throws Exception {
  failMove = true;

  // Submit application
  Application application = new Application("user1", resourceManager);
  application.submit();

  // Wait for app to be accepted
  RMApp app = resourceManager.rmContext.getRMApps()
          .get(application.getApplicationId());
  while (app.getState() != RMAppState.ACCEPTED) {
    Thread.sleep(100);
  }

  ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    // FIFO scheduler does not support moves
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(
            application.getApplicationId(), "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals("Move not supported", ex.getCause().getMessage());
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestMoveApplication.java   
@Test (timeout = 10000)
    public
    void testMoveSuccessful() throws Exception {
  MockRM rm1 = new MockRM(conf);
  rm1.start();
  RMApp app = rm1.submitApp(1024);
  ClientRMService clientRMService = rm1.getClientRMService();
  // FIFO scheduler does not support moves
  clientRMService
    .moveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
      .newInstance(app.getApplicationId(), "newqueue"));

  RMApp rmApp = rm1.getRMContext().getRMApps().get(app.getApplicationId());
  assertEquals("newqueue", rmApp.getQueue());
  rm1.stop();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByPermissions() throws Exception {
  failMove = true;

  // Submit application
  final Application application = new Application("user1", resourceManager);
  application.submit();

  final ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    UserGroupInformation.createRemoteUser("otheruser").doAs(
        new PrivilegedExceptionAction<MoveApplicationAcrossQueuesResponse>() {
          @Override
          public MoveApplicationAcrossQueuesResponse run() throws Exception {
            return clientRMService.moveApplicationAcrossQueues(
                MoveApplicationAcrossQueuesRequest.newInstance(
                    application.getApplicationId(), "newqueue"));
          }

        });
    fail("Should have hit exception");
  } catch (Exception ex) {
    assertEquals(AccessControlException.class, ex.getCause().getCause().getClass());
  }
}
项目:hops    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByScheduler() throws Exception {
  failMove = true;

  // Submit application
  Application application = new Application("user1", resourceManager);
  application.submit();

  // Wait for app to be accepted
  RMApp app = resourceManager.rmContext.getRMApps()
          .get(application.getApplicationId());
  while (app.getState() != RMAppState.ACCEPTED) {
    Thread.sleep(100);
  }

  ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    // FIFO scheduler does not support moves
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(
            application.getApplicationId(), "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals("Move not supported", ex.getCause().getMessage());
  }
}
项目:hops    文件:TestMoveApplication.java   
@Test (timeout = 10000)
    public
    void testMoveSuccessful() throws Exception {
  MockRM rm1 = new MockRM(conf);
  rm1.start();
  RMApp app = rm1.submitApp(1024);
  ClientRMService clientRMService = rm1.getClientRMService();
  // FIFO scheduler does not support moves
  clientRMService
    .moveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest
      .newInstance(app.getApplicationId(), "newqueue"));

  RMApp rmApp = rm1.getRMContext().getRMApps().get(app.getApplicationId());
  assertEquals("newqueue", rmApp.getQueue());
  rm1.stop();
}
项目:hops    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByPermissions() throws Exception {
  failMove = true;

  // Submit application
  final Application application = new Application("user1", resourceManager);
  application.submit();

  final ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    UserGroupInformation.createRemoteUser("otheruser").doAs(
        new PrivilegedExceptionAction<MoveApplicationAcrossQueuesResponse>() {
          @Override
          public MoveApplicationAcrossQueuesResponse run() throws Exception {
            return clientRMService.moveApplicationAcrossQueues(
                MoveApplicationAcrossQueuesRequest.newInstance(
                    application.getApplicationId(), "newqueue"));
          }

        });
    fail("Should have hit exception");
  } catch (Exception ex) {
    assertEquals(AccessControlException.class, ex.getCause().getCause().getClass());
  }
}
项目:hadoop-on-lustre2    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByScheduler() throws Exception {
  failMove = true;

  // Submit application
  Application application = new Application("user1", resourceManager);
  application.submit();

  ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    // FIFO scheduler does not support moves
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(
            application.getApplicationId(), "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals("Move not supported", ex.getCause().getMessage());
  }
}
项目:hadoop-on-lustre2    文件:TestMoveApplication.java   
@Test (timeout = 5000)
public void testMoveSuccessful() throws Exception {
  // Submit application
  Application application = new Application("user1", resourceManager);
  ApplicationId appId = application.getApplicationId();
  application.submit();

  // Wait for app to be accepted
  RMApp app = resourceManager.rmContext.getRMApps().get(appId);
  while (app.getState() != RMAppState.ACCEPTED) {
    Thread.sleep(100);
  }

  ClientRMService clientRMService = resourceManager.getClientRMService();
  // FIFO scheduler does not support moves
  clientRMService.moveApplicationAcrossQueues(
      MoveApplicationAcrossQueuesRequest.newInstance(appId, "newqueue"));

  RMApp rmApp = resourceManager.getRMContext().getRMApps().get(appId);
  assertEquals("newqueue", rmApp.getQueue());
}
项目:hadoop-on-lustre2    文件:TestMoveApplication.java   
@Test
public void testMoveRejectedByPermissions() throws Exception {
  failMove = true;

  // Submit application
  final Application application = new Application("user1", resourceManager);
  application.submit();

  final ClientRMService clientRMService = resourceManager.getClientRMService();
  try {
    UserGroupInformation.createRemoteUser("otheruser").doAs(
        new PrivilegedExceptionAction<MoveApplicationAcrossQueuesResponse>() {
          @Override
          public MoveApplicationAcrossQueuesResponse run() throws Exception {
            return clientRMService.moveApplicationAcrossQueues(
                MoveApplicationAcrossQueuesRequest.newInstance(
                    application.getApplicationId(), "newqueue"));
          }

        });
    fail("Should have hit exception");
  } catch (Exception ex) {
    assertEquals(AccessControlException.class, ex.getCause().getCause().getClass());
  }
}
项目:hadoop    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException,
    IOException {
  MoveApplicationAcrossQueuesRequestProto requestProto =
      ((MoveApplicationAcrossQueuesRequestPBImpl) request).getProto();
  try {
    return new MoveApplicationAcrossQueuesResponsePBImpl(
        proxy.moveApplicationAcrossQueues(null, requestProto));

  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop    文件:TestMoveApplication.java   
@Test (timeout = 10000)
public void testMoveTooLate() throws Exception {
  // Submit application
  Application application = new Application("user1", resourceManager);
  ApplicationId appId = application.getApplicationId();
  application.submit();

  ClientRMService clientRMService = resourceManager.getClientRMService();
  // Kill the application
  clientRMService.forceKillApplication(
      KillApplicationRequest.newInstance(appId));
  RMApp rmApp = resourceManager.getRMContext().getRMApps().get(appId);
  // wait until it's dead
  while (rmApp.getState() != RMAppState.KILLED) {
    Thread.sleep(100);
  }

  try {
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(appId, "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals(YarnException.class,
        ex.getClass());
    assertEquals("App in KILLED state cannot be moved.", ex.getMessage());
  }
}
项目:hadoop    文件:TestClientRMService.java   
@Test (expected = ApplicationNotFoundException.class)
public void testMoveAbsentApplication() throws YarnException {
  RMContext rmContext = mock(RMContext.class);
  when(rmContext.getRMApps()).thenReturn(
      new ConcurrentHashMap<ApplicationId, RMApp>());
  ClientRMService rmService = new ClientRMService(rmContext, null, null,
      null, null, null);
  ApplicationId applicationId =
      BuilderUtils.newApplicationId(System.currentTimeMillis(), 0);
  MoveApplicationAcrossQueuesRequest request =
      MoveApplicationAcrossQueuesRequest.newInstance(applicationId, "newqueue");
  rmService.moveApplicationAcrossQueues(request);
}
项目:hadoop    文件:YarnClientImpl.java   
@Override
public void moveApplicationAcrossQueues(ApplicationId appId,
    String queue) throws YarnException, IOException {
  MoveApplicationAcrossQueuesRequest request =
      MoveApplicationAcrossQueuesRequest.newInstance(appId, queue);
  rmClient.moveApplicationAcrossQueues(request);
}
项目:hadoop    文件:ProtocolHATestBase.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException {
  resetStartFailoverFlag(true);

  // make sure failover has been triggered
  Assert.assertTrue(waittingForFailOver());

  return Records.newRecord(MoveApplicationAcrossQueuesResponse.class);
}
项目:scheduling-connector-for-hadoop    文件:HPCApplicationClientProtocolImpl.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException,
    IOException {
  return RecordFactoryProvider.getRecordFactory(null).newRecordInstance(
      MoveApplicationAcrossQueuesResponse.class);
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException,
    IOException {
  MoveApplicationAcrossQueuesRequestProto requestProto =
      ((MoveApplicationAcrossQueuesRequestPBImpl) request).getProto();
  try {
    return new MoveApplicationAcrossQueuesResponsePBImpl(
        proxy.moveApplicationAcrossQueues(null, requestProto));

  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestMoveApplication.java   
@Test (timeout = 10000)
public void testMoveTooLate() throws Exception {
  // Submit application
  Application application = new Application("user1", resourceManager);
  ApplicationId appId = application.getApplicationId();
  application.submit();

  ClientRMService clientRMService = resourceManager.getClientRMService();
  // Kill the application
  clientRMService.forceKillApplication(
      KillApplicationRequest.newInstance(appId));
  RMApp rmApp = resourceManager.getRMContext().getRMApps().get(appId);
  // wait until it's dead
  while (rmApp.getState() != RMAppState.KILLED) {
    Thread.sleep(100);
  }

  try {
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(appId, "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals(YarnException.class,
        ex.getClass());
    assertEquals("App in KILLED state cannot be moved.", ex.getMessage());
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestClientRMService.java   
@Test (expected = ApplicationNotFoundException.class)
public void testMoveAbsentApplication() throws YarnException {
  RMContext rmContext = mock(RMContext.class);
  when(rmContext.getRMApps()).thenReturn(
      new ConcurrentHashMap<ApplicationId, RMApp>());
  ClientRMService rmService = new ClientRMService(rmContext, null, null,
      null, null, null);
  ApplicationId applicationId =
      BuilderUtils.newApplicationId(System.currentTimeMillis(), 0);
  MoveApplicationAcrossQueuesRequest request =
      MoveApplicationAcrossQueuesRequest.newInstance(applicationId, "newqueue");
  rmService.moveApplicationAcrossQueues(request);
}
项目:aliyun-oss-hadoop-fs    文件:YarnClientImpl.java   
@Override
public void moveApplicationAcrossQueues(ApplicationId appId,
    String queue) throws YarnException, IOException {
  MoveApplicationAcrossQueuesRequest request =
      MoveApplicationAcrossQueuesRequest.newInstance(appId, queue);
  rmClient.moveApplicationAcrossQueues(request);
}
项目:aliyun-oss-hadoop-fs    文件:ProtocolHATestBase.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException {
  resetStartFailoverFlag(true);

  // make sure failover has been triggered
  Assert.assertTrue(waittingForFailOver());

  return Records.newRecord(MoveApplicationAcrossQueuesResponse.class);
}
项目:big-c    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException,
    IOException {
  MoveApplicationAcrossQueuesRequestProto requestProto =
      ((MoveApplicationAcrossQueuesRequestPBImpl) request).getProto();
  try {
    return new MoveApplicationAcrossQueuesResponsePBImpl(
        proxy.moveApplicationAcrossQueues(null, requestProto));

  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:big-c    文件:TestMoveApplication.java   
@Test (timeout = 10000)
public void testMoveTooLate() throws Exception {
  // Submit application
  Application application = new Application("user1", resourceManager);
  ApplicationId appId = application.getApplicationId();
  application.submit();

  ClientRMService clientRMService = resourceManager.getClientRMService();
  // Kill the application
  clientRMService.forceKillApplication(
      KillApplicationRequest.newInstance(appId));
  RMApp rmApp = resourceManager.getRMContext().getRMApps().get(appId);
  // wait until it's dead
  while (rmApp.getState() != RMAppState.KILLED) {
    Thread.sleep(100);
  }

  try {
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(appId, "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals(YarnException.class,
        ex.getClass());
    assertEquals("App in KILLED state cannot be moved.", ex.getMessage());
  }
}
项目:big-c    文件:TestClientRMService.java   
@Test (expected = ApplicationNotFoundException.class)
public void testMoveAbsentApplication() throws YarnException {
  RMContext rmContext = mock(RMContext.class);
  when(rmContext.getRMApps()).thenReturn(
      new ConcurrentHashMap<ApplicationId, RMApp>());
  ClientRMService rmService = new ClientRMService(rmContext, null, null,
      null, null, null);
  ApplicationId applicationId =
      BuilderUtils.newApplicationId(System.currentTimeMillis(), 0);
  MoveApplicationAcrossQueuesRequest request =
      MoveApplicationAcrossQueuesRequest.newInstance(applicationId, "newqueue");
  rmService.moveApplicationAcrossQueues(request);
}
项目:big-c    文件:YarnClientImpl.java   
@Override
public void moveApplicationAcrossQueues(ApplicationId appId,
    String queue) throws YarnException, IOException {
  MoveApplicationAcrossQueuesRequest request =
      MoveApplicationAcrossQueuesRequest.newInstance(appId, queue);
  rmClient.moveApplicationAcrossQueues(request);
}
项目:big-c    文件:ProtocolHATestBase.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException {
  resetStartFailoverFlag(true);

  // make sure failover has been triggered
  Assert.assertTrue(waittingForFailOver());

  return Records.newRecord(MoveApplicationAcrossQueuesResponse.class);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException,
    IOException {
  MoveApplicationAcrossQueuesRequestProto requestProto =
      ((MoveApplicationAcrossQueuesRequestPBImpl) request).getProto();
  try {
    return new MoveApplicationAcrossQueuesResponsePBImpl(
        proxy.moveApplicationAcrossQueues(null, requestProto));

  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestMoveApplication.java   
@Test (timeout = 10000)
public void testMoveTooLate() throws Exception {
  // Submit application
  Application application = new Application("user1", resourceManager);
  ApplicationId appId = application.getApplicationId();
  application.submit();

  ClientRMService clientRMService = resourceManager.getClientRMService();
  // Kill the application
  clientRMService.forceKillApplication(
      KillApplicationRequest.newInstance(appId));
  RMApp rmApp = resourceManager.getRMContext().getRMApps().get(appId);
  // wait until it's dead
  while (rmApp.getState() != RMAppState.KILLED) {
    Thread.sleep(100);
  }

  try {
    clientRMService.moveApplicationAcrossQueues(
        MoveApplicationAcrossQueuesRequest.newInstance(appId, "newqueue"));
    fail("Should have hit exception");
  } catch (YarnException ex) {
    assertEquals(YarnException.class,
        ex.getClass());
    assertEquals("App in KILLED state cannot be moved.", ex.getMessage());
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestClientRMService.java   
@Test (expected = ApplicationNotFoundException.class)
public void testMoveAbsentApplication() throws YarnException {
  RMContext rmContext = mock(RMContext.class);
  when(rmContext.getRMApps()).thenReturn(
      new ConcurrentHashMap<ApplicationId, RMApp>());
  ClientRMService rmService = new ClientRMService(rmContext, null, null,
      null, null, null);
  ApplicationId applicationId =
      BuilderUtils.newApplicationId(System.currentTimeMillis(), 0);
  MoveApplicationAcrossQueuesRequest request =
      MoveApplicationAcrossQueuesRequest.newInstance(applicationId, "newqueue");
  rmService.moveApplicationAcrossQueues(request);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:YarnClientImpl.java   
@Override
public void moveApplicationAcrossQueues(ApplicationId appId,
    String queue) throws YarnException, IOException {
  MoveApplicationAcrossQueuesRequest request =
      MoveApplicationAcrossQueuesRequest.newInstance(appId, queue);
  rmClient.moveApplicationAcrossQueues(request);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ProtocolHATestBase.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException {
  resetStartFailoverFlag(true);

  // make sure failover has been triggered
  Assert.assertTrue(waittingForFailOver());

  return Records.newRecord(MoveApplicationAcrossQueuesResponse.class);
}
项目:hops    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException,
    IOException {
  MoveApplicationAcrossQueuesRequestProto requestProto =
      ((MoveApplicationAcrossQueuesRequestPBImpl) request).getProto();
  try {
    return new MoveApplicationAcrossQueuesResponsePBImpl(
        proxy.moveApplicationAcrossQueues(null, requestProto));

  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}