@Override public void run() { dtr.addApplicationAsync(mock(ApplicationId.class), creds1, false, "user"); } };
@Override public void run() { dtr.addApplicationAsync(mock(ApplicationId.class), creds1, false, "user", new Configuration()); } };
dtr.addApplicationAsync(mock(ApplicationId.class), creds2, false, "user", new Configuration());
dtr.addApplicationAsync(mock(ApplicationId.class), creds2, false, "user");
@Test(timeout=60000) public void testAppRejectionWithCancelledDelegationToken() throws Exception { MyFS dfs = (MyFS)FileSystem.get(conf); LOG.info("dfs="+(Object)dfs.hashCode() + ";conf="+conf.hashCode()); MyToken token = dfs.getDelegationToken("user1"); token.cancelToken(); Credentials ts = new Credentials(); ts.addToken(token.getKind(), token); // register the tokens for renewal ApplicationId appId = BuilderUtils.newApplicationId(0, 0); delegationTokenRenewer.addApplicationAsync(appId, ts, true, "user", new Configuration()); int waitCnt = 20; while (waitCnt-- >0) { if (!eventQueue.isEmpty()) { Event evt = eventQueue.take(); if (evt.getType() == RMAppEventType.APP_REJECTED) { Assert.assertTrue( ((RMAppEvent) evt).getApplicationId().equals(appId)); return; } } else { Thread.sleep(500); } } fail("App submission with a cancelled token should have failed"); }
delegationTokenRenewer.addApplicationAsync(applicationId_1, ts, false, "user", new Configuration()); waitForEventsToGetProcessed(delegationTokenRenewer);
localDtr.addApplicationAsync(applicationId_0, ts, true, "user", new Configuration()); localDtr.applicationFinished(applicationId_0);
localDtr.addApplicationAsync(applicationId_0, ts, true, "user"); localDtr.applicationFinished(applicationId_0); waitForEventsToGetProcessed(delegationTokenRenewer);
delegationTokenRenewer.addApplicationAsync(applicationId_1, ts, false, "user"); waitForEventsToGetProcessed(delegationTokenRenewer); delegationTokenRenewer.applicationFinished(applicationId_1);
@Test(timeout=60000) public void testAppRejectionWithCancelledDelegationToken() throws Exception { MyFS dfs = (MyFS)FileSystem.get(conf); LOG.info("dfs="+(Object)dfs.hashCode() + ";conf="+conf.hashCode()); MyToken token = dfs.getDelegationToken("user1"); token.cancelToken(); Credentials ts = new Credentials(); ts.addToken(token.getKind(), token); // register the tokens for renewal ApplicationId appId = BuilderUtils.newApplicationId(0, 0); delegationTokenRenewer.addApplicationAsync(appId, ts, true, "user"); int waitCnt = 20; while (waitCnt-- >0) { if (!eventQueue.isEmpty()) { Event evt = eventQueue.take(); if (evt.getType() == RMAppEventType.APP_REJECTED) { Assert.assertTrue( ((RMAppEvent) evt).getApplicationId().equals(appId)); return; } } else { Thread.sleep(500); } } fail("App submission with a cancelled token should have failed"); }
localDtr.addApplicationAsync(applicationId_0, ts, true, "user"); waitForEventsToGetProcessed(localDtr); if (!eventQueue.isEmpty()){
localDtr.addApplicationAsync(applicationId_0, ts, true, "user", new Configuration()); waitForEventsToGetProcessed(localDtr);
delegationTokenRenewer.addApplicationAsync(applicationId_0, ts, true, "user"); waitForEventsToGetProcessed(delegationTokenRenewer); delegationTokenRenewer.addApplicationAsync(applicationId_1, ts, true, "user"); waitForEventsToGetProcessed(delegationTokenRenewer); delegationTokenRenewer.applicationFinished(applicationId_1);
delegationTokenRenewer.addApplicationAsync(applicationId_0, ts, true, "user", new Configuration()); waitForEventsToGetProcessed(delegationTokenRenewer); delegationTokenRenewer.addApplicationAsync(applicationId_1, ts, true, "user", new Configuration()); waitForEventsToGetProcessed(delegationTokenRenewer);
if (UserGroupInformation.isSecurityEnabled()) { this.rmContext.getDelegationTokenRenewer() .addApplicationAsync(applicationId, BuilderUtils.parseCredentials(submissionContext), submissionContext.getCancelTokensWhenComplete(),
this.rmContext.getDelegationTokenRenewer().addApplicationAsync(appId, parseCredentials(submissionContext), submissionContext.getCancelTokensWhenComplete(),
this.rmContext.getDelegationTokenRenewer().addApplicationAsync(appId, parseCredentials(submissionContext), submissionContext.getCancelTokensWhenComplete(),