@Override public void destroy() { tokenManager.destroy(); authHandler.destroy(); }
@Override public void destroy() { tokenManager.destroy(); authHandler.destroy(); }
@Override public void destroy() { tokenManager.destroy(); authHandler.destroy(); }
@Override public void destroy() { tokenManager.destroy(); authHandler.destroy(); }
@Override public void destroy() { tokenManager.destroy(); authHandler.destroy(); }
@SuppressWarnings("rawtypes") protected void verifyDestroy(DelegationTokenManager tm, Configuration conf) throws Exception { AbstractDelegationTokenSecretManager sm = tm.getDelegationTokenSecretManager(); ZKDelegationTokenSecretManager zksm = (ZKDelegationTokenSecretManager) sm; ExecutorService es = zksm.getListenerThreadPool(); tm.destroy(); Assert.assertTrue(es.isShutdown()); // wait for the pool to terminate long timeout = conf.getLong( ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT_DEFAULT); Thread.sleep(timeout * 3); Assert.assertTrue(es.isTerminated()); }
@SuppressWarnings("rawtypes") protected void verifyDestroy(DelegationTokenManager tm, Configuration conf) throws Exception { AbstractDelegationTokenSecretManager sm = tm.getDelegationTokenSecretManager(); ZKDelegationTokenSecretManager zksm = (ZKDelegationTokenSecretManager) sm; ExecutorService es = zksm.getListenerThreadPool(); tm.destroy(); Assert.assertTrue(es.isShutdown()); // wait for the pool to terminate long timeout = conf.getLong( ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT_DEFAULT); Thread.sleep(timeout * 3); Assert.assertTrue(es.isTerminated()); }
@SuppressWarnings("unchecked") @Test public void testDTManager() throws Exception { Configuration conf = new Configuration(false); conf.setLong(DelegationTokenManager.UPDATE_INTERVAL, DAY_IN_SECS); conf.setLong(DelegationTokenManager.MAX_LIFETIME, DAY_IN_SECS); conf.setLong(DelegationTokenManager.RENEW_INTERVAL, DAY_IN_SECS); conf.setLong(DelegationTokenManager.REMOVAL_SCAN_INTERVAL, DAY_IN_SECS); conf.getBoolean(DelegationTokenManager.ENABLE_ZK_KEY, enableZKKey); DelegationTokenManager tm = new DelegationTokenManager(conf, new Text("foo")); tm.init(); Token<DelegationTokenIdentifier> token = (Token<DelegationTokenIdentifier>) tm.createToken( UserGroupInformation.getCurrentUser(), "foo"); Assert.assertNotNull(token); tm.verifyToken(token); Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis()); tm.cancelToken(token, "foo"); try { tm.verifyToken(token); Assert.fail(); } catch (IOException ex) { //NOP } catch (Exception ex) { Assert.fail(); } tm.destroy(); }
@SuppressWarnings("unchecked") @Test public void testDTManager() throws Exception { Configuration conf = new Configuration(false); conf.setLong(DelegationTokenManager.UPDATE_INTERVAL, DAY_IN_SECS); conf.setLong(DelegationTokenManager.MAX_LIFETIME, DAY_IN_SECS); conf.setLong(DelegationTokenManager.RENEW_INTERVAL, DAY_IN_SECS); conf.setLong(DelegationTokenManager.REMOVAL_SCAN_INTERVAL, DAY_IN_SECS); conf.getBoolean(DelegationTokenManager.ENABLE_ZK_KEY, enableZKKey); DelegationTokenManager tm = new DelegationTokenManager(conf, new Text("foo")); tm.init(); Token<DelegationTokenIdentifier> token = (Token<DelegationTokenIdentifier>) tm.createToken( UserGroupInformation.getCurrentUser(), "foo"); Assert.assertNotNull(token); tm.verifyToken(token); Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis()); tm.cancelToken(token, "foo"); try { tm.verifyToken(token); Assert.fail(); } catch (IOException ex) { //NOP } catch (Exception ex) { Assert.fail(); } tm.destroy(); }
verifyACL(curatorFramework, "/" + workingPath, digestACL); tm1.destroy(); ZKDelegationTokenSecretManager.setCurator(null); curatorFramework.close();
verifyACL(curatorFramework, "/" + workingPath, digestACL); tm1.destroy(); ZKDelegationTokenSecretManager.setCurator(null); curatorFramework.close();