需要监控hive每个小步骤的执行耗时,通过hive thrift协议与hiveserver2交互,thirft 返回的是guid,需要与hiveserver2监控页面的operationId进行映射,通过查看hive源码,找到其他映射逻辑如下。
public HandleIdentifier(THandleIdentifier tHandleId) {
ByteBuffer bb = ByteBuffer.wrap(tHandleId.getGuid());
this.publicId = new UUID(bb.getLong(), bb.getLong());
bb = ByteBuffer.wrap(tHandleId.getSecret());
this.secretId = new UUID(bb.getLong(), bb.getLong());
}
@Override
public String toString() {
return publicId.toString();
}
本文介绍如何通过Hive Thrift接口监控Hive Server 2的执行步骤,关注每个步骤的耗时,并解析Thrift返回的GUID与HS2监控页面的operationId之间的对应关系。深入理解了Hive源码中如何将GUID转化为publicId和secretId的过程。

被折叠的 条评论
为什么被折叠?



