/** * Logger an error to console if available. */ private static void log(String error) { LogHelper console = SessionState.getConsole(); if (console != null) { console.printError(error); } }
@Override public void preHook(Set<String> cur, List<String> s) throws IllegalArgumentException { super.preHook(cur, s); registerJars(s); } @Override
/** * Get the console info stream for HiveServer2 or HiveCli. * @return The info stream */ public static PrintStream getInfoStream() { SessionState ss = SessionState.get(); return ((ss != null) && (ss.info != null)) ? ss.info : getErrStream(); }
@Override public Map<String, String> getHiveVariable() { return SessionState.get().getHiveVariables(); } }).substitute(ss.getConf(), varvalue));
public HiveAuthorizationProvider getAuthProvider() { if (authProvider == null) { authProvider = SessionState.get().getAuthorizer(); } return authProvider; }
/** * Is the logging to the info stream is enabled, or not. * @return True if the logging is disabled to the HiveServer2 or HiveCli info stream */ public boolean getIsSilent() { SessionState ss = SessionState.get(); // use the session or the one supplied in constructor return (ss != null) ? ss.getIsSilent() : isSilent; }
private void setNullCreateTableGrants() { //having a non null create table grants privileges causes problems in // the tests that compares underlying thrift Table object of created // table with a table object that was fetched from metastore. // This is because the fetch does not populate the privileges field in Table SessionState.get().setCreateTableGrants(null); }
private void warn(String msg) { SessionState.getConsole().printInfo("Warning: " + msg, false); }
/** * Logs info into the log file, and if the LogHelper is not silent then into the HiveServer2 or * HiveCli info stream too. * BeeLine uses the operation log file to show the logs to the user, so depending on the * BeeLine settings it could be shown to the user. * @param info The log message */ public void printInfo(String info) { printInfo(info, null); }
@Override public void renderReport(String report) { monitor.console.logInfo(report); } }
@Override protected SessionStates initialValue() { return new SessionStates(); } };
@Override public Map<String, String> getHiveVariable() { return SessionState.get().getHiveVariables(); } }).substitute(ss.getConf(), command);
private void warn(String msg) { SessionState.getConsole().printInfo("Warning: " + msg, false); }
/** * Logs info into the log file, and if not silent then into the HiveServer2 or HiveCli info * stream too. The isSilent parameter is used instead of the LogHelper isSilent attribute. * BeeLine uses the operation log file to show the logs to the user, so depending on the * BeeLine settings it could be shown to the user. * @param info The log message * @param isSilent If true then the message will not be printed to the info stream */ public void printInfo(String info, boolean isSilent) { printInfo(info, null, isSilent); }
@Override void renderReport(String report) { monitor.console.logInfo(report); } }
@Override public Map<String, String> getHiveVariable() { return SessionState.get().getHiveVariables(); } }).substitute(ss.getConf(), confVars.getDefaultValue()));
@Override public Map<String, String> getHiveVariable() { return SessionState.get().getHiveVariables(); } }).substitute(conf, prompt);
@Override public Map<String, String> getHiveVariable() { return SessionState.get().getHiveVariables(); } }).substitute(conf, rewrittenQuery);