简体   繁体   English

在Hbase中存储列表数据?

[英]Storing List data in Hbase?

Im trying to store a list,collection of data objects in Hbase.我试图在 Hbase 中存储一个列表,数据对象的集合。 For example,a User table where a the userId is the Rowkey and column family Contacts with column Contacts:EmailIds where EmailIds is a list of emails as例如,一个 User 表,其中 userId 是 Rowkey,列族 Contacts 的列为 Contacts:EmailIds,其中 EmailIds 是电子邮件列表

{abcd@example.com,bpqrs@gmail.com....etc}

How do we model this in Hbase?我们如何在Hbase中得到model这个? How do we do this in Java?/Python?Ive tried pickling and unpickling data in Python but this is one solution which I do not want to use due to performance issues.我们如何在 Java 中执行此操作?/Python?我已尝试在 Python 中对数据进行 pickling 和 unpickling,但由于性能问题,这是我不想使用的一种解决方案。

You can use it in the following manner:您可以按以下方式使用它:

| userid | contacts                                              |
| test   | c:email1=test@example.com; c:email2=te.st@example.com |

or要么

| userid | contacts                                              |
| test   | c:test@example.com=1; c:te.st@example.com=2           |

This way you can use versioning, add/remove as much email addresses as you want, use filters, and it is really easy to iterate over these KV pairs in the client code这样你就可以使用版本控制,添加/删除尽可能多的 email 地址,使用过滤器,在客户端代码中迭代这些 KV 对真的很容易

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM