Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::ErrorMsg Class Reference

#include <error-util.h>

Collaboration diagram for impala::ErrorMsg:

Public Types

typedef
strings::internal::SubstituteArg 
ArgType
 

Public Member Functions

 ErrorMsg ()
 Trivial constructor. More...
 
 ErrorMsg (TErrorCode::type error)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1, const ArgType &arg2)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1, const ArgType &arg2, const ArgType &arg3)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1, const ArgType &arg2, const ArgType &arg3, const ArgType &arg4)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1, const ArgType &arg2, const ArgType &arg3, const ArgType &arg4, const ArgType &arg5)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1, const ArgType &arg2, const ArgType &arg3, const ArgType &arg4, const ArgType &arg5, const ArgType &arg6)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1, const ArgType &arg2, const ArgType &arg3, const ArgType &arg4, const ArgType &arg5, const ArgType &arg6, const ArgType &arg7)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1, const ArgType &arg2, const ArgType &arg3, const ArgType &arg4, const ArgType &arg5, const ArgType &arg6, const ArgType &arg7, const ArgType &arg8)
 
 ErrorMsg (TErrorCode::type error, const ArgType &arg0, const ArgType &arg1, const ArgType &arg2, const ArgType &arg3, const ArgType &arg4, const ArgType &arg5, const ArgType &arg6, const ArgType &arg7, const ArgType &arg8, const ArgType &arg9)
 
 ErrorMsg (TErrorCode::type error, const std::vector< string > &detail)
 
TErrorCode::type error () const
 
void AddDetail (const std::string &d)
 Add detail string message. More...
 
void SetError (TErrorCode::type e)
 Set a specific error code. More...
 
const std::string & msg () const
 Returns the formatted error string. More...
 
const std::vector< std::string > & details () const
 
std::string GetFullMessageDetails () const
 

Static Public Member Functions

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)
 

Private Attributes

TErrorCode::type error_
 
std::string message_
 
std::vector< std::string > details_
 

Detailed Description

Class that holds a formatted error message and potentially a set of detail messages. Error messages are intended to be user facing. Error details can be attached as strings to the message. These details should only be accessed internally.

Definition at line 47 of file error-util.h.

Member Typedef Documentation

typedef strings::internal::SubstituteArg impala::ErrorMsg::ArgType

Definition at line 49 of file error-util.h.

Constructor & Destructor Documentation

impala::ErrorMsg::ErrorMsg ( )
inline

Trivial constructor.

Definition at line 52 of file error-util.h.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error)

Below are a set of overloaded constructors taking all possible number of arguments that can be passed to Substitute. The reason is to try to avoid forcing the compiler putting all arguments for Substitute() on the stack whenver this is called and thus polute the instruction cache.

Definition at line 53 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0 
)

Definition at line 57 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1 
)

Definition at line 62 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1,
const ArgType arg2 
)

Definition at line 67 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1,
const ArgType arg2,
const ArgType arg3 
)

Definition at line 73 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1,
const ArgType arg2,
const ArgType arg3,
const ArgType arg4 
)

Definition at line 79 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1,
const ArgType arg2,
const ArgType arg3,
const ArgType arg4,
const ArgType arg5 
)

Definition at line 85 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1,
const ArgType arg2,
const ArgType arg3,
const ArgType arg4,
const ArgType arg5,
const ArgType arg6 
)

Definition at line 92 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1,
const ArgType arg2,
const ArgType arg3,
const ArgType arg4,
const ArgType arg5,
const ArgType arg6,
const ArgType arg7 
)

Definition at line 99 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1,
const ArgType arg2,
const ArgType arg3,
const ArgType arg4,
const ArgType arg5,
const ArgType arg6,
const ArgType arg7,
const ArgType arg8 
)

Definition at line 106 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const ArgType arg0,
const ArgType arg1,
const ArgType arg2,
const ArgType arg3,
const ArgType arg4,
const ArgType arg5,
const ArgType arg6,
const ArgType arg7,
const ArgType arg8,
const ArgType arg9 
)

Definition at line 114 of file error-util.cc.

impala::ErrorMsg::ErrorMsg ( TErrorCode::type  error,
const std::vector< string > &  detail 
)
inline

Definition at line 85 of file error-util.h.

Member Function Documentation

void impala::ErrorMsg::AddDetail ( const std::string &  d)
inline

Add detail string message.

Definition at line 108 of file error-util.h.

References details_.

Referenced by impala::Status::AddDetail(), impala::Status::MergeStatus(), and impala::TEST().

const std::vector<std::string>& impala::ErrorMsg::details ( ) const
inline

Definition at line 122 of file error-util.h.

References details_.

Referenced by impala::Status::MergeStatus(), and impala::Status::ToThrift().

TErrorCode::type impala::ErrorMsg::error ( ) const
inline
std::string impala::ErrorMsg::GetFullMessageDetails ( ) const
inline

Produce a string representation of the error message that includes the formatted message of the original error and the attached detail strings.

Definition at line 128 of file error-util.h.

References details_, and message_.

Referenced by impala::Status::GetDetail(), and impala::TEST().

ErrorMsg impala::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 
)
static

Static initializer that is needed to avoid issues with static initialization order and the point in time when the string list generated via thrift becomes available. This method should not be used if no static initialization is needed as the cost of this method is proportional to the number of entries in the global error message list. WARNING: DO NOT CALL THIS METHOD IN A NON STATIC CONTEXT

Definition at line 122 of file error-util.cc.

References error(), error_, and message_.

const std::string& impala::ErrorMsg::msg ( ) const
inline
void impala::ErrorMsg::SetError ( TErrorCode::type  e)
inline

Set a specific error code.

Definition at line 113 of file error-util.h.

References error_.

Member Data Documentation

std::vector<std::string> impala::ErrorMsg::details_
private

Definition at line 140 of file error-util.h.

Referenced by AddDetail(), details(), and GetFullMessageDetails().

TErrorCode::type impala::ErrorMsg::error_
private

Definition at line 138 of file error-util.h.

Referenced by error(), Init(), and SetError().

std::string impala::ErrorMsg::message_
private

Definition at line 139 of file error-util.h.

Referenced by GetFullMessageDetails(), Init(), and msg().


The documentation for this class was generated from the following files: