You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2015/10/27 07:31:21 UTC

incubator-kylin git commit: Drop cache in AbstractRowKeyEncoder.createInstance()

Repository: incubator-kylin
Updated Branches:
  refs/heads/2.x-staging e6100b548 -> 320d20488


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/320d2048
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/320d2048
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/320d2048

Branch: refs/heads/2.x-staging
Commit: 320d2048872486cc43521c3587cf5daab6075e08
Parents: e6100b5
Author: Li, Yang <ya...@ebay.com>
Authored: Tue Oct 27 14:31:13 2015 +0800
Committer: Li, Yang <ya...@ebay.com>
Committed: Tue Oct 27 14:31:13 2015 +0800

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


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/320d2048/core-cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java b/core-cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java
index 1e24432..8536603 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/kv/AbstractRowKeyEncoder.java
@@ -18,7 +18,6 @@
 
 package org.apache.kylin.cube.kv;
 
-import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -43,21 +42,7 @@ public abstract class AbstractRowKeyEncoder {
     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;