You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by sa...@apache.org on 2016/07/01 18:43:22 UTC

incubator-geode git commit: fixed review comments

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1573 f343c21e9 -> d6130ecc3


fixed review comments


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

Branch: refs/heads/feature/GEODE-1573
Commit: d6130ecc3c358f6b3190dd0b47ce6ebb32d7373f
Parents: f343c21
Author: Sai Boorlagadda <sb...@pivotal.io>
Authored: Wed Jun 29 14:03:50 2016 -0700
Committer: Sai Boorlagadda <sb...@pivotal.io>
Committed: Wed Jun 29 14:03:50 2016 -0700

----------------------------------------------------------------------
 .../gemfire/compression/SnappyCompressor.java   | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d6130ecc/geode-core/src/main/java/com/gemstone/gemfire/compression/SnappyCompressor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/compression/SnappyCompressor.java b/geode-core/src/main/java/com/gemstone/gemfire/compression/SnappyCompressor.java
index af345d6..218b456 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/compression/SnappyCompressor.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/compression/SnappyCompressor.java
@@ -18,45 +18,31 @@
 package com.gemstone.gemfire.compression;
 
 import java.io.Serializable;
-import java.util.concurrent.atomic.AtomicReference;
-
 
 import org.iq80.snappy.CorruptionException;
 import org.iq80.snappy.Snappy;
 
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-
 /**
  * An implementation of {@link Compressor} for Google's Snappy compression
- * codec. Utilizes the xerial java-snappy wrapper.
+ * codec. Utilizes the java-snappy wrapper.
  * 
  * @since GemFire 8.0
  */
 public final class SnappyCompressor implements Compressor, Serializable {
   private static final long serialVersionUID = 496609875302446099L;
   
-  // It's possible to create more than one, but there only needs to be a single
-  // instance in the VM.
-  private static final AtomicReference<SnappyCompressor> defaultInstance = new AtomicReference<SnappyCompressor>();
-  
   /**
    * Create a new instance of the SnappyCompressor.
-   * @throws IllegalStateException when the Snappy native library is unavailable
    */
   public SnappyCompressor() {
   }
   
   /**
    * Get the single, default instance of the SnappyCompressor.
+   * @deprecated Starting GEODE 1.0 getDefaultInstance is deprecated. Use constructor instead.
    */
   public static final SnappyCompressor getDefaultInstance() {
-    SnappyCompressor instance = defaultInstance.get();
-    if (instance != null) {
-      return instance;
-    }
-
-    defaultInstance.compareAndSet(null, new SnappyCompressor());
-    return defaultInstance.get();
+    return new SnappyCompressor();
   }
 
   @Override