[jira] [Commented] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-25 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8947:
-

Yes Lars. Since Increment doesn't extend Mutation in 0.94, it doesn't support 
Durability. 

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch, HBASE-8947-v4-.094.patch, 
> HBASE-8947-v4.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Commented] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-25 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8947:
-

Thank you [~larsgeorge] for the explanation. It does make sense now :) Updated 
the patches. 

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch, HBASE-8947-v4-.094.patch, 
> HBASE-8947-v4.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-25 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: HBASE-8947-v4-.094.patch

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch, HBASE-8947-v4-.094.patch, 
> HBASE-8947-v4.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-25 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: HBASE-8947-v4.patch

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch, HBASE-8947-v4.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Commented] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-23 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8947:
-

Thank you [~larsgeorge] for reviewing the patch. 
Since 0.94 uses thrift 0.8.0 and trunk uses thrift 0.9.0 I believe clients 
updating to 0.95 or above have to re-generate their thrift files anyways. As 
for numbering thrift fields, I was under the impression that the fields should 
be ordered and a missing field number is not allowed. (i.e can not have 6: 
optional TDurability durability then 5: optional map attributes 
)

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-23 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: (was: HBASE-8947-v3-0.94.patch)

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-23 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: HBASE-8947-v3-0.94.patch

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Commented] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-23 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8947:
-

added 0.94, also test

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-23 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: HBASE-8947-v3-0.94.patch

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3-0.94.patch, HBASE-8947-v3.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-23 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: HBASE-8947-v3.patch

First uploading the easier trunk patch. Added test.

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch, 
> HBASE-8947-v3.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Commented] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-22 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8947:
-

For 0.94 we can drop the default for writeToWAL to avoid sending an extra 
field. I just double checked and for 0.94 
{code}
  private boolean writeToWAL = true;
{code}
writeToWAL get initialized to true , so I suggest we drop default value for 
writeToWAL, add Durability to Mutation (Apparently Increment doesn't support it 
since it doesn't extend Mutation in 0.94), then as you suggested we check for 
isSetDurability, if not set then isSetwriteToWAL and if not set then just don't 
set writeToWAL since it gets initialized to true inside Mutation class. What do 
you think ? Also do we need a test for this ? I wasn't sure how to test it.  

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Commented] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-21 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8947:
-

Well I actually had a default value for TDurability, but then I saw if we don't 
set durability, it defaults to CF durability setting. I found it more efficient 
to not set the default on thrift side because client will be sending an extra 
field (default value) when thrift server doesn't need it. (Defaults is set 
without calling setDurability)

So if you agree I can drop writeToWal for trunk patch and depreciate it for 
0.94 ?

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Commented] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-21 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8947:
-

Made this patch late at night. Thanks for reviewing it [~larsgeorge]. I can 
certainly bring back *writeToWAL* for backwards compatibility. Do we want to 
keep this backward compatibility with 0.95 and 0.98 ? or only 0.94 ? 

Also currently, writeToWal defaults to true when it's not set by user which 
will translate to "Durability.SYNC_WAL". If we were to keep *writeToWAL* I 
suggest we remove the default value, so we can set Durability only when 
writeToWal or TDurability is explicitly set and otherwise default to CF 
Durability setting. What do you think ?

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Assigned] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-21 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani reassigned HBASE-8947:
---

Assignee: Hamed Madani

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-20 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8946:


Attachment: HBASE-8946-v5.patch
HBASE-8946-v5-0.94.patch

Updated the patch (fixed a minor spelling error) also 0.94.

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>Assignee: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch, 
> HBASE-8946-V3.patch, HBASE-8946-v4.patch, HBASE-8946-v5-0.94.patch, 
> HBASE-8946-v5.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Updated] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-20 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8946:


Attachment: HBASE-8946-v4.patch

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch, 
> HBASE-8946-V3.patch, HBASE-8946-v4.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Updated] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-20 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8946:


Attachment: (was: HBASE-8946-v4.patch)

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch, 
> HBASE-8946-V3.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Updated] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-20 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8946:


Attachment: HBASE-8946-v4.patch

I uploaded the new patch with modified comment for closeScanner. I was not sure 
how to address your last comment about the test [~larsgeorge]. As I mentioned 
*scanId* is an undefined value with *getScannerResults* function. However, if 
I'm still missing something please let me know before making 0.94 patch

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch, 
> HBASE-8946-V3.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Commented] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-20 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8946:
-

I actually meant HBASE-8852 and not HBASE-3852 in my previous comment.

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch, 
> HBASE-8946-V3.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Commented] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-20 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8946:
-

The function never returns scanId, it simply returns the results , so I'm not 
sure what I should use in place of *scanId* in
{code}
 try {
  // close scanner and check that it was indeed closed
  handler.closeScanner(scanId);   <--- scanId is 
undefined
  fail("Scanner id should be invalid");
} catch (TIllegalArgument e) {
}
{code}

regarding HBASE-3852, as you mentioned the only time user benefits from closing 
the scanner when it's exhausted, is when the user knows exactly how many rows 
the scanner suppose to return, but doesn't want to get all the results in one 
call (i.e doesn't want to use scannerGetResults). I'm not sure if such a use 
case exists and justifies an additional if statement to all the scanner calls, 
but I could be wrong :)  


> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch, 
> HBASE-8946-V3.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Updated] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-19 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8946:


Attachment: HBASE-8946-V3.patch

Updated the patch with extended test. Also removed the following line from 
hbase.thrift *closeScanner* 
{code}
* Exhausted scanners are closed automatically.
{code}

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch, 
> HBASE-8946-V3.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Commented] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-19 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8946:
-

Great. I am double checking the new patch with the additional tests you 
mentioned.

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Updated] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-19 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8946:


Attachment: HBASE-8946-V2.patch

