if (ye.getCause() instanceof AccessControlException) { String appId = app.getApplicationId().toString(); String msg = "Unauthorized attempt to change timeout of app " + appId + " by remote user " + userName; return Response.status(Status.FORBIDDEN).entity(msg).build(); } else if (ye.getCause() instanceof ParseException) { return Response.status(Status.BAD_REQUEST).entity(ye.getMessage()) .build();
if (ye.getCause() instanceof AccessControlException) { String taId = attemptId.toString(); String msg =
if (ye.getCause() instanceof AccessControlException) { String taId = attemptId.toString(); String msg =
if (ye.getCause() instanceof AccessControlException) { String appId = app.getApplicationId().toString(); String msg = "Unauthorized attempt to change priority of appid "
if (ye.getCause() instanceof AccessControlException) { String appId = app.getApplicationId().toString(); String msg =
if (ye.getCause() instanceof AccessControlException) { String appId = app.getApplicationId().toString(); String msg = "Unauthorized attempt to move appid " + appId
if (ye.getCause() instanceof AccessControlException) { String appId = app.getApplicationId().toString(); String msg =
if (ye.getCause() instanceof AccessControlException) { String appId = app.getApplicationId().toString(); String msg =
if (ye.getCause() instanceof AccessControlException) { String appId = app.getApplicationId().toString(); String msg = "Unauthorized attempt to kill appid " + appId
if (ye.getCause() instanceof AccessControlException) { String appId = app.getApplicationId().toString(); String msg =
private void submitAppToRMWithInValidAcl(String submitter, ApplicationSubmissionContext appSubmissionContext) throws YarnException, IOException, InterruptedException { ApplicationClientProtocol submitterClient = getRMClientForUser(submitter); SubmitApplicationRequest submitRequest = SubmitApplicationRequest .newInstance(appSubmissionContext); try { submitterClient.submitApplication(submitRequest); } catch (YarnException ex) { Assert.assertTrue(ex.getCause() instanceof RemoteException); } }
@Test public void testExceptionCalls() throws Exception { client.setThrowYarnException(true); try { client.putEntitiesAsync(generateEntity("1")); } catch (YarnException e) { Assert.fail("Async calls are not expected to throw exception"); } try { client.putEntities(generateEntity("2")); Assert.fail("Sync calls are expected to throw exception"); } catch (YarnException e) { Assert.assertEquals("Same exception needs to be thrown", "ActualException", e.getCause().getMessage()); } }
@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()); } }
Assert.fail("YARN exception is expected"); } catch (YarnException e) { Throwable cause = e.getCause(); Assert.assertTrue("IOException is expected", cause instanceof IOException); Assert.fail("YARN exception is expected"); } catch (YarnException e) { Throwable cause = e.getCause(); Assert.assertTrue("YARN exception is expected", cause instanceof YarnException);
newAppMonitor.submitApplication(asContext, "test1"); } catch(YarnException e) { assertTrue(e.getCause() instanceof AccessControlException);
newAppMonitor.submitApplication(asContext, "user2"); } catch (YarnException e) { assertTrue(e.getCause() instanceof AccessControlException);