Example usage for org.apache.hadoop.yarn.conf YarnConfiguration DEFAULT_NM_NONSECURE_MODE_LOCAL_USER

List of usage examples for org.apache.hadoop.yarn.conf YarnConfiguration DEFAULT_NM_NONSECURE_MODE_LOCAL_USER

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.conf YarnConfiguration DEFAULT_NM_NONSECURE_MODE_LOCAL_USER.

Prototype

String DEFAULT_NM_NONSECURE_MODE_LOCAL_USER

To view the source code for org.apache.hadoop.yarn.conf YarnConfiguration DEFAULT_NM_NONSECURE_MODE_LOCAL_USER.

Click Source Link

Usage

From source file:com.soteradefense.dga.DGAYarnRunner.java

License:Apache License

public static void main(final String[] args) throws Exception {
    if (!UserGroupInformation.isSecurityEnabled()) {
        UserGroupInformation.createRemoteUser(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER)
                .doAs(new PrivilegedAction<Void>() {
                    @Override//  w ww  .j ava 2s.  c om
                    public Void run() {
                        try {
                            DGARunner runner = new DGARunner();
                            runner.run(args);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        return null;
                    }
                });
    } else {
        DGARunner runner = new DGARunner();
        runner.run(args);
    }
}