Updated the patch [~larsgeorge],let me know if this looks good , I can make the 
0.94 then

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Commented] (HBASE-8946) Add a new function to Thrift 2 to open scanner, get results and close scanner

2013-07-19 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8946:
-

Lars, This patch does include the generated file *THBaseService.java* which is 
the only generated file that has changed. 

> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Updated] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8779:


Attachment: HBASE-8779-v2-0.94.patch

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>Assignee: Hamed Madani
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch, HBASE-8779-v2-0.94.patch, HBASE-8779-v2.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Updated] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8779:


Attachment: (was: HBASE-8779-v2-0.94.patch)

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>Assignee: Hamed Madani
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch, HBASE-8779-v2.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Commented] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8779:
-

Uploaded the patch for 0.94

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>Assignee: Hamed Madani
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch, HBASE-8779-v2-0.94.patch, HBASE-8779-v2.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Updated] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8779:


Attachment: HBASE-8779-v2-0.94.patch

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>Assignee: Hamed Madani
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch, HBASE-8779-v2-0.94.patch, HBASE-8779-v2.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Updated] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8779:


Status: Patch Available  (was: Open)

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch, HBASE-8779-v2.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Commented] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8779:
-

I'm on Nodejs, and it does work with nodejs. I haven't tested other clients. 
Uploaded the patch with union for TMutation

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch, HBASE-8779-v2.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Updated] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8779:


Attachment: HBASE-8779-v2.patch

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch, HBASE-8779-v2.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Commented] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8779:
-

alright then I will create a patch with union for TMutation and struc 
TRowMutations

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Commented] (HBASE-8779) Add mutateRow method support to Thrift2

2013-07-17 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8779:
-

It does make sense. I do agree that it is a good idea to keep this close to 
Java API. What do you think about mutateRow ? should we keep *TRowMutations* or 
we can have a mutateRow the way I had it? 

> Add mutateRow method support to Thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Commented] (HBASE-8779) add mutateRow method support to thrift2

2013-07-17 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8779:
-

The reason I suggested to create the TMutation struc the way I did was that it 
makes mutateRow less error prone. TDelete and TPut both can have multiple 
columns, and also a required field for *row*. But the TMutation can not have 
mutiple columns or a row value.

> add mutateRow method support to thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Commented] (HBASE-8779) add mutateRow method support to thrift2

2013-07-17 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8779:
-

Yes, We could also use a union instead of struct . The code will look like this 

{code}
  union TMutation {
1: optional TPut put,
2: optional TDelete deleteSingle,
  }

  void mutateRow(
/** table to apply the mutations */
1: required binary table,

/** row that the mutations get applied to */
2: required binary row,
  
/** list of mutations to apply */
3: required list mutations
  
  ) throws (1: TIOError io)
{code}

digging in thrift documentation , I think that's what the unions are for.  

> add mutateRow method support to thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
>  Labels: thrift2
> Fix For: 0.94.11
>
> Attachments: 0.94.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Commented] (HBASE-8779) add mutateRow method support to thrift2

2013-07-17 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8779:
-

I actually ended up removing TRowMutations struct all together. 

{code}
  /**
   * mutateRow performs multiple mutations atomically on a single row.
  */
  void mutateRow(
/** table to apply the mutations */
1: required binary table,

/** row that the mutations get applied to */
2: required binary row,
  
/** list of mutations to apply */
3: required List mutations
  
  ) throws (1: TIOError io)
{code}

I can create a patch for this if this is approved. 

> add mutateRow method support to thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
> Fix For: 0.94.11
>
> Attachments: 0.94.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Commented] (HBASE-8779) add mutateRow method support to thrift2

2013-07-17 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8779:
-

[~larsgeorge] I moved this under the umbrella issue for Thrift 2.
I did review the patch. *mutateRow* never returns htable to pool. Also uses the 
old table.array(). 
Also I think it will be a better idea to follow thrift 1 for mutation struct. 
the patch suggest to use : 

{code}
struct TMutation {
  1: optional TPut put,
  2: optional TDelete deleteSingle
}
{code}

However I suggest the below struct for TMutation which follows thrift 1 
implementation more closely and I believe is more convenient and efficient. 

{code}
 struct TMutation {
  1: required TColumn column,
  2: optional binary value,
  3: optional bool isDelete = 0,
  4: optional TDeleteType deleteType = 1,
  5: optional TDurability durability,
  6: optional map attributes
}

struct TRowMutations {
  1: required binary row
  2: required List mutations
}
{code}


> add mutateRow method support to thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
> Fix For: 0.94.11
>
> Attachments: 0.94.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Updated] (HBASE-8779) add mutateRow method support to thrift2

2013-07-17 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8779:


Issue Type: Sub-task  (was: New Feature)
Parent: HBASE-8818

> add mutateRow method support to thrift2
> ---
>
> Key: HBASE-8779
> URL: https://issues.apache.org/jira/browse/HBASE-8779
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: duanhongyi
> Fix For: 0.94.11
>
> Attachments: 0.94.patch
>
>
> examples py:
> TPut put = TPut()
> m1 = TMutation(put=put)
> TDelete single_delete = TDelete()
> m2 = TMutation(singleDelete=single_delete)
> row_mu = TRowMutations(row,[m1,m2])
> thbase_service.mutateRow(table,row_mu)  # atomically on a single row

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-14 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: HBASE-8947-v2.patch

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
> Attachments: HBASE-8947.patch, HBASE-8947-v2.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-14 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: (was: HBASE-8947-v2.patch)

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
> Attachments: HBASE-8947.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-14 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: HBASE-8947-v2.patch

Missed FSYNC_WAL. Updated the patch and Added FSYNC_WAL to TDurability enum. 

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
> Attachments: HBASE-8947.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Created] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-14 Thread Hamed Madani (JIRA)
Hamed Madani created HBASE-8947:
---

 Summary: Thrift 2 : Replace "bool writeToWAL" with "TDurability 
