apache-hive / 3.1.1 / reference / MetaStore_API_Tests.html

IMetaStoreClient Tests

JavaClient 端访问 MetaStore 的一种选择是通过 IMetaStoreClient 接口实现进行连接。

为了确保 IMetaStoreClient 实现提供相同的 API,我们创建了一组测试以验证其工作原理。

当前测试了以下实现:

  • EmbeddedMetaStore –当 MetaStore 在同一线程中运行并且在进行通信时使用。由 EmbeddedMetaStoreForTests 表示。

  • RemoteMetaStore –当 MetaStore 在单独的线程中但在同一 JVM 中运行时,并且在 Thrift 中使用通信。由 RemoteMetaStoreForTests 表示。

  • ClusterMetaStore –与测试分开启动 MetaStore 时。当前,代码中未使用它,但是可以将其用于测试 MetaStore 的早期版本,以确保向后兼容。

MetaStoreFactoryForTests 在@ Parameterized.Parameters 中提供了可在参数化测试中使用的这些实现的列表。当前返回列表包含以下实现:

  • 嵌入式–使用与 TestEmbeddedHiveMetaStore 相同的配置。

  • 远程–使用与 TestRemoteHiveMetaStore 相同的配置。以后可以添加多个配置,例如 TestSetUGIOnBothClientServer,TestSetUGIOnOnlyClient,TestSetUGIOnOnlyServer 中的配置。

  • 如果提供了-Dtest.hms.client.configs,那么列表中也会返回 ClusterMetaStore。

以下测试文件将检查 API 功能:

  • TestDatabases –创建,查询,删除数据库

  • TestFunctions –创建,查询,删除函数

  • ...