}
try {
endpoint = resolveEndpoint(cfg);
} catch (IOException ex) {
throw new EsYarnException("Cannot resolve endpoint", ex);
}
UserGroupInformation ugi = null;
try {
ugi = UserGroupInformation.getCurrentUser();
} catch (IOException ex) {
throw new EsYarnException("Cannot get current user", ex);
}
// create proxy
proxy = ugi.doAs(new PrivilegedAction<P>() {
@SuppressWarnings("unchecked")