durability" 
 Key: HBASE-8947
 URL: https://issues.apache.org/jira/browse/HBASE-8947
 Project: HBase
  Issue Type: Sub-task
Reporter: Hamed Madani
 Attachments: HBASE-8947.patch

Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-14 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Attachment: HBASE-8947.patch

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
> Attachments: HBASE-8947.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Updated] (HBASE-8947) Thrift 2 : Replace "bool writeToWAL" with "TDurability durability"

2013-07-14 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8947:


Status: Patch Available  (was: Open)

> Thrift 2 : Replace "bool writeToWAL" with "TDurability durability" 
> ---
>
> Key: HBASE-8947
> URL: https://issues.apache.org/jira/browse/HBASE-8947
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
> Attachments: HBASE-8947.patch
>
>
> Introduce new enum *TDurability* to expose more options for *Write To Wal.* 

--
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


[jira] [Commented] (HBASE-8946) add a new function to thrift 2 to open scanner, get results and close scanner

2013-07-14 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8946:
-

[~larsgeorge] The attached patch also reformat code style in 
*ThriftHBaseServiceHandler* to wrap lines longer than 100 characters. If this 
is approved, I can make the patch for 0.94.

> add a new function to thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Created] (HBASE-8946) add a new function to thrift 2 to open scanner, get results and close scanner

2013-07-14 Thread Hamed Madani (JIRA)
Hamed Madani created HBASE-8946:
---

 Summary: add a new function to thrift 2 to open scanner, get 
results and close scanner
 Key: HBASE-8946
 URL: https://issues.apache.org/jira/browse/HBASE-8946
 Project: HBase
  Issue Type: Sub-task
  Components: Thrift
Reporter: Hamed Madani
 Attachments: HBASE-8946.patch

We found, very often we open a scanner , get x number of rows , then close the 
scanner immediately. The attached patch , add a new function 
*getScannerResults* that does just that. 

Using getScannerResults function reduce number of calls to thrift server. Also 
since the scanner gets closed immediately, it is less prone to cause memory 
leak. 

--
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


[jira] [Updated] (HBASE-8946) add a new function to thrift 2 to open scanner, get results and close scanner

2013-07-14 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8946:


Status: Patch Available  (was: Open)

> add a new function to thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Updated] (HBASE-8946) add a new function to thrift 2 to open scanner, get results and close scanner

2013-07-14 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8946:


Attachment: HBASE-8946.patch

> add a new function to thrift 2 to open scanner, get results and close scanner
> -
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8946.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close 
> the scanner immediately. The attached patch , add a new function 
> *getScannerResults* that does just that. 
> Using getScannerResults function reduce number of calls to thrift server. 
> Also since the scanner gets closed immediately, it is less prone to cause 
> memory leak. 

--
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


[jira] [Updated] (HBASE-8938) Thrift2 does not close scanner instance

2013-07-13 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8938:


Status: Patch Available  (was: Open)

> Thrift2 does not close scanner instance
> ---
>
> Key: HBASE-8938
> URL: https://issues.apache.org/jira/browse/HBASE-8938
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.94.0
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8938-0.94.patch, HBASE-8938.patch
>
>
> closeScanner at *ThriftHBaseServiceHandler* simply remove scannerId from 
> internal map, but fails to close the scanner instance. 
> {code}
>   public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, 
> TException {
> if (removeScanner(scannerId) == null) {
>   TIllegalArgument ex = new TIllegalArgument();
>   ex.setMessage("Invalid scanner Id");
>   throw ex;
> }
>   }
> {code}

--
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


[jira] [Commented] (HBASE-7035) thrift server closes HTable of open Scanners

2013-07-13 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-7035:
-

looking at *htablePool.java*, I don't think it's necessary to change 
closeTable() function. Both table.close() and htablePool.putTable(table) are 
calling returnTable(). from what I see putTable() is deprecated. 

> thrift server closes HTable of open Scanners
> 
>
> Key: HBASE-7035
> URL: https://issues.apache.org/jira/browse/HBASE-7035
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.94.4
>Reporter: Devin Bayer
>  Labels: thrift2
> Attachments: old-hbase-thrift-v1.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> ThriftHBaseServiceHandler.openScanner() does this:
> 1. table = pool.getTable()
> 2. scanner = table.getScanner()
> 3. table.close()
> 4. return scanner
> While back porting the thrift server to 0.92.6, I found that table.close() 
> calls connection.close(). Further calls to scanner.next() raise a 
> ConnectionClosed exception. The unit tests do not catch this since they reuse 
> an open HConnection instance.
> This might work on trunk, but depends on the implementations of HTablePool, 
> HTable and HConnectionManager. Even with the pool wrapper, if the pool is 
> full, table.close() may be called, which may invalidate the table. Also,  
> HTable is not thread-safe, but they are being reused since they go back in 
> the pool.
> I suggest storing the table handle along with the scanner.

--
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


[jira] [Commented] (HBASE-8938) Thrift2 does not close scanner instance

2013-07-12 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8938:
-

>From what I understand , removing the scanner reference from internal map wont 
>close the scanner instance itself. Maybe I'm wrong , but I thought 
>scanner.close() has to be called to free resources. Looking at thrift 1 
>closeScanner function , scanner.close() gets called before removing the 
>scannerId from internal map.

> Thrift2 does not close scanner instance
> ---
>
> Key: HBASE-8938
> URL: https://issues.apache.org/jira/browse/HBASE-8938
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.94.0
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8938-0.94.patch, HBASE-8938.patch
>
>
> closeScanner at *ThriftHBaseServiceHandler* simply remove scannerId from 
> internal map, but fails to close the scanner instance. 
> {code}
>   public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, 
> TException {
> if (removeScanner(scannerId) == null) {
>   TIllegalArgument ex = new TIllegalArgument();
>   ex.setMessage("Invalid scanner Id");
>   throw ex;
> }
>   }
> {code}

--
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


