HBase hierarchical key scan
I want to have hie开发者_如何学编程rarchical keys like: app:page:user:item = value
(where :
indicates concatenating with a delimiter). I understand that I can quickly find all the items that that user modified in the given app:page domain.
But now suppose I just want a list of all the pages in an app (ignoring the stuff at lower levels of the hierarchy). Will I need to scan through every thing in the lower levels of the hierarchy to get what I need?
Yes, unless you also generate records keyed on just the app with values indicating which pages exist in that app. You could do something like that in HBase itself if you have a build with coprocessors, otherwise you need to do it in your application or as a batch process.
Another alternative is to create those records the first time (by scanning all rows in the app) you can the results and save them in the same or another table.
精彩评论