16 #ifndef IMPALA_SERVICE_IMPALA_SERVER_INLINE_H
17 #define IMPALA_SERVICE_IMPALA_SERVER_INLINE_H
24 const apache::hive::service::cli::thrift::THandleIdentifier& handle,
25 TUniqueId* unique_id, TUniqueId* secret) {
26 if (handle.guid.length() != 16 || handle.secret.length() != 16) {
28 ss <<
"Malformed THandleIdentifier (guid size: " << handle.guid.length()
29 <<
", expected 16, secret size: " << handle.secret.length() <<
", expected 16)";
32 memcpy(&(unique_id->hi), handle.guid.c_str(), 8);
33 memcpy(&(unique_id->lo), handle.guid.c_str() + 8, 8);
34 memcpy(&(secret->hi), handle.secret.c_str(), 8);
35 memcpy(&(secret->lo), handle.secret.c_str() + 8, 8);
41 const TUniqueId& unique_id,
const TUniqueId& secret,
42 apache::hive::service::cli::thrift::THandleIdentifier* handle) {
44 memcpy((
void*)uuid, &unique_id.hi, 8);
45 memcpy((
void*)(uuid + 8), &unique_id.lo, 8);
46 handle->guid.assign(uuid, 16);
47 memcpy((
void*)uuid, &secret.hi, 8);
48 memcpy((
void*)(uuid + 8), &secret.lo, 8);
49 handle->secret.assign(uuid, 16);
static void TUniqueIdToTHandleIdentifier(const TUniqueId &unique_id, const TUniqueId &secret, apache::hive::service::cli::thrift::THandleIdentifier *handle)
static Status THandleIdentifierToTUniqueId(const apache::hive::service::cli::thrift::THandleIdentifier &handle, TUniqueId *unique_id, TUniqueId *secret)
Helper functions to translate between HiveServer2 and Impala structs.