hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-1347) HTable.incrementColumnValue does not take negative 'amount'
Date Wed, 29 Apr 2009 00:10:30 GMT

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

stack commented on HBASE-1347:
------------------------------

So we should fix binaryIncrement so it an handle < 0.  You up for that or do we have to
find ourselves a binary elf somewhere?

> HTable.incrementColumnValue does not take negative 'amount'
> -----------------------------------------------------------
>
>                 Key: HBASE-1347
>                 URL: https://issues.apache.org/jira/browse/HBASE-1347
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.19.1
>         Environment: Ubuntu 8.10
>            Reporter: atppp
>            Priority: Minor
>             Fix For: 0.19.2
>
>         Attachments: HBASE-1347-quick-fix.patch
>
>
> Apparently HRegion.binaryIncrement() assumes argument 'amount' is always positive. It
would be nice to support decrement operation. In my application, a counter can go both up
and down.
> Quick fix is
>   public byte [] binaryIncrement(byte [] value, long amount) {
>     return Bytes.toBytes(Bytes.toLong(value) + amount);
>   } 
> but it is 2x~3x slower than current implementation for small positive 'amount' value.
I have not yet found a good implementation to support negative 'amount' argument, AND match
the speed of current implementation. Anyway, I just want to throw this out there and see if
anybody is interested in negative 'amount' support. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message