protected synchronized void finishApplication(ApplicationId applicationId) { if (applicationId == null) { LOG.error("RMAppManager received completed appId of null, skipping"); } else { // Inform the DelegationTokenRenewer if (UserGroupInformation.isSecurityEnabled()) { rmContext.getDelegationTokenRenewer().applicationFinished(applicationId); } completedApps.add(applicationId); completedAppsInStateStore++; writeAuditLog(applicationId); } }
protected synchronized void finishApplication(ApplicationId applicationId) { if (applicationId == null) { LOG.error("RMAppManager received completed appId of null, skipping"); } else { // Inform the DelegationTokenRenewer if (UserGroupInformation.isSecurityEnabled()) { rmContext.getDelegationTokenRenewer().applicationFinished(applicationId); } completedApps.add(applicationId); completedAppsInStateStore++; writeAuditLog(applicationId); } }
protected synchronized void finishApplication(ApplicationId applicationId) { if (applicationId == null) { LOG.error("RMAppManager received completed appId of null, skipping"); } else { // Inform the DelegationTokenRenewer if (UserGroupInformation.isSecurityEnabled()) { rmContext.getDelegationTokenRenewer().applicationFinished(applicationId); } completedApps.add(applicationId); completedAppsInStateStore++; writeAuditLog(applicationId); } }
/** * Test that the DelegationTokenRenewer class can gracefully handle * interactions that occur when it has been stopped. */ @Test public void testShutDown() { DelegationTokenRenewer dtr = createNewDelegationTokenRenewer(conf, counter); RMContext mockContext = mock(RMContext.class); when(mockContext.getSystemCredentialsForApps()).thenReturn( new ConcurrentHashMap<ApplicationId, ByteBuffer>()); ClientRMService mockClientRMService = mock(ClientRMService.class); when(mockContext.getClientRMService()).thenReturn(mockClientRMService); InetSocketAddress sockAddr = InetSocketAddress.createUnresolved("localhost", 1234); when(mockClientRMService.getBindAddress()).thenReturn(sockAddr); dtr.setRMContext(mockContext); when(mockContext.getDelegationTokenRenewer()).thenReturn(dtr); dtr.init(conf); dtr.start(); delegationTokenRenewer.stop(); delegationTokenRenewer.applicationFinished( BuilderUtils.newApplicationId(0, 1)); } }
new Configuration()); waitForEventsToGetProcessed(delegationTokenRenewer); delegationTokenRenewer.applicationFinished(applicationId_1); waitForEventsToGetProcessed(delegationTokenRenewer); int numberOfExpectedRenewals = Renewer.counter; // number of renewals so far
delegationTokenRenewer.addApplicationAsync(applicationId_1, ts, false, "user"); waitForEventsToGetProcessed(delegationTokenRenewer); delegationTokenRenewer.applicationFinished(applicationId_1); waitForEventsToGetProcessed(delegationTokenRenewer); int numberOfExpectedRenewals = Renewer.counter; // number of renewals so far
localDtr.applicationFinished(applicationId_0); waitForEventsToGetProcessed(localDtr);
localDtr.addApplicationAsync(applicationId_0, ts, true, "user", new Configuration()); localDtr.applicationFinished(applicationId_0); waitForEventsToGetProcessed(delegationTokenRenewer);
localDtr.applicationFinished(applicationId_0); waitForEventsToGetProcessed(delegationTokenRenewer);
localDtr.applicationFinished(applicationId_0); waitForEventsToGetProcessed(localDtr);
new Configuration()); waitForEventsToGetProcessed(delegationTokenRenewer); delegationTokenRenewer.applicationFinished(applicationId_1); waitForEventsToGetProcessed(delegationTokenRenewer);
delegationTokenRenewer.addApplicationAsync(applicationId_1, ts, true, "user"); waitForEventsToGetProcessed(delegationTokenRenewer); delegationTokenRenewer.applicationFinished(applicationId_1); waitForEventsToGetProcessed(delegationTokenRenewer);