Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-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 4B96ED6D7 for ; Thu, 11 Oct 2012 15:40:22 +0000 (UTC) Received: (qmail 55866 invoked by uid 500); 11 Oct 2012 15:40:22 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 55840 invoked by uid 500); 11 Oct 2012 15:40:22 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 55830 invoked by uid 99); 11 Oct 2012 15:40:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 15:40:22 +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; Thu, 11 Oct 2012 15:40:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F376B23888CD for ; Thu, 11 Oct 2012 15:39:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1397114 - in /accumulo/trunk: ./ core/ core/src/test/java/org/apache/accumulo/core/client/mock/ fate/src/main/java/org/apache/accumulo/fate/ server/ server/src/test/java/org/apache/accumulo/server/master/balancer/ src/ Date: Thu, 11 Oct 2012 15:39:34 -0000 To: commits@accumulo.apache.org From: ecn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121011153934.F376B23888CD@eris.apache.org> Author: ecn Date: Thu Oct 11 15:39:34 2012 New Revision: 1397114 URL: http://svn.apache.org/viewvc?rev=1397114&view=rev Log: ACCUMULO-770 ACCUMULO-752 fix unit tests Modified: accumulo/trunk/ (props changed) accumulo/trunk/core/ (props changed) accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java (props changed) accumulo/trunk/server/ (props changed) accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java accumulo/trunk/src/ (props changed) Propchange: accumulo/trunk/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.4/src:r1397113 Merged /accumulo/branches/1.4:r1397113 Propchange: accumulo/trunk/core/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.4/core:r1397113 Merged /accumulo/branches/1.4/src/core:r1397113 Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java?rev=1397114&r1=1397113&r2=1397114&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java Thu Oct 11 15:39:34 2012 @@ -133,7 +133,7 @@ public class MockTableOperationsTest { private ImportTestFilesAndData prepareTestFiles() throws Throwable { Configuration defaultConf = new Configuration(); - Path tempFile = new Path("target/accumulo-test/import/sample.map"); + Path tempFile = new Path("target/accumulo-test/import/sample.rf"); Path failures = new Path("target/accumulo-test/failures/"); FileSystem fs = FileSystem.get(new URI("file:///"), defaultConf); fs.deleteOnExit(tempFile); @@ -144,6 +144,7 @@ public class MockTableOperationsTest { FileSKVWriter writer = FileOperations.getInstance().openWriter( tempFile.toString(), fs, defaultConf, AccumuloConfiguration.getDefaultConfiguration()); + writer.startDefaultLocalityGroup(); List> keyVals = new ArrayList>(); for (int i = 0; i < 5; i++) { keyVals.add(new Pair(new Key("a" + i, "b" + i, "c" + i, Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java ------------------------------------------------------------------------------ Merged /accumulo/branches/1.4/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1397113 Merged /accumulo/branches/1.4/src/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1397113 Propchange: accumulo/trunk/server/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.4/server:r1397113 Merged /accumulo/branches/1.4/src/server:r1397113 Modified: accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java?rev=1397114&r1=1397113&r2=1397114&view=diff ============================================================================== --- accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java (original) +++ accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java Thu Oct 11 15:39:34 2012 @@ -138,9 +138,7 @@ public class DefaultLoadBalancerTest { // reassign offline extents assignTablets(remove.extents, servers, current, balancer); - - expectedCounts.put("t3", 3); - checkBalance(metadataTable, servers, expectedCounts); + checkBalance(metadataTable, servers, null); } private void assignTablets(List metadataTable, Map servers, SortedMap status, @@ -259,16 +257,18 @@ public class DefaultLoadBalancerTest { fail("average number of tablets is " + average + " but a server has " + server.extents.size()); } - for (FakeTServer server : servers.values()) { - Map counts = new HashMap(); - for (KeyExtent extent : server.extents) { - String t = extent.getTableId().toString(); - if (counts.get(t) == null) - counts.put(t, 0); - counts.put(t, counts.get(t) + 1); - } - for (Entry entry : counts.entrySet()) { - assertEquals(expectedCounts.get(entry.getKey()), counts.get(entry.getKey())); + if (expectedCounts != null) { + for (FakeTServer server : servers.values()) { + Map counts = new HashMap(); + for (KeyExtent extent : server.extents) { + String t = extent.getTableId().toString(); + if (counts.get(t) == null) + counts.put(t, 0); + counts.put(t, counts.get(t) + 1); + } + for (Entry entry : counts.entrySet()) { + assertEquals(expectedCounts.get(entry.getKey()), counts.get(entry.getKey())); + } } } } Propchange: accumulo/trunk/src/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.4/src:r1397113 Merged /accumulo/branches/1.4/src/src:r1397113