Example usage for org.apache.hadoop.hdfs.web.resources RenewerParam RenewerParam

List of usage examples for org.apache.hadoop.hdfs.web.resources RenewerParam RenewerParam

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.web.resources RenewerParam RenewerParam.

Prototype

public RenewerParam(final String str) 

Source Link

Document

Constructor.

Usage

From source file:com.bigstep.datalake.DLFileSystem.java

License:Apache License

@Override
public Token<DelegationTokenIdentifier> getDelegationToken(final String renewer) throws IOException {
    final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
    Token<DelegationTokenIdentifier> token = new FsPathResponseRunner<Token<DelegationTokenIdentifier>>(op,
            null, new RenewerParam(renewer)) {
        @Override//w w  w .  j a  v  a  2s. c  o  m
        Token<DelegationTokenIdentifier> decodeResponse(Map<?, ?> json) throws IOException {
            return JsonUtil.toDelegationToken(json);
        }
    }.run();
    if (token != null) {
        token.setService(tokenServiceName);
    } else {
        if (disallowFallbackToInsecureCluster) {
            throw new AccessControlException(CANT_FALLBACK_TO_INSECURE_MSG);
        }
    }
    return token;
}