HBase列族 - 在架构定义时声明 - 为什么? [英] HBase column family - declare at schema definition time - Why?

查看:154
本文介绍了HBase列族 - 在架构定义时声明 - 为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HBase-文档提到了在架构定义时声明列族。我不明白为什么?
我知道,该列系列继承了多个列(可以在运行时添加),并且它们映射到存储文件。但是,在运行时不能添加cf的原因是什么?

the HBase-documentation mentions to declare column families at schema definiton time. I don't understand why? I know, that column families inherits multiple columns (that are possible to added at runtime) and they are mapped to the storage files. But for what reasons cf's can not added at runtime?

推荐答案

列族是表的架构的一部分。您可以在运行时通过在线模式更改来添加它们。但是你不会动态地添加它们,你可以动态地在HBase表中创建新的列,如果这是你的想法。

Column families are part of the schema of the table. You can add them at runtime with an online schema change. But you wouldn't add them dynamically the way that you can dynamically create new "columns" in an HBase table, if that's what you had in mind.

原因栏系列是模式的一部分,并且需要更改模式的原因是它们深深地影响了数据存储的方式,无论是在磁盘还是在内存中。每个列族都有自己的一组HFile,并在RegionServer的内存中拥有自己的一组数据结构。动态创建或开始使用新的列系列将会非常昂贵。

The reason column families are part of the schema and would require a schema change is that they profoundly impact the way the data is stored, both on disk and in memory. Each column family has its own set of HFiles, and its own set of data structures in memory of the RegionServer. It would be pretty expensive to dynamically create or start using new column families.

只有当您需要配置不同的表格各个部分时才需要列系列(例如,您希望某些列有TTL而其他列不会过期),或者当您想要控制访问的地点时(如果您希望有良好的性能,一起访问的内容应该最好位于同一列中),因为操作成本会随着操作系统的线性增长列族的数量)。因此,再次,由于这些专门的原因,在运行时动态添加新的列系列是没有意义的,这是您在系列中添加常规列的方式。

Column families are only needed when you need to configure differently various parts of a table (for instance you want some columns to have a TTL and others to not expire), or when you want to control the locality of accesses (things accessed together should better be in the same column family if you want good performance, as the cost of operations grows linearly with the number of column families). So, again, because of those specialized reasons, it doesn't make sense to dynamically add new column families at runtime the way you would add regular "columns" within a family.

这篇关于HBase列族 - 在架构定义时声明 - 为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