Index: shims/common/src/main/java/org/apache/hadoop/hive/thrift/DBTokenStore.java =================================================================== --- shims/common/src/main/java/org/apache/hadoop/hive/thrift/DBTokenStore.java (revision 1647016) +++ shims/common/src/main/java/org/apache/hadoop/hive/thrift/DBTokenStore.java (working copy) @@ -73,7 +73,7 @@ boolean result = (Boolean)invokeOnRawStore("addToken", new Object[] {identifier, tokenStr}, String.class, String.class); if (LOG.isTraceEnabled()) { - LOG.trace("addToken: tokenIdentifier = " + tokenIdentifier + ", addded = " + result); + LOG.trace("addToken: tokenIdentifier = " + tokenIdentifier + ", added = " + result); } return result; } catch (IOException e) { @@ -106,7 +106,7 @@ boolean result = (Boolean)invokeOnRawStore("removeToken", new Object[] { TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier)}, String.class); if (LOG.isTraceEnabled()) { - LOG.trace("removeToken: tokenIdentifier = " + tokenIdentifier + ", addded = " + result); + LOG.trace("removeToken: tokenIdentifier = " + tokenIdentifier + ", removed = " + result); } return result; } catch (IOException e) { Index: shims/common/src/main/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge.java =================================================================== --- shims/common/src/main/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge.java (revision 1647016) +++ shims/common/src/main/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge.java (working copy) @@ -73,7 +73,7 @@ * SASL callback handlers and authentication classes. */ public class HadoopThriftAuthBridge { - static final Log LOG = LogFactory.getLog(HadoopThriftAuthBridge.class); + private static final Log LOG = LogFactory.getLog(HadoopThriftAuthBridge.class); public Client createClient() { return new Client(); @@ -290,9 +290,9 @@ public enum ServerMode { HIVESERVER2, METASTORE }; - final UserGroupInformation realUgi; - DelegationTokenSecretManager secretManager; - private final static long DELEGATION_TOKEN_GC_INTERVAL = 3600000; // 1 hour + public static final String DELEGATION_TOKEN_GC_INTERVAL = + "hive.cluster.delegation.token.gc-interval"; + private final static long DELEGATION_TOKEN_GC_INTERVAL_DEFAULT = 3600000; // 1 hour //Delegation token related keys public static final String DELEGATION_KEY_UPDATE_INTERVAL_KEY = "hive.cluster.delegation.key.update-interval"; @@ -323,6 +323,9 @@ public static final String DELEGATION_TOKEN_STORE_ZK_ZNODE_DEFAULT = "/hivedelegation"; + protected final UserGroupInformation realUgi; + protected DelegationTokenSecretManager secretManager; + public Server() throws TTransportException { try { realUgi = UserGroupInformation.getCurrentUser(); @@ -434,13 +437,15 @@ long tokenRenewInterval = conf.getLong(DELEGATION_TOKEN_RENEW_INTERVAL_KEY, DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT); + long tokenGcInterval = conf.getLong(DELEGATION_TOKEN_GC_INTERVAL, + DELEGATION_TOKEN_GC_INTERVAL_DEFAULT); DelegationTokenStore dts = getTokenStore(conf); dts.init(rawStore, smode); secretManager = new TokenStoreDelegationTokenSecretManager(secretKeyInterval, tokenMaxLifetime, tokenRenewInterval, - DELEGATION_TOKEN_GC_INTERVAL, dts); + tokenGcInterval, dts); secretManager.startThreads(); } Index: shims/common/src/main/java/org/apache/hadoop/hive/thrift/MemoryTokenStore.java =================================================================== --- shims/common/src/main/java/org/apache/hadoop/hive/thrift/MemoryTokenStore.java (revision 1647016) +++ shims/common/src/main/java/org/apache/hadoop/hive/thrift/MemoryTokenStore.java (working copy) @@ -92,7 +92,7 @@ DelegationTokenInformation token) { DelegationTokenInformation tokenInfo = tokens.putIfAbsent(tokenIdentifier, token); if (LOG.isTraceEnabled()) { - LOG.trace("addToken: tokenIdentifier = " + tokenIdentifier + ", addded = " + (tokenInfo == null)); + LOG.trace("addToken: tokenIdentifier = " + tokenIdentifier + ", added = " + (tokenInfo == null)); } return (tokenInfo == null); }