UGI – UserGroupInformation

Using user group information for hadoop job submitting.

        UserGroupInformation ugi = UserGroupInformation.createRemoteUser("hdfs");

        try {

            ugi.doAs(new PrivilegedExceptionAction() {
                public Void run() throws Exception {
                    //TO-DO
                }
            });

        } catch (Exception e) {
            e.printStackTrace();
        }

LEAVE A COMMENT