Example usage for org.apache.hadoop.registry.client.impl.zk RegistryInternalConstants HADOOP_USER_NAME

List of usage examples for org.apache.hadoop.registry.client.impl.zk RegistryInternalConstants HADOOP_USER_NAME

Introduction

In this page you can find the example usage for org.apache.hadoop.registry.client.impl.zk RegistryInternalConstants HADOOP_USER_NAME.

Prototype

String HADOOP_USER_NAME

To view the source code for org.apache.hadoop.registry.client.impl.zk RegistryInternalConstants HADOOP_USER_NAME.

Click Source Link

Document

This the Hadoop environment variable which propagates the identity of a user in an insecure cluster

Usage

From source file:org.apache.slider.client.ClientRegistryBinder.java

License:Apache License

/**
 * Get the current username, before any encoding has been applied.
 * @return the current user from the kerberos identity, falling back
 * to the user and/or env variables.//from www . j  a  va 2  s .  c o  m
 */
public static String currentUsernameUnencoded() {
    String env_hadoop_username = System.getenv(RegistryInternalConstants.HADOOP_USER_NAME);
    return getCurrentUsernameUnencoded(env_hadoop_username);
}