Table 管理能力概述
GooseFS Table 管理能力用于管理结构化数据,为 SparkSQL、Hive、Presto 等上层计算应用提供数据库表管理能力,目前底层支持对接 Hive MetaStore。Table 管理能力能够帮助各类 SQL 引擎读取指定的数据内容,能够有效提升大数据场景下对数据的访问效率。

GooseFS Table 管理能力目前主要支持了以下特性:元数据层面的描述能力。GooseFS Catalog 提供源自远程元数据服务(Hive MetaStore)的元数据缓存服务,针对 SparkSQL,Hive,SQL Presto 等 SQL 引擎做查询时,可以根据 GooseFS Catalog 中的元数据缓存服务来确定读取数据大小、目标数据位置以及数据结构,具备与 Hive MetaStore 相同的能力表现。表级数据预缓存能力。GooseFS Catalog 能够感知数据表和数据存储路径的对应关系,进而可以提供 Table 级别以及 Table Partition 级别的缓存预热能力,帮助用户提前按照表结构缓存数据,极大提高访问性能。跨存储服务的统一元数据服务。通过 GooseFS Catalog 运行上层计算应用,可以同时对不同的底层存储系统提供访问加速能力。同时 GooseFS Catalog 可以提供跨越存储服务的统一元数据查询能力,只需要一个 GooseFS 客户端开启 Catalog 功能,即可查询不同存储系统,例如 HDFS、COS、CHDFS 中的数据。
使用 GooseFS Table 管理能力
GooseFS Table 管理能力通过 goosefs table 指令集实现,提供了 DB 的绑定和解绑、查询 DB 信息、查询表信息、数据加载、数据淘汰等能力。GooseFS Table 管理指令集如下所示:
$ goosefs tableUsage: goosefs table [generic options] [attachdb [-o|--option ] [--db ] [--ignore-sync-errors] ] [detachdb ] [free [-p|--partition ]] [load [-g|--greedy] [--replication ] [-p|--partition ]] [ls [ []]] [stat ] [sync ]
上述指令集中各项指令的能力简述如下:attachdb:挂载数据库,将一个远端数据库绑定到 GooseFS 上,目前仅支持 Hive MetaStore。detachdb:卸载数据库,将 GooseFS 上绑定的数据库解绑。free:清除指定 DB.Table 的数据缓存,可支持 Partition 粒度。load:缓存指定 DB.Table 的数据,可支持 partition 粒度,支持通过 replication 设置缓存的副本数。ls:列出指定 DB 或 DB.Table 的元数据信息。stat:查询指定 DB.Table 的文件数目、总大小、以及缓存百分比。sync:同步指定 DB 的内容。transform:将指定 DB 关联的 Table 转换为新的 Table。transformStatus:Table 转换的进度情况。
1. 挂载 DB
预热指定 Table 数据到 GooseFS 之前,需要将对应的 DB 挂载到 GooseFS 上。如下指令展示了将指定地址 metastore_host:port 中的数据库 goosefs_db_demo 挂载到 GooseFS 中,并将该 DB 在 GooseFS 中命名为 test_db:
$ goosefs table attachdb --db test_db hive thrift://metastore_host:port goosefs_db_demo
response of attachdb注意 metastore_host:port 可以替换为任意合法可连接的 Hive MetaStore 地址。
2. 查看 Table 信息
绑定完数据库后,可以通过 ls 指令查看已挂载的 DB 和 Table 信息,如下指令展示了如何查询 test_db 中的 web_page 表信息:
$ goosefs table ls test_db web_page
OWNER: hadoopDBNAME.TABLENAME: testdb.web_page ( wp_web_page_sk bigint, wp_web_page_id string, wp_rec_start_date string, wp_rec_end_date string, wp_creation_date_sk bigint, wp_access_date_sk bigint, wp_autogen_flag string, wp_customer_sk bigint, wp_url string, wp_type string, wp_char_count int, wp_link_count int, wp_image_count int, wp_max_ad_count int,)PARTITIONED BY ()LOCATION ( gfs://metastore_host:port/myiNamespace/3000/web_page)PARTITION LIST ( { partitionName: web_page location: gfs://metastore_host:port/myNamespace/3000/web_page })3. 预热 Table 中的数据
预热 Table 的指令下发后会在后台发起一个异步作业,GooseFS 会在启动作业后返回一个作业 ID,可以通过
job stat
指令查询任务的运行状态,同时可以通过table stat
指令查看预热百分比。预热指令如下:$ goosefs table load test_db web_pageAsynchronous job submitted successfully, jobId: 16159660788364. 查看 Table 预热情况
通过
job stat
指令可以查看预热 Table 作业的执行进度。当状态为 COMPLETED 时,整个预热过程完成,如果状态为 FAILED,可以在 master.log 文件中查看日志记录,排查预热错误的原因:$ goosefs job stat 1615966078836COMPLETED当 Table 完成预热后,可以通过 stat 指令查看指定 Table 的概况。
$ goosefs table stat test_db web_pagedetail5. 释放 Table
通过以下指令可以从 GooseFS 中释放指定 Table 数据缓存:
$ goosefs table free test_db web_pagedetail6. 卸载 DB
通过以下指令可以从 GooseFS 中卸载指定 DB:
$ goosefs table detachdb test_dbdetail
对象存储官网1折活动,限时活动,即将结束,速速收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利。同意关联立享优惠转转请注明出处:https://www.yunxiaoer.com/144871.html
赞 (0)腾讯云对象存储统一命名空间能力上一篇 2023年12月9日 上午1:52腾讯云对象存储GooseFS-FUSE 能力下一篇 2023年12月9日 上午1:52详情页2本站为广大会员提供阿里云、腾讯云、华为云、百度云等一线大厂的购买,续费优惠,保证底价,买贵退差。