Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5B7BD1087E for ; Tue, 21 Jan 2014 00:03:56 +0000 (UTC) Received: (qmail 67337 invoked by uid 500); 21 Jan 2014 00:03:55 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 67303 invoked by uid 500); 21 Jan 2014 00:03:55 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 67296 invoked by uid 99); 21 Jan 2014 00:03:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jan 2014 00:03:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jan 2014 00:03:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DEAB9238889B; Tue, 21 Jan 2014 00:03:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1559856 - in /hbase/branches/0.98/hbase-server/src: main/java/org/apache/hadoop/hbase/regionserver/HRegion.java test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java Date: Tue, 21 Jan 2014 00:03:33 -0000 To: commits@hbase.apache.org From: jxiang@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140121000333.DEAB9238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jxiang Date: Tue Jan 21 00:03:33 2014 New Revision: 1559856 URL: http://svn.apache.org/r1559856 Log: HBASE-10384 Failed to increment serveral columns in one Increment Modified: hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java Modified: hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1559856&r1=1559855&r2=1559856&view=diff ============================================================================== --- hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original) +++ hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Tue Jan 21 00:03:33 2014 @@ -4973,6 +4973,10 @@ public class HRegion implements HeapSize Store store = stores.get(family.getKey()); List kvs = new ArrayList(family.getValue().size()); + // Sort the cells so that they match the order that they + // appear in the Get results. Otherwise, we won't be able to + // find the existing values if the cells are not specified + // in order by the client since cells are in an array list. Collections.sort(family.getValue(), store.getComparator()); // Get previous values for all columns in this family Get get = new Get(row); @@ -5168,6 +5172,11 @@ public class HRegion implements HeapSize Store store = stores.get(family.getKey()); List kvs = new ArrayList(family.getValue().size()); + // Sort the cells so that they match the order that they + // appear in the Get results. Otherwise, we won't be able to + // find the existing values if the cells are not specified + // in order by the client since cells are in an array list. + Collections.sort(family.getValue(), store.getComparator()); // Get previous values for all columns in this family Get get = new Get(row); for (Cell cell: family.getValue()) { Modified: hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java?rev=1559856&r1=1559855&r2=1559856&view=diff ============================================================================== --- hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java (original) +++ hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java Tue Jan 21 00:03:33 2014 @@ -4541,7 +4541,45 @@ public class TestFromClientSide { } } + @Test + public void testIncrementOutOfOrder() throws Exception { + LOG.info("Starting testIncrementOutOfOrder"); + final byte [] TABLENAME = Bytes.toBytes("testIncrementOutOfOrder"); + HTable ht = TEST_UTIL.createTable(TABLENAME, FAMILY); + + byte [][] QUALIFIERS = new byte [][] { + Bytes.toBytes("B"), Bytes.toBytes("A"), Bytes.toBytes("C") + }; + + Increment inc = new Increment(ROW); + for (int i=0; i