You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2016/07/14 19:37:50 UTC
[08/10] accumulo git commit: ACCUMULO-4372 Fixes synchronization in
CompressionTest
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 <el...@apache.org>
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 <ma...@gmail.com>
Authored: Thu Jul 14 14:42:31 2016 -0400
Committer: Josh Elser <el...@apache.org>
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;
}
});