当前位置:网站首页>Hudi 数据管理和存储概述
Hudi 数据管理和存储概述
2022-07-03 09:00:00 【小胡今天有变强吗】
数据管理
**Hudi 是如何管理数据? **
使用表Table形式组织数据,并且每张表中数据类 似Hive分区表,按照分区字段划分数据到不同目录中, 每条数据有主键PrimaryKey,标识数据唯一性。
Hudi 数据管理
Hudi表的数据文件,可以使用操作系统的文件系统存储,也可以使用HDFS这种分布式的文件系统存储。为了分 析性能和数据的可靠性,一般使用HDFS进行存储。以HDFS存储来看,一个Hudi表的存储文件分为两类。
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-YvuTlmxp-1654782269035)(C:\Users\Husheng\Desktop\大数据框架学习\image-20220609205143126.png)]](/img/f7/64c17ef5e0e77fbced43acdf29932a.png)
.hoodie
(1).hoodie 文件:由于CRUD的零散性,每一次的操作都会生成一个文件,这些小文件越来越多后,会严重影响HDFS的 性能,Hudi设计了一套文件合并机制。 .hoodie文件夹中存放了对应的文件合并操作相关的日志文件。
Hudi把随着时间流逝,对表的一系列CRUD操作叫做Timeline,Timeline中某一次的操作,叫做Instant。
- Instant Action,记录本次操作是一次数据提交(COMMITS),还是文件合并(COMPACTION),或者是文件清理(CLEANS);
- Instant Time,本次操作发生的时间;
- State,操作的状态,发起(REQUESTED),进行中(INFLIGHT),还是已完成(COMPLETED);
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8Glv0pMg-1654782269036)(C:\Users\Husheng\Desktop\大数据框架学习\image-20220609205512376.png)]](/img/d3/73c20c5a366fc53aa17b42e9f80a94.png)
amricas和asia
(2)amricas和asia相关的路径是实际的数据文件,按分区存储,分区的路径key是可以指定的。
- Hudi真实的数据文件使用Parquet文件格式存储;
- 其中包含一个metadata元数据文件和数据文件parquet列式存储。
- Hudi为了实现数据的CRUD,需要能够唯一标识一条记录,Hudi将把数据集中的唯一字段(record key ) + 数据所在 分区 (partitionPath) 联合起来当做数据的唯一键。
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vkMLkqhU-1654782269037)(C:\Users\Husheng\Desktop\大数据框架学习\image-20220609205849955.png)]](/img/18/286d66b6538b04e1e54e2aefc6ca16.png)
Hudi存储概述
Hudi数据集的组织目录结构与Hive表示非常相似,一份数据集对应这一个根目录。数据集被打散为多个分区,分区 字段以文件夹形式存在,该文件夹包含该分区的所有文件。
在根目录下,每个分区都有唯一的分区路径,每个分区数据存储在多个文件中。
每个文件都有惟一的fileId和生成文件的commit所标识。如果发生更新操作时,多个文件共享相同的fileId,但会 有不同的commit。

Metadata 元数据
- 以时间轴(timeline)的形式将数据集上的各项操作元数据维护起来,以支持数据集的瞬态视图,这部分元数据存 储于根目录下的元数据目录。一共有三种类型的元数据:
- Commits:一个单独的commit包含对数据集之上一批数据的一次原子写入操作的相关信息。我们用单调递增的时间戳来标识 commits,标定的是一次写入操作的开始。
- Cleans:用于清除数据集中不再被查询所用到的旧版本文件的后台活动。
- Compactions:用于协调Hudi内部的数据结构差异的后台活动。例如,将更新操作由基于行存的日志文件归集到列存数据上。
Index 索引
- Hudi维护着一个索引,以支持在记录key存在情况下,将新记录的key快速映射到对应的fileId。
- Bloom filter:存储于数据文件页脚。默认选项,不依赖外部系统实现。数据和索引始终保持一致。
- Apache HBase :可高效查找一小批key。在索引标记期间,此选项可能快几秒钟。

Data 数据
Hudi以两种不同的存储格式存储所有摄取的数据,用户可选择满足下列条件的任意数据格式:
读优化的列存格式(ROFormat): 缺省值为Apache Parquet;
写优化的行存格式(WOFormat): 缺省值为Apache Avro
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-asupbZiT-1654782269037)(C:\Users\Husheng\Desktop\大数据框架学习\image-20220609210931450.png)]](/img/8a/3d47d4d4b72136410d510d32c88758.png)
参考资料:
边栏推荐
- 2022-2-14 learning xiangniuke project - generate verification code
- On a un nom en commun, maître XX.
- LeetCode 513. 找树左下角的值
- Derivation of Fourier transform
- Redis learning (I)
- LeetCode 438. 找到字符串中所有字母异位词
- Sword finger offer II 091 Paint the house
- Discussion on enterprise informatization construction
- CSDN markdown editor help document
- Banner - Summary of closed group meeting
猜你喜欢

Sword finger offer II 091 Paint the house

【点云处理之论文狂读前沿版12】—— Adaptive Graph Convolution for Point Cloud Analysis

Principles of computer composition - cache, connection mapping, learning experience
![[point cloud processing paper crazy reading classic version 8] - o-cnn: octree based revolutionary neural networks for 3D shape analysis](/img/fa/36d28b754a9f380bfd86d4562268c3.png)
[point cloud processing paper crazy reading classic version 8] - o-cnn: octree based revolutionary neural networks for 3D shape analysis

Data mining 2021-4-27 class notes

Education informatization has stepped into 2.0. How can jnpf help teachers reduce their burden and improve efficiency?
![[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points](/img/c1/045ca010b212376dc3e5532d25c654.png)
[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points

【Kotlin疑惑】在Kotlin类中重载一个算术运算符,并把该运算符声明为扩展函数会发生什么?

2022-2-13 learn the imitation Niuke project - Project debugging skills

Utilisation de hudi dans idea
随机推荐
dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article
Liteide is easy to use
Severity code description the project file line prohibits the display of status error c2440 "initialization": unable to convert from "const char [31]" to "char *"
精彩回顾|I/O Extended 2022 活动干货分享
AcWing 785. Quick sort (template)
Notes on numerical analysis (II): numerical solution of linear equations
传统办公模式的“助推器”,搭建OA办公系统,原来就这么简单!
Explanation of the answers to the three questions
Overview of database system
Jenkins learning (I) -- Jenkins installation
网络安全必会的基础知识
【点云处理之论文狂读经典版14】—— Dynamic Graph CNN for Learning on Point Clouds
Spark 结构化流写入Hudi 实践
Serializer rewrite: update and create methods
拯救剧荒,程序员最爱看的高分美剧TOP10
Sword finger offer II 091 Paint the house
数字化转型中,企业设备管理会出现什么问题?JNPF或将是“最优解”
With low code prospect, jnpf is flexible and easy to use, and uses intelligence to define a new office mode
Derivation of Fourier transform
MySQL installation and configuration (command line version)