hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-10256) Handling of value argument being null for checkAndDelete
Date Mon, 30 Dec 2013 08:58:50 GMT

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

James Taylor commented on HBASE-10256:
--------------------------------------

Here's my use case:
- I have a row key
- I want to delete the row
- I want to know that the row existed when deleted so I can notify the client if it didn't.
- I want to be able to do this with a single atomic call so I don't have a race condition.

I thought that if I provide a null for the value argument of a checkAndDelete, it would do
the above, but it doesn't. I think this would be a better default behavior, as with the current
behavior specifying a null for the value argument is not very useful. This can probably not
be solved with the current API as it would break b/w compat, but perhaps a new API could be
added down the road.

> Handling of value argument being null for checkAndDelete
> --------------------------------------------------------
>
>                 Key: HBASE-10256
>                 URL: https://issues.apache.org/jira/browse/HBASE-10256
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: James Taylor
>
> IMO, it would be more useful if when a null is supplied as the value for checkAndDelete,
that it add the Delete marker if the row exists rather than if it doesn't exist (i.e. the
opposite of checkAndPut). I think the most common use case for checkAndDelete is to delete
a row if it exists and tell me that you deleted it. With the current implementation, it adds
a Delete marker only if the row does not exist when you supply a null value which IMO is not
very useful.
> My workaround is to add another "known" KeyValue to my row with a fixed value and then
call checkAndDelete passing in this known value. Also, FWIW, if an empty byte array is passed
through (a valid value), it treats it the same as if null was passed through, which is another
separate bug.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message