本文整理汇总了Java中org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest类的典型用法代码示例。如果您正苦于以下问题:Java MoveApplicationAcrossQueuesRequest类的具体用法?Java MoveApplicationAcrossQueuesRequest怎么用?Java MoveApplicationAcrossQueuesRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MoveApplicationAcrossQueuesRequest类属于org.apache.hadoop.yarn.api.protocolrecords包,在下文中一共展示了MoveApplicationAcrossQueuesRequest类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMoveRejectedByScheduler
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@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());
}
}
示例2: testMoveSuccessful
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@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();
}
示例3: testMoveRejectedByPermissions
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@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());
}
}
示例4: testMoveRejectedByScheduler
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@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());
}
}
示例5: testMoveSuccessful
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@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());
}
示例6: moveApplicationAcrossQueues
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
MoveApplicationAcrossQueuesRequest request) throws YarnException {
resetStartFailoverFlag(true);
// make sure failover has been triggered
Assert.assertTrue(waittingForFailOver());
return Records.newRecord(MoveApplicationAcrossQueuesResponse.class);
}
示例7: moveApplicationAcrossQueues
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@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;
}
}
示例8: testMoveTooLate
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@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());
}
}
示例9: testMoveAbsentApplication
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@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);
}
示例10: moveApplicationAcrossQueues
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@Override
public void moveApplicationAcrossQueues(ApplicationId appId,
String queue) throws YarnException, IOException {
MoveApplicationAcrossQueuesRequest request =
MoveApplicationAcrossQueuesRequest.newInstance(appId, queue);
rmClient.moveApplicationAcrossQueues(request);
}
示例11: moveApplicationAcrossQueues
import org.apache.hadoop.yarn.api.protocolrecords.MoveApplicationAcrossQueuesRequest; //导入依赖的package包/类
@Override
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
MoveApplicationAcrossQueuesRequest request) throws YarnException,
IOException {
return RecordFactoryProvider.getRecordFactory(null).newRecordInstance(
MoveApplicationAcrossQueuesResponse.class);
}
开发者ID:intel-hpdd,项目名称:scheduling-connector-for-hadoop,代码行数:8,代码来源:HPCApplicationClientProtocolImpl.java