Java 类org.apache.hadoop.security.token.delegation.web.DelegationTokenManager 实例源码

项目:hadoop-oss    文件:TestZKDelegationTokenSecretManager.java   
@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());
}
项目:hadoop    文件:TestZKDelegationTokenSecretManager.java   
@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());
}
项目:aliyun-oss-hadoop-fs    文件:TestZKDelegationTokenSecretManager.java   
@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());
}
项目:big-c    文件:TestZKDelegationTokenSecretManager.java   
@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());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestZKDelegationTokenSecretManager.java   
@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());
}
项目:hops    文件:TestZKDelegationTokenSecretManager.java   
@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());
}
项目:hadoop-oss    文件:TestZKDelegationTokenSecretManager.java   
protected Configuration getSecretConf(String connectString) {
 Configuration conf = new Configuration();
 conf.setBoolean(DelegationTokenManager.ENABLE_ZK_KEY, true);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_CONNECTION_STRING, connectString);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZNODE_WORKING_PATH, "testPath");
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_AUTH_TYPE, "none");
 conf.setLong(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, 100);
 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);
 return conf;
}
项目:hadoop-oss    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:hadoop    文件:TestZKDelegationTokenSecretManager.java   
protected Configuration getSecretConf(String connectString) {
 Configuration conf = new Configuration();
 conf.setBoolean(DelegationTokenManager.ENABLE_ZK_KEY, true);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_CONNECTION_STRING, connectString);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZNODE_WORKING_PATH, "testPath");
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_AUTH_TYPE, "none");
 conf.setLong(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, 100);
 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);
 return conf;
}
项目:hadoop    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestZKDelegationTokenSecretManager.java   
protected Configuration getSecretConf(String connectString) {
 Configuration conf = new Configuration();
 conf.setBoolean(DelegationTokenManager.ENABLE_ZK_KEY, true);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_CONNECTION_STRING, connectString);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZNODE_WORKING_PATH, "testPath");
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_AUTH_TYPE, "none");
 conf.setLong(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, 100);
 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);
 return conf;
}
项目:aliyun-oss-hadoop-fs    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:big-c    文件:TestZKDelegationTokenSecretManager.java   
protected Configuration getSecretConf(String connectString) {
 Configuration conf = new Configuration();
 conf.setBoolean(DelegationTokenManager.ENABLE_ZK_KEY, true);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_CONNECTION_STRING, connectString);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZNODE_WORKING_PATH, "testPath");
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_AUTH_TYPE, "none");
 conf.setLong(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, 100);
 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);
 return conf;
}
项目:big-c    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestZKDelegationTokenSecretManager.java   
protected Configuration getSecretConf(String connectString) {
 Configuration conf = new Configuration();
 conf.setBoolean(DelegationTokenManager.ENABLE_ZK_KEY, true);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_CONNECTION_STRING, connectString);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZNODE_WORKING_PATH, "testPath");
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_AUTH_TYPE, "none");
 conf.setLong(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, 100);
 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);
 return conf;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:hops    文件:TestZKDelegationTokenSecretManager.java   
protected Configuration getSecretConf(String connectString) {
 Configuration conf = new Configuration();
 conf.setBoolean(DelegationTokenManager.ENABLE_ZK_KEY, true);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_CONNECTION_STRING, connectString);
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZNODE_WORKING_PATH, "testPath");
 conf.set(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_AUTH_TYPE, "none");
 conf.setLong(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_SHUTDOWN_TIMEOUT, 100);
 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);
 return conf;
}
项目:hops    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:hadoop-oss    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:hadoop    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:aliyun-oss-hadoop-fs    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:big-c    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:hops    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}