[
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14370899#comment-14370899
]
Lars George commented on HBASE-13272:
-------------------------------------
Is it really so hard to fix (did not check yet). We already find the proper
row, we just have to only load the columns that was asked for. Could we not
replace this server side with a reverse scan instead and document the slight
penalty? This is _not_ the old {{HTable.getRowOrBefore()}} function, it is a
new thing that was added to Get in HBASE-5162 for some reason (which I missed
to see documented). [~nkeywal] you deprecated the one on HTable, but the latter
is the one that is in question.
I would suggest leaving it, it is handy. But use the reverse scanner and
simplify the code? {{RSRpcServices}} uses this code right now
{code}
byte[] row = get.getRow().toByteArray();
byte[] family = get.getColumn(0).getFamily().toByteArray();
r = region.getClosestRowBefore(row, family);
{code}
which then in turn calls
{code}
Cell key = store.getRowKeyAtOrBefore(row);
{code}
I am not sure what the plan with these methods is, or if the reverse scanner
still needs them.
As an alternative approach, the code does return a row and has that cached now,
why not issuing a subsequent
{code}
if (r != null && !r.isEmpty()) {
Get newGet = new Get(r.getRow());
...
// complicated copy over of all fields from one Get to another since there is
no such method in get....
...
r = region.get(newGet);
}
{code}
Does that cause any issues besides the unnecessary first load of the entire
row? We could change it a little to set the _cjeck for existence only_ flag on
the first call, but looking at HRegion.get() it loads all cells anyways and
then drops them if the flag is set. So nothing gained here?
> Get.setClosestRowBefore() breaks specific column Get
> ----------------------------------------------------
>
> Key: HBASE-13272
> URL: https://issues.apache.org/jira/browse/HBASE-13272
> Project: HBase
> Issue Type: Bug
> Reporter: stack
> Priority: Trivial
>
> Via [~larsgeorge]
> Get.setClosestRowBefore() is breaking a specific Get that specifies a column.
> If you set the latter to "true" it will return the _entire_ row!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)