Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DB49B200B6B for ; Thu, 14 Jul 2016 21:37:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DA2A7160A63; Thu, 14 Jul 2016 19:37:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CA317160A8C for ; Thu, 14 Jul 2016 21:37:44 +0200 (CEST) Received: (qmail 25788 invoked by uid 500); 14 Jul 2016 19:37:43 -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 25496 invoked by uid 99); 14 Jul 2016 19:37:43 -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, 14 Jul 2016 19:37:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A5604ED317; Thu, 14 Jul 2016 19:37:43 +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, 14 Jul 2016 19:37:50 -0000 Message-Id: <8aad744da21a4112836fb8cf1a778440@git.apache.org> In-Reply-To: <2fe520b72c71423398c8fd2599e420ac@git.apache.org> References: <2fe520b72c71423398c8fd2599e420ac@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [08/10] accumulo git commit: ACCUMULO-4372 Fixes synchronization in CompressionTest archived-at: Thu, 14 Jul 2016 19:37:46 -0000 ACCUMULO-4372 Fixes synchronization in CompressionTest Also changed LZO so that creating a new codec doesn't always assign the new codec to the default variable 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/791fbd6b Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/791fbd6b Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/791fbd6b Branch: refs/heads/1.8 Commit: 791fbd6ba17aaca1d19f57b20860930c81c99bf0 Parents: 45ddd25 Author: phrocker Authored: Thu Jul 14 14:42:31 2016 -0400 Committer: Josh Elser Committed: Thu Jul 14 15:37:21 2016 -0400 ---------------------------------------------------------------------- .../org/apache/accumulo/core/file/rfile/bcfile/Compression.java | 3 +-- .../apache/accumulo/core/file/rfile/bcfile/CompressionTest.java | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/791fbd6b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java index 9df2523..2b81541 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java +++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java @@ -156,8 +156,7 @@ public final class Compression { // the default defined within the codec if (bufferSize > 0) myConf.setInt(BUFFER_SIZE_OPT, bufferSize); - codec = (CompressionCodec) ReflectionUtils.newInstance(Class.forName(clazz), myConf); - return codec; + return (CompressionCodec) ReflectionUtils.newInstance(Class.forName(clazz), myConf); } catch (ClassNotFoundException e) { // that is okay } http://git-wip-us.apache.org/repos/asf/accumulo/blob/791fbd6b/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java index f3d6a22..6e8b843 100644 --- a/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java +++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java @@ -219,7 +219,9 @@ public class CompressionTest { CompressionCodec codec = al.getCodec(); Assert.assertNotNull(al + " resulted in a non-null codec", codec); // add the identity hashcode to the set. - testSet.add(System.identityHashCode(codec)); + synchronized (testSet) { + testSet.add(System.identityHashCode(codec)); + } return true; } });