[jira] [Updated] (HBASE-8938) Thrift2 does not close scanner instance

2013-07-12 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8938:


Labels: thrift2  (was: )

> Thrift2 does not close scanner instance
> ---
>
> Key: HBASE-8938
> URL: https://issues.apache.org/jira/browse/HBASE-8938
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.94.0
>Reporter: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE-8938-0.94.patch, HBASE-8938.patch
>
>
> closeScanner at *ThriftHBaseServiceHandler* simply remove scannerId from 
> internal map, but fails to close the scanner instance. 
> {code}
>   public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, 
> TException {
> if (removeScanner(scannerId) == null) {
>   TIllegalArgument ex = new TIllegalArgument();
>   ex.setMessage("Invalid scanner Id");
>   throw ex;
> }
>   }
> {code}

--
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


[jira] [Updated] (HBASE-8938) Thrift2 does not close scanner instance

2013-07-12 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8938:


Attachment: HBASE-8938-0.94.patch

> Thrift2 does not close scanner instance
> ---
>
> Key: HBASE-8938
> URL: https://issues.apache.org/jira/browse/HBASE-8938
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.94.0
>Reporter: Hamed Madani
> Attachments: HBASE-8938-0.94.patch, HBASE-8938.patch
>
>
> closeScanner at *ThriftHBaseServiceHandler* simply remove scannerId from 
> internal map, but fails to close the scanner instance. 
> {code}
>   public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, 
> TException {
> if (removeScanner(scannerId) == null) {
>   TIllegalArgument ex = new TIllegalArgument();
>   ex.setMessage("Invalid scanner Id");
>   throw ex;
> }
>   }
> {code}

--
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


[jira] [Updated] (HBASE-8938) Thrift2 does not close scanner instance

2013-07-12 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8938:


Attachment: HBASE-8938.patch

> Thrift2 does not close scanner instance
> ---
>
> Key: HBASE-8938
> URL: https://issues.apache.org/jira/browse/HBASE-8938
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.94.0
>Reporter: Hamed Madani
> Attachments: HBASE-8938.patch
>
>
> closeScanner at *ThriftHBaseServiceHandler* simply remove scannerId from 
> internal map, but fails to close the scanner instance. 
> {code}
>   public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, 
> TException {
> if (removeScanner(scannerId) == null) {
>   TIllegalArgument ex = new TIllegalArgument();
>   ex.setMessage("Invalid scanner Id");
>   throw ex;
> }
>   }
> {code}

--
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


[jira] [Created] (HBASE-8938) Thrift2 does not close scanner instance

2013-07-12 Thread Hamed Madani (JIRA)
Hamed Madani created HBASE-8938:
---

 Summary: Thrift2 does not close scanner instance
 Key: HBASE-8938
 URL: https://issues.apache.org/jira/browse/HBASE-8938
 Project: HBase
  Issue Type: Sub-task
  Components: Thrift
Affects Versions: 0.94.0
Reporter: Hamed Madani


closeScanner at *ThriftHBaseServiceHandler* simply remove scannerId from 
internal map, but fails to close the scanner instance. 

{code}
  public void closeScanner(int scannerId) throws TIOError, TIllegalArgument, 
TException {
if (removeScanner(scannerId) == null) {
  TIllegalArgument ex = new TIllegalArgument();
  ex.setMessage("Invalid scanner Id");
  throw ex;
}
  }
{code}

--
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


[jira] [Commented] (HBASE-8832) Ensure HBASE-4658 is supported by Thrift 2

2013-07-11 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8832:
-

Thank you.[~larsgeorge], Yes that is what I did , since I didn't want to 
overwrite my working thrift 0.9.0. Please do double check the 0.94. Creating 
the patch for 0.94 wasn't as trivial as I thought it would be. 

> Ensure HBASE-4658  is supported by Thrift 2
> ---
>
> Key: HBASE-8832
> URL: https://issues.apache.org/jira/browse/HBASE-8832
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>Assignee: Hamed Madani
>  Labels: thrift2
> Fix For: 0.98.0, 0.95.2, 0.94.10
>
> Attachments: HBASE_8832-0.94.patch, HBASE_8832.patch, 
> HBASE_8832-v2.patch
>
>
> HBASE-4658 adds support for "attributes" for certain operations. Make sure 
> Thrift 2 supports them where ever available in the native API.

--
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


[jira] [Updated] (HBASE-8832) Ensure HBASE-4658 is supported by Thrift 2

2013-07-11 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8832:


Attachment: HBASE_8832-0.94.patch

created the patch for 0.94. Since Increment did not extend 
OperationWithAttributes , did not add attributes to Increment.

> Ensure HBASE-4658  is supported by Thrift 2
> ---
>
> Key: HBASE-8832
> URL: https://issues.apache.org/jira/browse/HBASE-8832
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>Assignee: Hamed Madani
>  Labels: thrift2
> Fix For: 0.98.0, 0.95.2, 0.94.10
>
> Attachments: HBASE_8832-0.94.patch, HBASE_8832.patch, 
> HBASE_8832-v2.patch
>
>
> HBASE-4658 adds support for "attributes" for certain operations. Make sure 
> Thrift 2 supports them where ever available in the native API.

--
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


[jira] [Commented] (HBASE-8832) Ensure HBASE-4658 is supported by Thrift 2

2013-07-11 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8832:
-

Sure , since this is my first time creating a patch for 0.94, should I checkout 
from "http://svn.apache.org/repos/asf/hbase/branches/0.94/"; ?
I'm installing thrift 0.8.0

> Ensure HBASE-4658  is supported by Thrift 2
> ---
>
> Key: HBASE-8832
> URL: https://issues.apache.org/jira/browse/HBASE-8832
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>Assignee: Hamed Madani
>  Labels: thrift2
> Fix For: 0.98.0, 0.95.2, 0.94.10
>
> Attachments: HBASE_8832.patch, HBASE_8832-v2.patch
>
>
> HBASE-4658 adds support for "attributes" for certain operations. Make sure 
> Thrift 2 supports them where ever available in the native API.

--
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


[jira] [Updated] (HBASE-8832) Ensure HBASE-4658 is supported by Thrift 2

2013-07-09 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8832:


Attachment: HBASE_8832.patch

Added attribute to Scan , Delete , Get and Increment. Also fixed a minor bug in 
getFromThrift() . When "Get" did not have any columns , function used to return 
without parsing filterString. 

> Ensure HBASE-4658  is supported by Thrift 2
> ---
>
> Key: HBASE-8832
> URL: https://issues.apache.org/jira/browse/HBASE-8832
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>  Labels: thrift2
> Attachments: HBASE_8832.patch
>
>
> HBASE-4658 adds support for "attributes" for certain operations. Make sure 
> Thrift 2 supports them where ever available in the native API.

--
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


[jira] [Updated] (HBASE-8832) Ensure HBASE-4658 is supported by Thrift 2

2013-07-09 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8832:


Status: Patch Available  (was: Open)

> Ensure HBASE-4658  is supported by Thrift 2
> ---
>
> Key: HBASE-8832
> URL: https://issues.apache.org/jira/browse/HBASE-8832
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>  Labels: thrift2
> Attachments: HBASE_8832.patch
>
>
> HBASE-4658 adds support for "attributes" for certain operations. Make sure 
> Thrift 2 supports them where ever available in the native API.

--
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


[jira] [Commented] (HBASE-8832) Ensure HBASE-4658 is supported by Thrift 2

2013-07-09 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8832:
-

Sure, I've been busy lately , I forgot to upload this. I'm going to add a test 
and upload the patch by tonight.

> Ensure HBASE-4658  is supported by Thrift 2
> ---
>
> Key: HBASE-8832
> URL: https://issues.apache.org/jira/browse/HBASE-8832
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>  Labels: thrift2
>
> HBASE-4658 adds support for "attributes" for certain operations. Make sure 
> Thrift 2 supports them where ever available in the native API.

--
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


[jira] [Commented] (HBASE-8819) Port HBASE-5428 to Thrift 2

2013-07-08 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8819:
-

Thank you [~larsgeorge]. The patch looks good.

> Port HBASE-5428 to Thrift 2
> ---
>
> Key: HBASE-8819
> URL: https://issues.apache.org/jira/browse/HBASE-8819
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>Assignee: Lars George
>  Labels: thrift2
> Fix For: 0.98.0, 0.95.2
>
> Attachments: HBASE-8819-0.94.patch, HBASE-8819.patch
>
>
> HBASE-5428 adds loading filters at start up. Needs to be added in Thrift 2 as 
> well.

--
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


[jira] [Commented] (HBASE-8852) Close scanners when at end in Thrift 2

2013-07-05 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8852:
-

I found most of our scan calls to thrift usually involves opening a scanner , 
getting results and closing the scanner immediately. This could be very 
specific to our use case but I ended up adding a new function to thrift2 server 
to open scanner , get results and close the scanner all in one function. so 
Instead of 3 calls to thrift (openScanner , getScannerRows, closeScanner), we 
just call a new function "getScannerResults" to open scanner , get x number of 
rows, then close scanner all with only one call to thrift server.

If you also think, others might find a new function like this useful , I can 
make a patch. 
 

> Close scanners when at end in Thrift 2
> --
>
> Key: HBASE-8852
> URL: https://issues.apache.org/jira/browse/HBASE-8852
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>  Labels: thrift2
>
> HBASE-6073 adds the following to the overall patch:
> {code}
> -  return resultsFromHBase(scanner.next(numRows));
> +  List results = resultsFromHBase(scanner.next(numRows));
> +  if(results.size() < numRows) {
> +removeScanner(scannerId);
> +  }
> +  return results;
> {code}
> We need to see if we have to add this to Thrift2 as separate patch.

--
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


[jira] [Commented] (HBASE-8876) Addendum to HBASE-8774 Add BatchSize and Filter to Thrift2 - Add BatchSize Test

2013-07-05 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8876:
-

Looks great [~larsgeorge] Thanks for sharing.

> Addendum to HBASE-8774 Add BatchSize and Filter to Thrift2 - Add BatchSize 
> Test
> ---
>
> Key: HBASE-8876
> URL: https://issues.apache.org/jira/browse/HBASE-8876
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>Assignee: Lars George
>  Labels: thrift2
> Fix For: 0.98.0, 0.95.2, 0.94.10
>
> Attachments: HBASE-8876-0.94.patch, HBASE-8876.patch
>
>
> HBASE-8774 adds support for batching through large rows. A unit test was 
> missing though, which is added here. Further cleanup as well, to test scan, 
> scan with filter, and scan with batch size separately.

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-07-02 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

If I'm not mistaken , 0.94 uses thrift 0.8.0. And that might be why this patch 
fails. I can install thrift 0.8.0 tomorrow, and create a patch for 0.94.

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch, 
> HBASE_8774_v3.patch, HBASE_8774_v4.patch, HBASE_8774_v5.patch, 
> HBASE_8774_v5.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8823) Ensure HBASE-7826 is covered by Thrift 2

2013-07-02 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8823:
-

[~larsgeorge] As far as I undrestand , since thrift2 stores it's results in 
List,  results are sorted.

from *ThriftUtilities.java*
{code}
  public static List resultsFromHBase(Result[] in) {
List out = new ArrayList(in.length);
for (Result result : in) {
  out.add(resultFromHBase(result));
}
return out;
  }
{code} 

> Ensure HBASE-7826 is covered by Thrift 2
> 
>
> Key: HBASE-8823
> URL: https://issues.apache.org/jira/browse/HBASE-8823
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>  Labels: thrift2
>
> HBASE-7826 is about sorted results, we need to check if Thrift 2 handles this 
> as well.

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-07-02 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

