Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4011FD08E for ; Tue, 7 Aug 2012 08:20:22 +0000 (UTC) Received: (qmail 91057 invoked by uid 500); 7 Aug 2012 08:20:22 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 90647 invoked by uid 500); 7 Aug 2012 08:20:16 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 90564 invoked by uid 99); 7 Aug 2012 08:20:14 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2012 08:20:14 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 7839F14000E for ; Tue, 7 Aug 2012 08:20:14 +0000 (UTC) Date: Tue, 7 Aug 2012 08:20:14 +0000 (UTC) From: "ShiXing (JIRA)" To: issues@hbase.apache.org Message-ID: <984191997.2.1344327614498.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1881661345.19969.1344313803435.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (HBASE-6520) MSLab May cause the Bytes.toLong does not work correctly for increment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-6520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ShiXing updated HBASE-6520: --------------------------- Attachment: HBASE-6520-trunk-v1.patch > MSLab May cause the Bytes.toLong does 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 > Attachments: 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira