[ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13691562#comment-13691562
 ] 

Hamed Madani commented on HBASE-8782:
-------------------------------------

Thank you Lars for looking at the patch. 

I'm new to Hbase development so forgive me if I sound uninformed. Looking at 
the Byte class I can see your concern about performance. As of how I came to 
this conclusion, I could not run thrift2 in nonblocking mode, so I started 
debugging the ThriftHBaseServiceHandler.java. I found when I run thrift2 with 
framed transport, ByteBuffer being passed to functions inside 
ThriftHBaseServiceHandler.java are long Buffers with my data being located 
between limit and position values of the buffer. .array() function simply was 
returning this long array, so the rest of the function could not parse the 
correct values for tables name.  

Thrift 1 works in nonblocking mode so, I looked at thrift 1 and noticed all the 
functions in *ThriftServerRunner.java* are calling getBytes to parse the 
ByteBuffer that is being passed to them. That is why I changed .array() to 
getBytes, just looking at Thrift 1.
                
> Thrift2 can not parse values when using framed transport
> --------------------------------------------------------
>
>                 Key: HBASE-8782
>                 URL: https://issues.apache.org/jira/browse/HBASE-8782
>             Project: HBase
>          Issue Type: Bug
>          Components: Thrift
>    Affects Versions: 0.95.1
>            Reporter: Hamed Madani
>         Attachments: HBASE_8782.patch
>
>
> ThriftHBaseServiceHandler.java use .array() on table names , and values 
> (family , qualifier in checkandDelete , etc) which resulted in incorrect 
> values with framed transport. Replacing .array() with getBytes() fixed this 
> problem. I've attached the patch
> EDIT: updated the patch to cover checkAndPut(), checkAndDelete()

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to