Thank you [~larsgeorge] for reviewing this patch. Updated the patch and removed 
the line you mentioned.

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch, 
> HBASE_8774_v3.patch, HBASE_8774_v4.patch, HBASE_8774_v5.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Updated] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-07-02 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8774:


Attachment: HBASE_8774_v5.patch

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch, 
> HBASE_8774_v3.patch, HBASE_8774_v4.patch, HBASE_8774_v5.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Updated] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-07-01 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8774:


Attachment: HBASE_8774_v4.patch

I was not sure how to test scan batchSize. The updated patch test filterString.

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch, 
> HBASE_8774_v3.patch, HBASE_8774_v4.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-07-01 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

well I don't feel confident enough to take on HBASE-8840 yet. but I can 
certainly try to add to TestThriftHBaseServiceHandler.testScan() or create a 
new test for testing batchSize and filterString.

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch, 
> HBASE_8774_v3.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-29 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

Thank you [~larsgeorge], you are right about the Text type. I doubled check and 
as you suggested, changed filterString type to binary. updated the patch

As for HBASE-8832 , I have to wait for this patch to get applied to trunk 
because, I have added "attribute" to struct definitions in hbase.thrift file 
and if we apply this patch, we have to create a new patch for HBASE-8832 with 
new numbering in hbase.thrift file. To clarify, if I create a patch for 
"attribute" right now the TScan struct's number for "attribute" will be *7*, 
but if I create the HBASE-8832 patch after applying HBASE-8774 patch , the 
"attribute" number will be "*9:* optional map attributes"
{code}
struct TScan {
  1: optional binary startRow,
  2: optional binary stopRow,
  3: optional list columns
  4: optional i32 caching,
  5: optional i32 maxVersions=1,
  6: optional TTimeRange timeRange,
 *7:* optional binary filterString,
 *8:* optional i32 batchSize
}
{code}

I did not apply formatting to generated files (hence lines longer than 100 
characters) because if I apply formatting to these files , it will make 
applying the future patches to these auto-generated files non-trivial. If you 
like me to apply formatting to generated files , please let me know. ( 
formatting I mentioned for patch_v2 was for *ThriftUtilities.java*)

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch, 
> HBASE_8774_v3.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Updated] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-29 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8774:


Attachment: HBASE_8774_v3.patch

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch, 
> HBASE_8774_v3.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-28 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

Hi [~larsgeorge], I have added attribute to scan , get , delete , increment and 
put. do you want me to update this patch or make a new one base on current 
trunk ?

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Lars George
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Updated] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-28 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8774:


Attachment: HBASE_8774_v2.patch

Re-generate TScan and TGet files with Thrift 0.9. Updated formatting as well.

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Lars George
>  Labels: thrift2
> Attachments: HBASE_8774.patch, HBASE_8774_v2.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-28 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

Do you want me to create a patch out of HBASE-6073 to close the scanner when 
there are no result or do you think with HBASE-3852, that's unnecessary ? I 
added a third parameter to getScannerRows to close the scanner as soon as it 
gets the result. I understand that introducing a third parameter might be very 
specific to our use case, that's why I did not create a patch for it. What do 
you think about it?

{code}
  public List getScannerRows(int scannerId, int numRows, boolean once) 
throws TIOError,
  TIllegalArgument, TException {
ResultScanner scanner = getScanner(scannerId);
if (scanner == null) {
  TIllegalArgument ex = new TIllegalArgument();
  ex.setMessage("Invalid scanner Id");
  throw ex;
}

try {
  List result = resultsFromHBase(scanner.next(numRows));
  if (once) {
removeScanner(scannerId);
  }
  return result;
} catch (IOException e) {
  throw getTIOError(e);
}
  }
{code}

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Lars George
>  Labels: thrift2
> Attachments: HBASE_8774.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8830) Port HBASE-7757 to Thrift 2

2013-06-28 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8830:
-

[~larsgeorge] HBASE-7757 adds the UI to Thrift2 as well.


> Port HBASE-7757 to Thrift 2
> ---
>
> Key: HBASE-8830
> URL: https://issues.apache.org/jira/browse/HBASE-8830
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Reporter: Lars George
>  Labels: thrift2
>
> HBASE-7757 adds a UI to the Thrift server. We need to add the same to Thrift 
> 2, ideally reusing code.

--
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


[jira] [Commented] (HBASE-3307) Add checkAndPut to the Thrift API

2013-06-28 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-3307:
-

[~larsgeorge] from what I can see Thrift2 has this feature.
*ThriftHBaseServiceHandler.java*

{code}
  @Override
  public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer 
family,
  ByteBuffer qualifier, ByteBuffer value, TPut put) throws TIOError, 
TException {
HTableInterface htable = getTable(table);
try {
  return htable.checkAndPut(byteBufferToByteArray(row), 
byteBufferToByteArray(family),
byteBufferToByteArray(qualifier), (value == null) ? null : 
byteBufferToByteArray(value),
putFromThrift(put));
} catch (IOException e) {
  throw getTIOError(e);
} finally {
  closeTable(htable);
}
  }
{code}

> Add checkAndPut to the Thrift API
> -
>
> Key: HBASE-3307
> URL: https://issues.apache.org/jira/browse/HBASE-3307
> Project: HBase
>  Issue Type: Sub-task
>  Components: Thrift
>Affects Versions: 0.89.20100924
>Reporter: Chris Tarnas
>Priority: Minor
>  Labels: thrift2
>
> It would be very useful to have the checkAndPut method available via the 
> Thrift API. This would both allow for easier atomic updates as well as cut 
> down on at least one Thrift roundtrip for quite a few common tasks. 

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-27 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

If you like me to use HBASE-6073 approach for this patch, I can modify the 
patch. Please let me know what you think.  

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: New Feature
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE_8774.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-26 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

