accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [03/10] accumulo git commit: ACCUMULO-4372 Fixes synchronization in CompressionTest
Date Thu, 14 Jul 2016 19:37:45 GMT
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 <elserj@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a8d1acd4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a8d1acd4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a8d1acd4

Branch: refs/heads/master
Commit: a8d1acd4bb34947ac49830e5a671e3f528ca2f7e
Parents: c5ac9f3
Author: phrocker <marc.parisi@gmail.com>
Authored: Thu Jul 14 14:42:31 2016 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jul 14 14:42:31 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/a8d1acd4/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 3b82462..fb0c066 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
@@ -155,8 +155,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/a8d1acd4/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 9615564..683ad48 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
@@ -225,7 +225,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;
             }
           });


Mime
View raw message