List of usage examples for org.apache.hadoop.security.token.delegation DelegationKey DelegationKey
public DelegationKey()
From source file:com.cloudera.impala.security.PersistedDelegationTokenSecretManager.java
License:Apache License
protected Map<Integer, DelegationKey> reloadKeys() throws IOException { // read keys from token store String[] allKeys = tokenStore.getMasterKeys(); Map<Integer, DelegationKey> keys = new HashMap<Integer, DelegationKey>(allKeys.length); for (String keyStr : allKeys) { DelegationKey key = new DelegationKey(); try {//w w w . j a v a 2 s . c om decodeWritable(key, keyStr); keys.put(key.getKeyId(), key); } catch (IOException ex) { LOGGER.error("Failed to load master key.", ex); } } synchronized (this) { super.allKeys.clear(); super.allKeys.putAll(keys); } return keys; }