[jira] [Commented] (HBASE-13272) Get.setClosestRowBefore() breaks specific column Get

2015-03-20 Thread Lars George (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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)


[jira] [Commented] (HBASE-13272) Get.setClosestRowBefore() breaks specific column Get

2015-03-20 Thread Nicolas Liochon (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14371234#comment-14371234
 ] 

Nicolas Liochon commented on HBASE-13272:
-

The HTable#getRowOrBefore does a get#setClosestRowBefore(true);
Yeah, I should have deprecated both. I think setClosestRowBefore is really old, 
but may be I'm wrong.



From the code
- It seems it's not used in HBase now
- I have not found a test as well.
- it seems it does not work if you're hitting a region boundary (i.e. the 
closest_row_before is in another region).
- It's limited to single family as well (RSRpcServices.java)
get ClosestRowBefore supports one and only one family now, not 
  + get.getColumnCount() +  families);

I think this can be replaced by the reverseScanner, hopefully reverseScanner 
covers more usages.

My guess is that it leaked getRowOrBefore  was purely internal and got 
deprecated in 0.92:
   * @deprecated As of version 0.92 this method is deprecated without
   * replacement. Since version 0.96+, you can use reversed scan.
   * getRowOrBefore is used internally to find entries in hbase:meta and makes
   * various assumptions about the table (which are true for hbase:meta but not
   * in general) to be efficient.

My guess is that Get#setClosestRowBefore was there only for the meta table and 
has been forgotten on the deprecation path.

Now I'm not against a fix, we're open source :-) and anyway we can't remove the 
feature in less than two hbase releases.
But from the client code point of view using the reverse scanner seems safer. 
imho setClosestRowBefore should be deprecated as soon as possible: very ad-hoc, 
not used in the internal code, not tested, fails on cross boundaries calls, 
fails on multiple families, and this jira as a bounty: these are good reasons 
imho.






 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)


[jira] [Commented] (HBASE-13272) Get.setClosestRowBefore() breaks specific column Get

2015-03-19 Thread Lars George (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14368865#comment-14368865
 ] 

Lars George commented on HBASE-13272:
-

+1 on what [~ndimiduk] suggests. We need to either fix it (it used to work), or 
document/deprecate/remove it.

 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)


[jira] [Commented] (HBASE-13272) Get.setClosestRowBefore() breaks specific column Get

2015-03-19 Thread Nicolas Liochon (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14368872#comment-14368872
 ] 

Nicolas Liochon commented on HBASE-13272:
-

On the other hand if it's broken it's not that useful to keep it :-)

 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)


[jira] [Commented] (HBASE-13272) Get.setClosestRowBefore() breaks specific column Get

2015-03-19 Thread Nicolas Liochon (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14368871#comment-14368871
 ] 

Nicolas Liochon commented on HBASE-13272:
-

I'm +1 for the suppression (I though I deprecated it already, may be I'm wrong 
or I missed some of the interfaces), but it needs to be done carefully: we need 
to keep it on the server/protobuf for a while as we want the old clients to be 
able to speak to the new servers.

 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)


[jira] [Commented] (HBASE-13272) Get.setClosestRowBefore() breaks specific column Get

2015-03-18 Thread Nick Dimiduk (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14368077#comment-14368077
 ] 

Nick Dimiduk commented on HBASE-13272:
--

Sounds like it's best to deprecate/remove.

 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)


[jira] [Commented] (HBASE-13272) Get.setClosestRowBefore() breaks specific column Get

2015-03-18 Thread Nicolas Liochon (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14367886#comment-14367886
 ] 

Nicolas Liochon commented on HBASE-13272:
-

setClosestRowBefore is supersedes by reverse scan, imho? IIRC we don't use it 
internally anymore (the region locator uses the reverse scan).


 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

 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)


[jira] [Commented] (HBASE-13272) Get.setClosestRowBefore() breaks specific column Get

2015-03-18 Thread stack (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14367889#comment-14367889
 ] 

stack commented on HBASE-13272:
---

[~nkeywal] So argument is that we not bother fixing this bug or rather make it 
trivial (let me do that).

 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

 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)