HBase: How to write custom skip filter after 0.96.0?

↘锁芯ラ 提交于 2020-01-13 17:02:18

问题


I am new to HBase. I want to make a custom fuzzy filter in HBase but have been having great difficulty finding any resources to explain the proper way to do so in java. The only examples I've found seems to use a version of HBase in which FilterBase supplies different functions, as do all source codes for existing filters which I can find. (0.94.0 I think)

More specifically, I found this code for FuzzyRowFilter which I would like to slightly modify. However, as seen here, functions like filterKeyValue, write, and readFiles are not part of FilterBase anymore? If I paste said FuzzyRowFilter code into my Eclipse project, I get notices that those three functions aren't being inherited.

Could someone please explain how one is supposed to make a custom row-skipping filter in the current HBase? What is the flow of the code? I'm using 0.96.0 (but the FilterBase that's part of it seems to match the linked 0.99.0 documentation)

EDIT:

Based on this blog post, I take it that write and readFiles from 0.94 are simply not needed in 0.96, and after a lot of digging I found that I instead need to use "parseFrom" and "toByteArray". Using these methods prevents any errors from coming, but I still don't understand how to properly use them, as my filter doesn't seem to ever begin. (as far as I can tell, only toByteArray is getting called, and never parseFrom)

I'm guessing there's something wrong with my understanding of the filter+protobuf structure, so the original question remains.

来源:https://stackoverflow.com/questions/24923407/hbase-how-to-write-custom-skip-filter-after-0-96-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!