MCPcopy Create free account
hub / github.com/apache/impala / GetThriftEnum

Function GetThriftEnum

be/src/util/parse-util.h:83–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81/// Return an error for an invalid Thrift enum value.
82template <typename ENUM_TYPE>
83static inline Status GetThriftEnum(const std::string& value, const std::string& desc,
84 const std::map<int, const char*>& enum_values_to_names, ENUM_TYPE* enum_value) {
85 for (const auto& e : enum_values_to_names) {
86 if (boost::algorithm::iequals(value, std::to_string(e.first))
87 || boost::algorithm::iequals(value, e.second)) {
88 *enum_value = static_cast<ENUM_TYPE>(e.first);
89 return Status::OK();
90 }
91 }
92 return Status(strings::Substitute("Invalid $0: '$1'. Valid values are $2.", desc, value,
93 GetThriftEnumValues(enum_values_to_names)));
94}
95}

Callers 2

SetQueryOptionMethod · 0.85
ParseCompressionCodecMethod · 0.85

Calls 5

iequalsFunction · 0.85
OKFunction · 0.85
SubstituteFunction · 0.85
GetThriftEnumValuesFunction · 0.85
StatusClass · 0.70

Tested by

no test coverage detected