Return-Path: Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: (qmail 77592 invoked from network); 6 Jan 2011 22:48:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Jan 2011 22:48:13 -0000 Received: (qmail 4732 invoked by uid 500); 6 Jan 2011 22:48:13 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 4709 invoked by uid 500); 6 Jan 2011 22:48:13 -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 4702 invoked by uid 99); 6 Jan 2011 22:48:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jan 2011 22:48:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Thu, 06 Jan 2011 22:48:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 697D723888EC; Thu, 6 Jan 2011 22:47:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1056107 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java Date: Thu, 06 Jan 2011 22:47:50 -0000 To: commits@hbase.apache.org From: jgray@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110106224750.697D723888EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jgray Date: Thu Jan 6 22:47:49 2011 New Revision: 1056107 URL: http://svn.apache.org/viewvc?rev=1056107&view=rev Log: HBASE-3418 Increment operations can break when qualifiers are split between memstore/snapshot and storefiles Added: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java Modified: hbase/branches/0.90/CHANGES.txt hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Modified: hbase/branches/0.90/CHANGES.txt URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1056107&r1=1056106&r2=1056107&view=diff ============================================================================== --- hbase/branches/0.90/CHANGES.txt (original) +++ hbase/branches/0.90/CHANGES.txt Thu Jan 6 22:47:49 2011 @@ -784,6 +784,8 @@ Release 0.90.0 - Unreleased Andrew Purtell) HBASE-3407 hbck should pause between fixing and re-checking state HBASE-3401 Region IPC operations should be high priority + HBASE-3418 Increment operations can break when qualifiers are split + between memstore/snapshot and storefiles IMPROVEMENTS Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1056107&r1=1056106&r2=1056107&view=diff ============================================================================== --- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original) +++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Thu Jan 6 22:47:49 2011 @@ -29,6 +29,7 @@ import java.util.AbstractList; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -2933,6 +2934,7 @@ public class HRegion implements HeapSize // combine and return results.addAll(fileResults); + Collections.sort(results, KeyValue.COMPARATOR); return results; } Added: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java?rev=1056107&view=auto ============================================================================== --- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java (added) +++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java Thu Jan 6 22:47:49 2011 @@ -0,0 +1,100 @@ +/* + * Copyright 2010 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.regionserver; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HColumnDescriptor; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.client.Increment; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.util.Bytes; +import org.junit.Test; + +public class TestResettingCounters { + + @Test + public void testResettingCounters() throws Exception { + + HBaseTestingUtility htu = new HBaseTestingUtility(); + Configuration conf = htu.getConfiguration(); + FileSystem fs = FileSystem.get(conf); + byte [] table = Bytes.toBytes("table"); + byte [][] families = new byte [][] { + Bytes.toBytes("family1"), + Bytes.toBytes("family2"), + Bytes.toBytes("family3") + }; + int numQualifiers = 10; + byte [][] qualifiers = new byte [numQualifiers][]; + for (int i=0; i