Example usage for org.apache.hadoop.security.token.delegation DelegationKey DelegationKey

List of usage examples for org.apache.hadoop.security.token.delegation DelegationKey DelegationKey

Introduction

In this page you can find the example usage for org.apache.hadoop.security.token.delegation DelegationKey DelegationKey.

Prototype

public DelegationKey() 

Source Link

Document

Default constructore required for Writable

Usage

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;
}