[
https://issues.apache.org/jira/browse/HBASE-4720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169164#comment-13169164
]
Mubarak Seyed commented on HBASE-4720:
--------------------------------------
Stack,
Option 1:
If we send ?check=true then client can send value to check and value-to-check
as part of URI like
PUT or POST
/table/<row>/<column>:<qualifier> ?(/<check:true>) ?(/<value-to-check>)
?(/<timestamp>)
(with Put object as content)
Delete on RowResource uses only request-URI and there is no way to get
CellSetModel (which holds the content of Delete object, as part of
checkAndDelete API). If we go by HTTP @Delete method then how do we send the
entity-body (content)? Ref:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7
Can we treat checkAndDelete as HTTP PUT or POST operation and send the Delete
object content as entity-body?
so, the request URI would look like
checkAndPut: PUT (or) POST /table/<row>/<column>:<qualifier>
?(/<checkandput:true>) ?(/<value-to-check>) ?(/<timestamp>)
checkAndDelete: PUT (or) POST /table/<row>/<column>:<qualifier>
?(/<checkanddelete:true>) ?(/<value-to-check>) ?(/<timestamp>)
we can make use of put or post in RowResource and refactor the put()/post()
code to handle both put/checkAndPut and delete/checkAndDelete.
Option 2:
If we dont want to refactor the RowResource code, we can create new resource
(such as /checkandput and /checkanddelete) then we can append the
/table/<row>/... convention
> Implement atomic update operations (checkAndPut, checkAndDelete) for REST
> client/server
> ----------------------------------------------------------------------------------------
>
> Key: HBASE-4720
> URL: https://issues.apache.org/jira/browse/HBASE-4720
> Project: HBase
> Issue Type: Improvement
> Reporter: Daniel Lord
>
> I have several large application/HBase clusters where an application node
> will occasionally need to talk to HBase from a different cluster. In order
> to help ensure some of my consistency guarantees I have a sentinel table that
> is updated atomically as users interact with the system. This works quite
> well for the "regular" hbase client but the REST client does not implement
> the checkAndPut and checkAndDelete operations. This exposes the application
> to some race conditions that have to be worked around. It would be ideal if
> the same checkAndPut/checkAndDelete operations could be supported by the REST
> client.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira