Repository: incubator-kylin
Updated Branches:
  refs/heads/1.x-staging 0209be168 -> df7e0a632


KYLIN-1105 Drop cache in AbstractRowKeyEncoder.createInstance()


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

Branch: refs/heads/1.x-staging
Commit: df7e0a632a700492be0eafb240f16bc8c97d3fb9
Parents: 0209be1
Author: Li, Yang <yang...@ebay.com>
Authored: Tue Oct 27 14:28:45 2015 +0800
Committer: Li, Yang <yang...@ebay.com>
Committed: Tue Oct 27 14:28:45 2015 +0800

----------------------------------------------------------------------
 .../kylin/cube/kv/AbstractRowKeyEncoder.java    | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/df7e0a63/cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java
----------------------------------------------------------------------
diff --git 
a/cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java 
b/cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java
index 91ac82c..c923b33 100644
--- a/cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java
+++ b/cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java
@@ -18,9 +18,7 @@
 
 package org.apache.kylin.cube.kv;
 
-import java.util.HashMap;
 import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.kylin.cube.CubeSegment;
 import org.apache.kylin.cube.cuboid.Cuboid;
@@ -40,24 +38,8 @@ public abstract class AbstractRowKeyEncoder {
 
     protected static final Logger logger = 
LoggerFactory.getLogger(AbstractRowKeyEncoder.class);
 
-    private static final Map<String, Map<Long, AbstractRowKeyEncoder>> 
ENCODER_CACHE = new ConcurrentHashMap<String, Map<Long, 
AbstractRowKeyEncoder>>();
-
     public static AbstractRowKeyEncoder createInstance(CubeSegment cubeSeg, 
Cuboid cuboid) {
-
-        // The storage location identifier is unique for every segment
-        Map<Long, AbstractRowKeyEncoder> cubeCache = 
ENCODER_CACHE.get(cubeSeg.getStorageLocationIdentifier());
-
-        if (cubeCache == null) {
-            cubeCache = new HashMap<Long, AbstractRowKeyEncoder>();
-            ENCODER_CACHE.put(cuboid.getCube().getName(), cubeCache);
-        }
-
-        AbstractRowKeyEncoder encoder = cubeCache.get(cuboid.getId());
-        if (encoder == null) {
-            encoder = new RowKeyEncoder(cubeSeg, cuboid);
-            cubeCache.put(cuboid.getId(), encoder);
-        }
-        return encoder;
+        return new RowKeyEncoder(cubeSeg, cuboid);
     }
 
     protected final Cuboid cuboid;

Reply via email to