16 #ifndef IMPALA_UTIL_ERROR_UTIL_H
17 #define IMPALA_UTIL_ERROR_UTIL_H
22 #include <boost/cstdint.hpp>
23 #include <boost/lexical_cast.hpp>
25 #include "gen-cpp/CatalogObjects_types.h"
26 #include "gen-cpp/ErrorCodes_types.h"
27 #include "gen-cpp/ErrorCodes_constants.h"
28 #include "gen-cpp/ImpalaInternalService_types.h"
29 #include "gutil/strings/substitute.h"
41 const std::vector<TTableName>& tables_missing_stats);
49 typedef strings::internal::SubstituteArg
ArgType;
95 const ArgType& arg1 = ArgType::NoArg,
96 const ArgType& arg2 = ArgType::NoArg,
97 const ArgType& arg3 = ArgType::NoArg,
98 const ArgType& arg4 = ArgType::NoArg,
99 const ArgType& arg5 = ArgType::NoArg,
100 const ArgType& arg6 = ArgType::NoArg,
101 const ArgType& arg7 = ArgType::NoArg,
102 const ArgType& arg8 = ArgType::NoArg,
103 const ArgType& arg9 = ArgType::NoArg);
118 const std::string&
msg()
const {
122 const std::vector<std::string>&
details()
const {
129 std::stringstream ss;
131 for(
size_t i=0, end=
details_.size(); i < end; ++i) {
const std::string & msg() const
Returns the formatted error string.
string GetTablesMissingStatsWarning(const vector< TTableName > &tables_missing_stats)
string PrintErrorMapToString(const ErrorLogMap &errors)
TErrorCode::type error() const
void MergeErrorMaps(ErrorLogMap *left, const ErrorLogMap &right)
ErrorMsg(TErrorCode::type error, const std::vector< string > &detail)
void AppendError(ErrorLogMap *map, const ErrorMsg &e)
std::vector< std::string > details_
void SetError(TErrorCode::type e)
Set a specific error code.
void AddDetail(const std::string &d)
Add detail string message.
size_t ErrorCount(const ErrorLogMap &errors)
std::string GetFullMessageDetails() const
static ErrorMsg Init(TErrorCode::type error, const ArgType &arg0=ArgType::NoArg, const ArgType &arg1=ArgType::NoArg, const ArgType &arg2=ArgType::NoArg, const ArgType &arg3=ArgType::NoArg, const ArgType &arg4=ArgType::NoArg, const ArgType &arg5=ArgType::NoArg, const ArgType &arg6=ArgType::NoArg, const ArgType &arg7=ArgType::NoArg, const ArgType &arg8=ArgType::NoArg, const ArgType &arg9=ArgType::NoArg)
strings::internal::SubstituteArg ArgType
void PrintErrorMap(ostream *stream, const ErrorLogMap &errors)
const std::vector< std::string > & details() const
ErrorMsg()
Trivial constructor.
std::map< TErrorCode::type, TErrorLogEntry > ErrorLogMap
Tracks log messages per error code.