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 21CAB196FC for ; Thu, 7 Apr 2016 16:35:01 +0000 (UTC) Received: (qmail 26940 invoked by uid 500); 7 Apr 2016 16:35:01 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 26844 invoked by uid 500); 7 Apr 2016 16:35:00 -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 26815 invoked by uid 99); 7 Apr 2016 16:35:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2016 16:35:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7EB16DFC6F; Thu, 7 Apr 2016 16:35:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Thu, 07 Apr 2016 16:35:00 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/7] accumulo git commit: ACCUMULO-4180 Fix bugs Josh found in InMemoryMapIT Repository: accumulo Updated Branches: refs/heads/1.6 071247167 -> b8084af36 refs/heads/1.7 f7a24d751 -> eb6a03810 refs/heads/master 52318429a -> 16c36b850 ACCUMULO-4180 Fix bugs Josh found in InMemoryMapIT Exposed a bug in InMemoryMap setting the map type, which is fixed as well. Signed-off-by: Josh Elser Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b8084af3 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b8084af3 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b8084af3 Branch: refs/heads/1.6 Commit: b8084af36c51ff3831d536c3c8238bef3222363f Parents: 0712471 Author: Michael Wall Authored: Thu Apr 7 10:34:51 2016 -0400 Committer: Josh Elser Committed: Thu Apr 7 11:57:06 2016 -0400 ---------------------------------------------------------------------- .../java/org/apache/accumulo/tserver/InMemoryMap.java | 2 +- .../test/java/org/apache/accumulo/test/InMemoryMapIT.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/b8084af3/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java ---------------------------------------------------------------------- diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java index 614b34a..792d35a 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java @@ -213,7 +213,7 @@ public class InMemoryMap { mapType = useNativeMap ? TYPE_NATIVE_MAP_WRAPPER : TYPE_DEFAULT_MAP; } else { map = new LocalityGroupMap(lggroups, useNativeMap); - mapType = useNativeMap ? TYPE_LOCALITY_GROUP_MAP : TYPE_LOCALITY_GROUP_MAP_NATIVE; + mapType = useNativeMap ? TYPE_LOCALITY_GROUP_MAP_NATIVE : TYPE_LOCALITY_GROUP_MAP; } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b8084af3/test/src/test/java/org/apache/accumulo/test/InMemoryMapIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/InMemoryMapIT.java b/test/src/test/java/org/apache/accumulo/test/InMemoryMapIT.java index 102762a..6eec2e8 100644 --- a/test/src/test/java/org/apache/accumulo/test/InMemoryMapIT.java +++ b/test/src/test/java/org/apache/accumulo/test/InMemoryMapIT.java @@ -204,12 +204,18 @@ public class InMemoryMapIT { defaultMap = new InMemoryMap(false, tempFolder.newFolder().getAbsolutePath()); nativeMapWrapper = new InMemoryMap(true, tempFolder.newFolder().getAbsolutePath()); localityGroupMap = new InMemoryMap(getLocalityGroups(), false, tempFolder.newFolder().getAbsolutePath()); - localityGroupMapWithNative = new InMemoryMap(getLocalityGroups(), false, tempFolder.newFolder().getAbsolutePath()); + localityGroupMapWithNative = new InMemoryMap(getLocalityGroups(), true, tempFolder.newFolder().getAbsolutePath()); } catch (IOException e) { log.error("Error getting new InMemoryMap ", e); fail(e.getMessage()); } + // ensure the maps are correct type + assertEquals("Not a DefaultMap", InMemoryMap.TYPE_DEFAULT_MAP, defaultMap.getMapType()); + assertEquals("Not a NativeMapWrapper", InMemoryMap.TYPE_NATIVE_MAP_WRAPPER, nativeMapWrapper.getMapType()); + assertEquals("Not a LocalityGroupMap", InMemoryMap.TYPE_LOCALITY_GROUP_MAP, localityGroupMap.getMapType()); + assertEquals("Not a LocalityGroupMap with native", InMemoryMap.TYPE_LOCALITY_GROUP_MAP_NATIVE, localityGroupMapWithNative.getMapType()); + defaultMap.mutate(mutations); nativeMapWrapper.mutate(mutations); localityGroupMap.mutate(mutations); @@ -303,7 +309,7 @@ public class InMemoryMapIT { private Map> getLocalityGroups() { Map> locgro = new HashMap>(); locgro.put("a", newCFSet("cf", "cf2")); - locgro.put("a", newCFSet("cf3", "cf4")); + locgro.put("b", newCFSet("cf3", "cf4")); return locgro; }