MetaStore Thrift

2024-04-01 16:48
文章标签 thrift metastore

本文主要是介绍MetaStore Thrift,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Hive MetaStore整体代码分析
  远程metastore服务端和客户端之间使用Thrift协议通信。IMetaStoreClient接口定义了Metastore的thrift api,该接口中定义了操作元数据的各种方法。Hive中IMetaStoreClient的实现类是HiveMetaStoreClient。

Hive.getMSC() ➔ createMetaStoreClient()
  ↳ RetryingMetaStoreClient.getProxy()//动态代理类创建代理对象
  ↳RetryingMetaStoreClient.RetryingMetaStoreClient()
  ↳MetaStoreUtils.newInstance()//反射实例化对象
  ↳SessionHiveMetaStoreClient.SessionHiveMetaStoreClient()
  ↳HiveMetaStoreClient.HiveMetaStoreClient()
  ↳HiveMetaStoreClient.open()

 1   public HiveMetaStoreClient(HiveConf conf, HiveMetaHookLoader hookLoader)2     throws MetaException {3 4     this.hookLoader = hookLoader;5     if (conf == null) {6       conf = new HiveConf(HiveMetaStoreClient.class);7     }8     this.conf = conf;9     filterHook = loadFilterHooks();
10    //根据hive-site.xml中的hive.metastore.uris配置,如果配置该参数,则认为是远程连接,否则为本地连接
11     String msUri = conf.getVar(HiveConf.ConfVars.METASTOREURIS);
12     localMetaStore = HiveConfUtil.isEmbeddedMetaStore(msUri);
13     if (localMetaStore) {//本地连接直接连接HiveMetaStore
16       client = HiveMetaStore.newRetryingHMSHandler("hive client", conf, true);
17       isConnected = true;
18       snapshotActiveConf();
19       return;
20     }
21 
22     //获取配置中的重试次数及timeout时间
23     retries = HiveConf.getIntVar(conf, HiveConf.ConfVars.METASTORETHRIFTCONNECTIONRETRIES);
24     retryDelaySeconds = conf.getTimeVar(
25         ConfVars.METASTORE_CLIENT_CONNECT_RETRY_DELAY, TimeUnit.SECONDS);
26 
27     //拼接metastore uri
28     if (conf.getVar(HiveConf.ConfVars.METASTOREURIS) != null) {
29       String metastoreUrisString[] = conf.getVar(
30           HiveConf.ConfVars.METASTOREURIS).split(",");
31       metastoreUris = new URI[metastoreUrisString.length];
32       try 

这篇关于MetaStore Thrift的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/867655

相关文章

Hive metastore 无法解析分区字段 is not null问题排查

文章目录 一、问题描述二、解决方案 一、问题描述 周中发现一个问题,metastore根据条件获取分区时发生异常,导致扫描所有分区,最终导致gc异常。 hive编译时会进行逻辑优化,在执行分区裁剪时,会根据相关的分区过滤条件去metastore查询要扫描的分区目录。metastore会根据hiveserver传过来的条件表达式进行解析,然后过滤不需要的分区。 目前的问题是h

thrift JAVA服务端 python客户端的实现

最近用Python做网页的抓取,因为想得到JS解释后的HTML,先后尝试了selenium,windmill,htmlunit等web测试框架,因为只要得到html不需要界面展现,最后选择了htmlunit,而htmlunit只有Java的实现,所以考虑用RPC来进行python与JAVA的连接 最开始试用了一下ICE,JAVA端无问题,在用python做client的时候,发现ICE现在还

Hive 2.3.0 MetaException(message:Version information not found in metastore. )

使用Hive 2.3.0 配置远程模式(Remote)时,执行hive --service metastore命令时出现MetaException(message:Version information not found in metastore. )错误。 解决办法: The necessary tables required for the metastore are missing i

Hive元数据配置metastore

1.解压MySQL驱动的jar包,并拷贝MySQL驱动的jar包到hive安装目录的lib下: tar -zxvf mysql-connector-java-5.1.27-bin.jarcp mysql-connector-java-5.1.27-bin.jar /opt/modules/hive-0.13.1/lib/ 2.在hive/conf中创建文件hive-site.xml,并编辑:

Hive之——metastore三种配置方式(转)

转自:https://blog.csdn.net/l1028386804/article/details/51564235   Hive的meta数据支持以下三种存储方式,其中两种属于本地存储,一种为远端存储。远端存储比较适合生产环境。Hive官方wiki详细介绍了这三种方式,链接为:Hive Metastore。   一、本地derby   这种方式是最简单的存储方式,只需要在hiv

MessagePack, Protocol Buffers和Thrift序列化框架原理和比较说明

转自: http://blog.csdn.net/javastart/article/details/51306423 第1部分 messagepack说明 1.1messagepack的消息编码说明 为什么messagepack比json序列化使用的字节流更少, 可通过图1-1、图1-2有个直观的感觉。     图1- 1 messagepack与json的格式

Thrift在Java中的简单实例(四)

Thrift的基本语法 1.1 类型   Thrift类型系统包括预定义基本类型,用户自定义结构体,容器类型,异常和服务定义。 1.1.1 基本类型 bool: 布尔值 (true or false), one byte byte: 有符号字节 i16: 16位有符号整型 i32: 32位有符号整型 i64: 64位有符号整型 double: 64位浮点型

Thrift在Java中的简单实例(三)

Thrift的客户端的创建 1,2与(二)相同,只是不需要实现接口 3.客户端的编写 package cn.huikey.thrift.client;import java.io.IOException;public class ThriftClient {public static void main(String[] args) throws IOException, TExcepti

Java实现SparkSQL Thrift方式读取Hive数据

前提是启动Thrit端口,我这里Thrift端口12000。 @Overridepublic QueryResult SparkOnLine(String sql, String userName) {ResultSet resultSet = null; Statement stmt = null; Connection conn = null; boolean

Java实现SparkSQL Thrift 方式读取Hive数据

private List<List<String>> queryHiveData(String sql) {ResultSet resultSet = null; Statement stmt = null; Connection conn = null; boolean flag = true; int columnsCount = 0; String U