LogHelper console = new LogHelper(LOG, isSilent); console.printError("Must specify Plan File Name"); printUsage(); .getAppenders().values()) { if (appender instanceof FileAppender) { console.printInfo("Execution log at: " + ((FileAppender) appender).getFileName()); } else if (appender instanceof RollingFileAppender) { console.printInfo("Execution log at: " + ((RollingFileAppender) appender).getFileName());
console.printInfo("Selecting local mode for task: " + getId()); this.setLocalMode(true); } else { console.printInfo("Cannot run job locally: " + reason); this.setLocalMode(false); new CachingPrintStream(SessionState.getConsole().getChildErrStream()); SessionState.getConsole().getChildOutStream()); StreamPrinter errPrinter = new StreamPrinter( executor.getErrorStream(), null,
System.setOut(console.getErrStream()); console.printError("-- BEGIN ORC FILE DUMP --"); FileDump.main(new String[]{fileStatus.getPath().toString(), "--rowindex=*"}); console.printError("-- END ORC FILE DUMP --"); } catch (FileFormatException e) { LOG.warn("File " + fileStatus.getPath() + " is not ORC. Skip printing orc file dump");
console.printInfo("Selecting local mode for task: " + getId()); this.setLocalMode(true); } else { console.printInfo("Cannot run job locally: " + reason); this.setLocalMode(false); new CachingPrintStream(SessionState.getConsole().getChildErrStream()); SessionState.getConsole().getChildOutStream()); StreamPrinter errPrinter = new StreamPrinter( executor.getErrorStream(), null,
console.printInfo("Selecting local mode for task: " + getId()); this.setLocalMode(true); } else { console.printInfo("Cannot run job locally: " + reason); this.setLocalMode(false); SessionState.getConsole().getChildOutStream()); StreamPrinter errPrinter = new StreamPrinter( executor.getErrorStream(), null, SessionState.getConsole().getChildErrStream());
public PrintStream getInfoStream() { SessionState ss = SessionState.get(); return ((ss != null) && (ss.info != null)) ? ss.info : getErrStream(); }
public void printError(String error, String detail) { getErrStream().println(error); LOG.error(error + StringUtils.defaultString(detail)); } }
public void printError(String error, String detail) { getErrStream().println(error); LOG.error(error + StringUtils.defaultString(detail)); } }
@Override public void preDriverRun(HiveDriverRunHookContext hookContext) throws Exception { SessionState sess = new SessionState((HiveConf)hookContext.getConf()); PrintStream stream = sess.getConsole().getOutStream(); stream.println(hookContext.getCommand()); }
public void printInfo(String info, String detail) { if (!getIsSilent()) { getInfoStream().println(info); } LOG.info(info + StringUtils.defaultString(detail)); }
public void printInfo(String info, String detail) { if (!getIsSilent()) { getErrStream().println(info); } LOG.info(info + StringUtils.defaultString(detail)); }
private static QTestProcessExecResult executeCmd(String[] args, String outFile, String errFile) throws Exception { System.out.println("Running: " + org.apache.commons.lang.StringUtils.join(args, ' ')); PrintStream out = outFile == null ? SessionState.getConsole().getChildOutStream() : new PrintStream(new FileOutputStream(outFile), true, "UTF-8"); PrintStream err = errFile == null ? SessionState.getConsole().getChildErrStream() : new PrintStream(new FileOutputStream(errFile), true, "UTF-8"); Process executor = Runtime.getRuntime().exec(args); ByteArrayOutputStream bos = new ByteArrayOutputStream(); PrintStream str = new PrintStream(bos, true, "UTF-8"); StreamPrinter errPrinter = new StreamPrinter(executor.getErrorStream(), null, err); StreamPrinter outPrinter = new StreamPrinter(executor.getInputStream(), null, out, str); outPrinter.start(); errPrinter.start(); int result = executor.waitFor(); outPrinter.join(); errPrinter.join(); if (outFile != null) { out.close(); } if (errFile != null) { err.close(); } return QTestProcessExecResult. create(result, new String(bos.toByteArray(), StandardCharsets.UTF_8)); }
console.printInfo("Selecting local mode for task: " + getId()); this.setLocalMode(true); } else { console.printInfo("Cannot run job locally: " + reason); this.setLocalMode(false); new CachingPrintStream(SessionState.getConsole().getChildErrStream()); SessionState.getConsole().getChildOutStream()); StreamPrinter errPrinter = new StreamPrinter( executor.getErrorStream(), null,
final AtomicInteger partitionsLoaded = new AtomicInteger(0); final boolean inPlaceEligible = conf.getLong("fs.trash.interval", 0) <= 0 && InPlaceUpdate.canRenderInPlace(conf) && !SessionState.getConsole().getIsSilent(); final PrintStream ps = (inPlaceEligible) ? SessionState.getConsole().getInfoStream() : null;
&& InPlaceUpdate.canRenderInPlace(conf) && !SessionState.getConsole().getIsSilent(); final PrintStream ps = (inPlaceEligible) ? SessionState.getConsole().getInfoStream() : null; final SessionState parentSession = SessionState.get();
boolean isSilent = HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVESESSIONSILENT); LogHelper console = new LogHelper(LOG, isSilent); console.printInfo("Execution log at: " + ((FileAppender) appender).getFileName()); } else if (appender instanceof RollingFileAppender) { console.printInfo("Execution log at: " + ((RollingFileAppender) appender).getFileName());
Configuration conf = (ss != null) ? ss.getConf() : new Configuration(); LogHelper console = new LogHelper(LOG); String error = StrictChecks.checkTypeSafety(conf); if (error != null) throw new UDFArgumentException(error); console.printError("WARNING: Comparing a bigint and a string may result in a loss of precision."); } else if ((oiTypeInfo0.equals(TypeInfoFactory.doubleTypeInfo) && oiTypeInfo1.equals(TypeInfoFactory.longTypeInfo)) || (oiTypeInfo0.equals(TypeInfoFactory.longTypeInfo) && oiTypeInfo1.equals(TypeInfoFactory.doubleTypeInfo))) { String error = StrictChecks.checkTypeSafety(conf); if (error != null) throw new UDFArgumentException(error); console.printError("WARNING: Comparing a bigint and a double may result in a loss of precision.");
super.initializeOp(hconf); boolean isSilent = HiveConf.getBoolVar(hconf, HiveConf.ConfVars.HIVESESSIONSILENT); console = new LogHelper(LOG, isSilent); memoryExhaustionChecker = MemoryExhaustionCheckerFactory.getChecker(console, hconf, conf); emptyRowContainer.addRow(emptyObjectArray);
System.setOut(console.getErrStream()); console.printError("-- BEGIN ORC FILE DUMP --"); FileDump.main(new String[]{fileStatus.getPath().toString(), "--rowindex=*"}); console.printError("-- END ORC FILE DUMP --"); } catch (FileFormatException e) { LOG.warn("File " + fileStatus.getPath() + " is not ORC. Skip printing orc file dump");
Configuration conf = (ss != null) ? ss.getConf() : new Configuration(); LogHelper console = new LogHelper(LOG); String error = StrictChecks.checkTypeSafety(conf); if (error != null) throw new UDFArgumentException(error); console.printError("WARNING: Comparing a bigint and a string may result in a loss of precision."); } else if ((oiTypeInfo0.equals(TypeInfoFactory.doubleTypeInfo) && oiTypeInfo1.equals(TypeInfoFactory.longTypeInfo)) || (oiTypeInfo0.equals(TypeInfoFactory.longTypeInfo) && oiTypeInfo1.equals(TypeInfoFactory.doubleTypeInfo))) { console.printError("WARNING: Comparing a bigint and a double may result in a loss of precision.");