/** * @return the user name set in hadoop.job.ugi param or the current user from System * @throws IOException */ public String getUser() throws IOException { try { UserGroupInformation ugi = ShimLoader.getHadoopShims() .getUGIForConf(this); return ugi.getUserName(); } catch (LoginException le) { throw new IOException(le); } }
/** * @return the user name set in hadoop.job.ugi param or the current user from System * @throws IOException */ public String getUser() throws IOException { try { UserGroupInformation ugi = ShimLoader.getHadoopShims() .getUGIForConf(this); return ugi.getUserName(); } catch (LoginException le) { throw new IOException(le); } }
@Override public void setConf(Configuration conf) { this.conf = conf; UserGroupInformation ugi = null; try { ugi = ShimLoader.getHadoopShims().getUGIForConf(conf); } catch (Exception e) { throw new RuntimeException(e); } if (ugi == null) { throw new RuntimeException( "Can not initialize HadoopDefaultAuthenticator."); } this.userName = ugi.getUserName(); if (ugi.getGroupNames() != null) { this.groupNames = Arrays.asList(ugi.getGroupNames()); } }
private final void logAuditEvent(String cmd) { if (!ShimLoader.getHadoopShims().isSecureShimImpl() || cmd == null) { return; } UserGroupInformation ugi; try { ugi = ShimLoader.getHadoopShims().getUGIForConf(getConf()); } catch (Exception ex) { throw new RuntimeException(ex); } InetAddress addr = TLoggingProcessor.getRemoteAddress(); final Formatter fmt = auditFormatter.get(); ((StringBuilder)fmt.out()).setLength(0); auditLog.info(fmt.format(AUDIT_FORMAT, ugi.getUserName(), addr == null ? "unknown-ip-addr" : addr.toString(), cmd).toString()); }
private final void logAuditEvent(String cmd) { if (cmd == null) { return; } UserGroupInformation ugi; try { ugi = ShimLoader.getHadoopShims().getUGIForConf(getConf()); } catch (Exception ex) { throw new RuntimeException(ex); } final Formatter fmt = auditFormatter.get(); ((StringBuilder) fmt.out()).setLength(0); String address; if (useSasl) { address = saslServer.getRemoteAddress().toString(); } else { address = getIpAddress(); } if (address == null) { address = "unknown-ip-addr"; } auditLog.info(fmt.format(AUDIT_FORMAT, ugi.getUserName(), address, cmd).toString()); }
public HookContext(QueryPlan queryPlan, HiveConf conf) throws Exception{ this.queryPlan = queryPlan; this.conf = conf; completeTaskList = new ArrayList<TaskRunner>(); inputs = queryPlan.getInputs(); outputs = queryPlan.getOutputs(); ugi = ShimLoader.getHadoopShims().getUGIForConf(conf); linfo= null; if(SessionState.get() != null){ linfo = SessionState.get().getLineageState().getLineageInfo(); } }
UserGroupInformation ugi = shim.getUGIForConf(conf); client.set_ugi(ugi.getUserName(), Arrays.asList(ugi.getGroupNames())); } catch (LoginException e) {
ugi = ShimLoader.getHadoopShims().getUGIForConf(conf); } catch (LoginException le) { throw new IOException(le);
ugi = ShimLoader.getHadoopShims().getUGIForConf(conf); } catch (LoginException le) { throw new IOException(le);
} else if (peh instanceof PreExecute) { ((PreExecute) peh).run(SessionState.get(), plan.getInputs(), plan.getOutputs(), ShimLoader.getHadoopShims().getUGIForConf(conf)); ((PostExecute) peh).run(SessionState.get(), plan.getInputs(), plan.getOutputs(), (SessionState.get() != null ? SessionState.get().getLineageState().getLineageInfo() : null), ShimLoader.getHadoopShims().getUGIForConf(conf));