Yes Lars. The reason I followed HBASE-4176 was , it made it easier for us to 
move from thrift1 to thrift2. Also it has been tested before with folks running 
thrift1. Moreover, from what I understand from HBASE-6073 it seems 

{code}
 * Specify boolean operator for TFilterList:
 *  - MUST_PASS_ALL means AND boolean operation
 *  - MUST_PASS_ONE means OR boolean operation
 */
enum TFilterListOperator {
  MUST_PASS_ALL = 0,
  MUST_PASS_ONE = 1
}

/**
* Represents a server side filter list
*
*/
struct TFilterList {
+  1: required TFilterListOperator operator,
  2: required list filters
}
{code}

limits you to either *AND* all filters or *OR* all of them. Whereas with 
HBASE-4176 you can have something like “(Filter1 AND Filter2) OR Filter3"
There is also HBASE-6073 close the scanner when the scanner doesn't have any 
more results to return. I can certainly merge the two to include this feature. 
Let me know what you think.

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: New Feature
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE_8774.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-25 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8774:
-

Yes Lars, this patch is complete. It adds filterString to both Scan and Get 
also adds BatchSize to Scan.
However there is a difference between this patch and HBASE-6073. This patch 
simply adds filterString to Scan and Get object identical to what already 
exists in Thrift1. HBASE-6073 create a new schema called TFilterList and 
TFilter and use that new schema instead. 

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: New Feature
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE_8774.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-25 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Attachment: HBASE_8782_v4.patch

> 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
>Assignee: Hamed Madani
> Attachments: HBASE_8782.patch, HBASE_8782_v2.patch, 
> HBASE_8782_v3.patch, HBASE_8782_v4.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()
> UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
> *getBytes()* , also removed unused imports.

--
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


[jira] [Commented] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-25 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8782:
-

Thank you Lars. I have already attached the new patch with modified getTable(). 
I am also working on bringing Append() function to thrift2. Will open a new 
issue for that, once it's ready.

> 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
>Assignee: Hamed Madani
> Attachments: HBASE_8782.patch, HBASE_8782_v2.patch, 
> HBASE_8782_v3.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()
> UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
> *getBytes()* , also removed unused imports.

--
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


[jira] [Assigned] (HBASE-8774) Add BatchSize and Filter to Thrift2

2013-06-25 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani reassigned HBASE-8774:
---

Assignee: Hamed Madani

> Add BatchSize and Filter to Thrift2
> ---
>
> Key: HBASE-8774
> URL: https://issues.apache.org/jira/browse/HBASE-8774
> Project: HBase
>  Issue Type: New Feature
>  Components: Thrift
>Affects Versions: 0.95.1
>Reporter: Hamed Madani
>Assignee: Hamed Madani
> Attachments: HBASE_8774.patch
>
>
> Attached Patch will add BatchSize and Filter support to Thrift2

--
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


[jira] [Commented] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-25 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8782:
-

Updated the patch. Also Thank you Lars George for supporting Thrift2. It's much 
nicer to work with and expand. 

> 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
>Assignee: Hamed Madani
> Attachments: HBASE_8782.patch, HBASE_8782_v2.patch, 
> HBASE_8782_v3.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()
> UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
> *getBytes()* , also removed unused imports.

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-25 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Attachment: HBASE_8782_v3.patch

> 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, HBASE_8782_v2.patch, 
> HBASE_8782_v3.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()
> UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
> *getBytes()* , also removed unused imports.

--
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


[jira] [Commented] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-24 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8782:
-

I know it's not relevant to above issue , but would you please also have a look 
at HBASE-8774 (Adds filter support to Scan and Get also batchSize to Scan for 
Thrift2). I'm willing to change or improve that patch if necessary. 

> 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, HBASE_8782_v2.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()
> UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
> *getBytes()* , also removed unused imports.

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-24 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Description: 
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()
UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
*getBytes()* , also removed unused imports.

  was:
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()
UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
*getBytes()*


> 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, HBASE_8782_v2.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()
> UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
> *getBytes()* , also removed unused imports.

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-24 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Description: 
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()
UPDATE: updated the patch to use 

  was:
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()


> 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, HBASE_8782_v2.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()
> UPDATE: updated the patch to use 

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-24 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Description: 
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()
UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
*getBytes()*

  was:
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()
UPDATE: updated the patch to use 


> 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, HBASE_8782_v2.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()
> UPDATE: updated the patch to use *byteBufferToByteArray()* instead of 
> *getBytes()*

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-24 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Attachment: HBASE_8782_v2.patch

Updated Version with byteBufferToByteArray() instead of getBytes() also cleaned 
up imports

> 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, HBASE_8782_v2.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


[jira] [Commented] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-24 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8782:
-

Well from what I understand ByteBuffer.array() returns the internal array of 
the buffer. But getBytes() return a new subset of internal array. getBytes() 
extract this small array by looking at position and limit variables of 
byteBuffer. With Binary protocol ByteBuffer.readBinary() returns a new 
ByteBuffer with a small internal array. (position=0, size= "size of our useful 
data). With framed transport, however, ByteBuffer.readBinary() returns the 
original *trans_* array, but with new *position* and *limit* variables. so 
internal arrays with framed transport are very large containing all the data in 
one connection. 

As for solution, my first solution to avoid copying the array was to modify 
HtableInterface to accept ByteBuffer as input and separately take care of other 
cases in checkAndPut() and checkAndDelete(). However, I can see that means 
adding to HTableInterface!

I found *org.apache.thrift.TBaseHelper.byteBufferToByteArray* to be a more 
efficient function for this use case that Bytes.getBytes(). 

