[ 
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

Reply via email to