hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-6520) MSLab May cause the Bytes.toLong not work correctly for increment
Date Sun, 07 Apr 2013 04:45:32 GMT

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

stack updated HBASE-6520:
-------------------------

    Fix Version/s:     (was: 0.95.0)
                   0.94.2

Fix up after bulk move overwrote some 0.94.2 fix versions w/ 0.95.0 (Noticed by Lars Hofhansl)
                
> MSLab May cause the Bytes.toLong not work correctly for increment
> -----------------------------------------------------------------
>
>                 Key: HBASE-6520
>                 URL: https://issues.apache.org/jira/browse/HBASE-6520
>             Project: HBase
>          Issue Type: Bug
>            Reporter: ShiXing
>            Assignee: ShiXing
>             Fix For: 0.94.2
>
>         Attachments: HBASE-6520-0.94-v1.patch, HBASE-6520-trunk-v1.patch
>
>
> When use MemStoreLAB, the KeyValues will share the byte array allocated by the MemStoreLAB,
all the KeyValues' "bytes" attributes are the same byte array. When use the functions such
as Bytes.toLong(byte[] bytes, int offset):
> {code}
>   public static long toLong(byte[] bytes, int offset) {
>     return toLong(bytes, offset, SIZEOF_LONG);
>   }
>   public static long toLong(byte[] bytes, int offset, final int length) {
>     if (length != SIZEOF_LONG || offset + length > bytes.length) {
>       throw explainWrongLengthOrOffset(bytes, offset, length, SIZEOF_LONG);
>     }
>     long l = 0;
>     for(int i = offset; i < offset + length; i++) {
>       l <<= 8;
>       l ^= bytes[i] & 0xFF;
>     }
>     return l;
>   }
> {code}
> If we do not put a long value to the KeyValue, and read it as a long value in HRegion.increment(),the
check 
> {code}
> offset + length > bytes.length
> {code}
> will take no effects, because the bytes.length is not equal to keyLength+valueLength,
indeed it is MemStoreLAB chunkSize which is default 2048 * 1024.
> I will paste the patch later.

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

Mime
View raw message