{code}
  public static byte[] byteBufferToByteArray(ByteBuffer byteBuffer) {
if (wrapsFullArray(byteBuffer)) {
  return byteBuffer.array();
}
byte[] target = new byte[byteBuffer.remaining()];
byteBufferToByteArray(byteBuffer, target, 0);
return target;
  }

  public static boolean wrapsFullArray(ByteBuffer byteBuffer) {
return byteBuffer.hasArray()
  && byteBuffer.position() == 0
  && byteBuffer.arrayOffset() == 0
  && byteBuffer.remaining() == byteBuffer.capacity();
  }

  public static int byteBufferToByteArray(ByteBuffer byteBuffer, byte[] target, 
int offset) {
int remaining = byteBuffer.remaining();
System.arraycopy(byteBuffer.array(),
byteBuffer.arrayOffset() + byteBuffer.position(),
target,
offset,
remaining);
return remaining;
  }

{code}   

the above function is more efficient because for binary protocol it simply 
returns the inner array with .array() and for framed protocol it uses 
system.arraycopy rather than a for loop to copy the elements. Also above 
function avoids byteBuffer.duplicate().

If you also think this is a better alternative than getBytes() I can make a new 
patch using byteBufferToByteArray() instead of getBytes();

> 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


[jira] [Commented] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-23 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8782:
-

Well, I did more digging and found exactly why with framed transport I had to 
change ByteBuffer.array() to Bytes.getBytes();

{code}
  public ByteBuffer readBinary() throws TException {
int size = readI32();
checkReadLength(size);

if (trans_.getBytesRemainingInBuffer() >= size) {
  ByteBuffer bb = ByteBuffer.wrap(trans_.getBuffer(), 
trans_.getBufferPosition(), size);
  trans_.consumeBuffer(size);
  return bb;
}

byte[] buf = new byte[size];
trans_.readAll(buf, 0, size);
return ByteBuffer.wrap(buf);
  }
{code}

when using framed transport , above function returns a buffer with the same 
size of the trans_.getBuffer() and modified 'position' and 'limit' values based 
on 'size' variable. 

However, when using a Binary protocol .getBytesRemainingInBuffer() will return 
-1 and function returns a new buffer with length ='size', position = 0 and 
limit= size. when Binary protocol is used, .array() simply returns this small 
inner array which holds only the relevant bytes, Which is not the case with 
framed transport. 

I added the below function to HtableInterface, so that I can just pass the 
ByteBuffer without using the .getBytes function . Do you think this solution is 
a good idea ? 
{code}
  public HTableInterface getTable(ByteBuffer tableName) {
return getTable(Bytes.toString(tableName.array(), tableName.position(), 
tableName.remaining()));
  }
{code}



> 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


[jira] [Commented] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-23 Thread Hamed Madani (JIRA)

[ 
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


[jira] [Commented] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-21 Thread Hamed Madani (JIRA)

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

Hamed Madani commented on HBASE-8782:
-

Thank you Ted. I'm not sure what you like me to do.
 
Below is what I get *Without this patch* running thrift2 in nonblocking mode 
(trying to scan "my_table" (framed transport))
{code}
org.apache.hadoop.hbase.exceptions.TableNotFoundException: Cannot find row in 
.META. for table: ?
 openScanner
my_table

  @
   @ 

row=\xFF\xBF\xBD\x01\xF0\xF1\x00\x00\xF0\x0BopenScanner\x00\x00\(..many more)
at 
org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:137)
at 
org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:102)
at 
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.prefetchRegionCache(HConnectionManager.java:857)
at 
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:917)
at 
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:809)
at 
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:778)
at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:245)
at org.apache.hadoop.hbase.client.HTable.(HTable.java:186)
at 
org.apache.hadoop.hbase.client.HTableFactory.createHTableInterface(HTableFactory.java:39)
at 
org.apache.hadoop.hbase.client.HTablePool.createHTable(HTablePool.java:270)
at 
org.apache.hadoop.hbase.client.HTablePool.findOrCreateTable(HTablePool.java:200)
at 
org.apache.hadoop.hbase.client.HTablePool.getTable(HTablePool.java:179)
at 
org.apache.hadoop.hbase.client.HTablePool.getTable(HTablePool.java:218)
at 
org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandler.getTable(ThriftHBaseServiceHandler.java:127)
at 
org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandler.openScanner(ThriftHBaseServiceHandler.java:306)
{code}

> 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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-21 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Attachment: HBASE_8782.patch

> 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

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-21 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Description: 
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()

  was: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


> 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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-21 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Description: 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  (was: 
ThriftHBaseServiceHandler.java use .array() on table names which resulted in 
incorrect values for table name with framed transport. Replacing table.array() 
with getBytes(table) fixed this problem. I've attached the patch)

> 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
>
> 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

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-21 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Attachment: (was: HBASE_8782.patch)

> 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
>
> ThriftHBaseServiceHandler.java use .array() on table names which resulted in 
> incorrect values for table name with framed transport. Replacing 
> table.array() with getBytes(table) fixed this problem. I've attached the patch

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse values when using framed transport

2013-06-21 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Summary: Thrift2 can not parse values when using framed transport  (was: 
Thrift2 can not parse table names when using framed transport)

> 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
>
> ThriftHBaseServiceHandler.java use .array() on table names which resulted in 
> incorrect values for table name with framed transport. Replacing 
> table.array() with getBytes(table) fixed this problem. I've attached the patch

--
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


[jira] [Updated] (HBASE-8782) Thrift2 can not parse table names when using framed transport

2013-06-21 Thread Hamed Madani (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-8782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hamed Madani updated HBASE-8782:


Description: ThriftHBaseServiceHandler.java use .array() on table names 
which resulted in incorrect values for table name with framed transport. 
Replacing table.array() with getBytes(table) fixed this problem. I've attached 
the patch  (was: ThriftHBaseServiceHandler.java use .array() on table names 
which resulted to incorrect values for table name with framed transport. 
Replacing table.array() with getBytes(table) fixed this problem. I've attached 
the patch)

> Thrift2 can not parse table names 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 which resulted in 
> incorrect values for table name with framed transport. Replacing 
> table.array() with getBytes(table) fixed this problem. I've attached the patch

--
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


  1   2   >