使用redis时有什么办法可以写入到hbase中
据我所知,redis 只能在二进制文件中进行后写操作。但我们的软件要求是使用任何兼容的分布式映射(redis)写入到 hbase。在使用 redis 时,有什么方法可以写入到 hbase 中。
As far as i know redis only write-behind in a binary file. but our software requirement is to write behind to hbase using any compatible distributed maps(redis).Is there any way while using redis we could write behind to hbase.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无法自定义文件写入的方式。它将写入磁盘,对此您无能为力。
相反,您应该做的是有一个外部计划进程(也许使用 cron)定期获取 Redis 文件,然后将其转储到 HBase 中。
如果适合您的情况和需求,您可以通过几种方法自定义此过程以使其更加健壮:
md5sum
操作。检查md5sum
自上次处理以来是否发生了变化。如果 Redis 实例中的数据不经常更改,这可能很有用。There is no way to customize the way that the file writes. It is going to write to disk and there isn't much you can do about that.
What you should do instead is have an external scheduled process (using cron, perhaps) that periodically takes the Redis file and then dumps it into HBase.
Few ways you can customize this process to be more robust, if it fits your situation and needs:
md5sum
on the file before ingesting it into HBase. Check to see that themd5sum
has changed since the last time you've processed it. This might be useful if the data in your Redis instance isn't changing very often.