private void logConfigurations(JobConf localJobConf) { if (LOG.isDebugEnabled()) { LOG.debug("Logging job configuration: "); StringBuilder outWriter = new StringBuilder(); // redact sensitive information before logging HiveConfUtil.dumpConfig(localJobConf, outWriter); LOG.debug(outWriter.toString()); } } }
/** * Dumps all env and config state. Should be called once on WebHCat start up to facilitate * support/debugging. Later it may be worth adding a REST call which will return this data. */ private String dumpEnvironent() { StringBuilder sb = TempletonUtils.dumpPropMap("========WebHCat System.getenv()========", System.getenv()); sb.append("START========WebHCat AppConfig.iterator()========: \n"); HiveConfUtil.dumpConfig(this, sb); sb.append("END========WebHCat AppConfig.iterator()========: \n"); sb.append(TempletonUtils.dumpPropMap("========WebHCat System.getProperties()========", System.getProperties())); sb.append(HiveConfUtil.dumpConfig(new HiveConf())); return sb.toString(); }
/** * Dumps all HiveConf for debugging. Convenient to dump state at process start up and log it * so that in later analysis the values of all variables is known */ public static StringBuilder dumpConfig(HiveConf conf) { StringBuilder sb = new StringBuilder("START========\"HiveConf()\"========\n"); sb.append("hiveDefaultUrl=").append(conf.getHiveDefaultLocation()).append('\n'); sb.append("hiveSiteURL=").append(HiveConf.getHiveSiteLocation()).append('\n'); sb.append("hiveServer2SiteUrl=").append(HiveConf.getHiveServer2SiteLocation()).append('\n'); sb.append("hivemetastoreSiteUrl=").append(HiveConf.getMetastoreSiteLocation()).append('\n'); dumpConfig(conf, sb); return sb.append("END========\"new HiveConf()\"========\n"); }
private void logOutputFormatError(Configuration hconf, HiveException ex) { StringBuilder errorWriter = new StringBuilder(); errorWriter.append("Failed to create output format; configuration: "); // redact sensitive information before logging HiveConfUtil.dumpConfig(hconf, errorWriter); Properties tdp = null; if (this.conf.getTableInfo() != null && (tdp = this.conf.getTableInfo().getProperties()) != null) { errorWriter.append(";\n table properties: { "); for (Map.Entry<Object, Object> e : tdp.entrySet()) { errorWriter.append(e.getKey() + ": " + e.getValue() + ", "); } errorWriter.append('}'); } LOG.error(errorWriter.toString(), ex); }
/** * Dumps all env and config state. Should be called once on WebHCat start up to facilitate * support/debugging. Later it may be worth adding a REST call which will return this data. */ private String dumpEnvironent() { StringBuilder sb = TempletonUtils.dumpPropMap("========WebHCat System.getenv()========", System.getenv()); sb.append("START========WebHCat AppConfig.iterator()========: \n"); HiveConfUtil.dumpConfig(this, sb); sb.append("END========WebHCat AppConfig.iterator()========: \n"); sb.append(TempletonUtils.dumpPropMap("========WebHCat System.getProperties()========", System.getProperties())); sb.append(HiveConfUtil.dumpConfig(new HiveConf())); return sb.toString(); }
/** * Dumps all HiveConf for debugging. Convenient to dump state at process start up and log it * so that in later analysis the values of all variables is known */ public static StringBuilder dumpConfig(HiveConf conf) { StringBuilder sb = new StringBuilder("START========\"HiveConf()\"========\n"); sb.append("hiveDefaultUrl=").append(conf.getHiveDefaultLocation()).append('\n'); sb.append("hiveSiteURL=").append(HiveConf.getHiveSiteLocation()).append('\n'); sb.append("hiveServer2SiteUrl=").append(HiveConf.getHiveServer2SiteLocation()).append('\n'); sb.append("hivemetastoreSiteUrl=").append(HiveConf.getMetastoreSiteLocation()).append('\n'); dumpConfig(conf, sb); return sb.append("END========\"new HiveConf()\"========\n"); }