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

Function StatusFromThrift

be/src/common/status-serialization.cc:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace impala {
30
31Status StatusFromThrift(const TStatus& status) {
32 if (status.status_code == TErrorCode::OK) return Status::OK();
33
34 ErrorMsg msg;
35 msg.SetErrorCode(status.status_code);
36 if (status.error_msgs.size() > 0) {
37 // The first message is the actual error message. (See StatusToThrift()).
38 msg.SetErrorMsg(status.error_msgs.front());
39 // The following messages are details.
40 std::for_each(status.error_msgs.begin() + 1, status.error_msgs.end(),
41 [&](string const& detail) { msg.AddDetail(detail); });
42 }
43 return Status(msg);
44}
45
46Status StatusFromProto(const StatusPB& status) {
47 if (status.status_code() == TErrorCode::OK) return Status::OK();

Callers 15

RegisterMethod · 0.85
SendTopicUpdateMethod · 0.85
InitStatestoreHaMethod · 0.85
SendHaHeartbeatMethod · 0.85
UpdateCatalogMethod · 0.85
ExecMethod · 0.85
WaitForHmsEventMethod · 0.85
OpenMethod · 0.85
FetchBatchMethod · 0.85
_dropTableFunction · 0.85

Calls 9

OKFunction · 0.85
SetErrorCodeMethod · 0.80
SetErrorMsgMethod · 0.80
frontMethod · 0.80
StatusClass · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
AddDetailMethod · 0.45

Tested by 5

RegisterMethod · 0.68
SendTopicUpdateMethod · 0.68
InitStatestoreHaMethod · 0.68
SendHaHeartbeatMethod · 0.68