/** * For a given error message string, searches for a <code>ErrorMsg</code> enum * that appears to be a match. If a match is found, returns the * <code>SQLState</code> associated with the <code>ErrorMsg</code>. If a match * is not found or <code>ErrorMsg</code> has no <code>SQLState</code>, returns * the <code>SQLState</code> bound to the <code>GENERIC_ERROR</code> * <code>ErrorMsg</code>. * * @param mesg * An error message string * @return SQLState */ public static String findSQLState(String mesg) { ErrorMsg error = getErrorMsg(mesg); return error.getSQLState(); }
private void setErrorMsgAndDetail(int exitVal, Throwable downstreamError, Task tsk) { this.downstreamError = downstreamError; errorMessage = "FAILED: Execution Error, return code " + exitVal + " from " + tsk.getClass().getName(); if(downstreamError != null) { //here we assume that upstream code may have parametrized the msg from ErrorMsg //so we want to keep it errorMessage += ". " + downstreamError.getMessage(); } else { ErrorMsg em = ErrorMsg.getErrorMsg(exitVal); if (em != null) { errorMessage += ". " + em.getMsg(); } } }
/** * For a given error message string, searches for a <code>ErrorMsg</code> enum * that appears to be a match. If a match is found, returns the * <code>SQLState</code> associated with the <code>ErrorMsg</code>. If a match * is not found or <code>ErrorMsg</code> has no <code>SQLState</code>, returns * the <code>SQLState</code> bound to the <code>GENERIC_ERROR</code> * <code>ErrorMsg</code>. * * @param mesg * An error message string * @return SQLState */ public static String findSQLState(String mesg) { ErrorMsg error = getErrorMsg(mesg); return error.getSQLState(); }
static private HiveException getHiveException(Exception e, String msg, String logMsg) { // The message from remote exception includes the entire stack. The error thrown from // hive based on the remote exception needs only the first line. String hiveErrMsg = null; if (e.getMessage() != null) { hiveErrMsg = String.format("%s%s%s", msg, ": ", Splitter.on(System.getProperty("line.separator")).split(e.getMessage()).iterator() .next()); } else { hiveErrMsg = msg; } ErrorMsg errorMsg = ErrorMsg.getErrorMsg(e); if (logMsg != null) { LOG.info(String.format(logMsg, e.getMessage())); } if (errorMsg != ErrorMsg.UNRESOLVED_RT_EXCEPTION) { return new HiveException(e, e.getMessage(), errorMsg, hiveErrMsg); } else { return new HiveException(msg, e); } }
private void setErrorMsgAndDetail(int exitVal, Throwable downstreamError, Task tsk) { this.downstreamError = downstreamError; errorMessage = "FAILED: Execution Error, return code " + exitVal + " from " + tsk.getClass().getName(); if(downstreamError != null) { //here we assume that upstream code may have parametrized the msg from ErrorMsg //so we want to keep it if (downstreamError.getMessage() != null) { errorMessage += ". " + downstreamError.getMessage(); } else { errorMessage += ". " + org.apache.hadoop.util.StringUtils.stringifyException(downstreamError); } } else { ErrorMsg em = ErrorMsg.getErrorMsg(exitVal); if (em != null) { errorMessage += ". " + em.getMsg(); } } }
@Override protected int execute(DriverContext driverContext) { try { Hive hiveDb = getHive(); Path dumpRoot = new Path(conf.getVar(HiveConf.ConfVars.REPLDIR), getNextDumpDir()); DumpMetaData dmd = new DumpMetaData(dumpRoot, conf); Path cmRoot = new Path(conf.getVar(HiveConf.ConfVars.REPLCMDIR)); Long lastReplId; if (work.isBootStrapDump()) { lastReplId = bootStrapDump(dumpRoot, dmd, cmRoot, hiveDb); } else { lastReplId = incrementalDump(dumpRoot, dmd, cmRoot, hiveDb); } prepareReturnValues(Arrays.asList(dumpRoot.toUri().toString(), String.valueOf(lastReplId))); } catch (Exception e) { LOG.error("failed", e); setException(e); return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode(); } return 0; }
LOG.error("unable to copy {} to {}", sourcePath, targetPath, e); setException(e); return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode();
private void testReverseMatch(ErrorMsg errorMsg, String... args) { String parametrizedMsg = errorMsg.format(args); ErrorMsg canonicalMsg = ErrorMsg.getErrorMsg(parametrizedMsg); Assert.assertEquals("Didn't find expected msg", errorMsg.getErrorCode(), canonicalMsg.getErrorCode()); } }
LOG.error(StringUtils.stringifyException(e)); setException(e); return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode();
return cpr; ErrorMsg canonicalErr = ErrorMsg.getErrorMsg(cpr.getResponseCode()); if(canonicalErr != null && canonicalErr != ErrorMsg.GENERIC_ERROR) { ErrorMsg.getErrorMsg(downstreamError.getMessage()); mdf.error(ss.out, errorMessage, canonicalMsg.getErrorCode(), SQLState, org.apache.hadoop.util.StringUtils.
return cpr; ErrorMsg canonicalErr = ErrorMsg.getErrorMsg(cpr.getResponseCode()); if(canonicalErr != null && canonicalErr != ErrorMsg.GENERIC_ERROR) { ErrorMsg.getErrorMsg(downstreamError.getMessage()); mdf.error(ss.out, errorMessage, canonicalMsg.getErrorCode(), SQLState, org.apache.hadoop.util.StringUtils.
ErrorMsg error = ErrorMsg.getErrorMsg(e.getMessage()); errorMessage = "FAILED: " + e.getClass().getSimpleName(); if (error != ErrorMsg.GENERIC_ERROR) {
ErrorMsg error = ErrorMsg.getErrorMsg(e.getMessage()); errorMessage = "FAILED: " + e.getClass().getSimpleName(); if (error != ErrorMsg.GENERIC_ERROR) {
LOG.error("replication failed", e); setException(e); return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode();
private void setErrorMsgAndDetail(int exitVal, Throwable downstreamError, Task tsk) { this.downstreamError = downstreamError; errorMessage = "FAILED: Execution Error, return code " + exitVal + " from " + tsk.getClass().getName(); if(downstreamError != null) { //here we assume that upstream code may have parametrized the msg from ErrorMsg //so we want to keep it errorMessage += ". " + downstreamError.getMessage(); } else { ErrorMsg em = ErrorMsg.getErrorMsg(exitVal); if (em != null) { errorMessage += ". " + em.getMsg(); } } } /**
/** * For a given error message string, searches for a <code>ErrorMsg</code> enum * that appears to be a match. If a match is found, returns the * <code>SQLState</code> associated with the <code>ErrorMsg</code>. If a match * is not found or <code>ErrorMsg</code> has no <code>SQLState</code>, returns * the <code>SQLState</code> bound to the <code>GENERIC_ERROR</code> * <code>ErrorMsg</code>. * * @param mesg * An error message string * @return SQLState */ public static String findSQLState(String mesg) { ErrorMsg error = getErrorMsg(mesg); return error.getSQLState(); }
return cpr; ErrorMsg canonicalErr = ErrorMsg.getErrorMsg(cpr.getResponseCode()); if(canonicalErr != null && canonicalErr != ErrorMsg.GENERIC_ERROR) { ErrorMsg.getErrorMsg(downstreamError.getMessage()); mdf.error(ss.out, errorMessage, canonicalMsg.getErrorCode(), SQLState, org.apache.hadoop.util.StringUtils.
ErrorMsg error = ErrorMsg.getErrorMsg(e.getMessage()); errorMessage = "FAILED: " + e.getClass().getSimpleName(); if (error != ErrorMsg.GENERIC_ERROR) {