You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2015/07/02 09:57:20 UTC
[1/2] incubator-kylin git commit: KYLIN-870 hbase segments info
retrieve with caching
Repository: incubator-kylin
Updated Branches:
refs/heads/0.8 1a4d99846 -> cb46b8085
KYLIN-870 hbase segments info retrieve with caching
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/f7d15aed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/f7d15aed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/f7d15aed
Branch: refs/heads/0.8
Commit: f7d15aed23956ab27dde45959049138f750c9da3
Parents: 1a4d998
Author: honma <ho...@ebay.com>
Authored: Thu Jul 2 15:38:23 2015 +0800
Committer: honma <ho...@ebay.com>
Committed: Thu Jul 2 15:38:23 2015 +0800
----------------------------------------------------------------------
.../java/org/apache/kylin/rest/service/CubeService.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f7d15aed/server/src/main/java/org/apache/kylin/rest/service/CubeService.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/service/CubeService.java b/server/src/main/java/org/apache/kylin/rest/service/CubeService.java
index 5ea3004..f4f237b 100644
--- a/server/src/main/java/org/apache/kylin/rest/service/CubeService.java
+++ b/server/src/main/java/org/apache/kylin/rest/service/CubeService.java
@@ -23,8 +23,8 @@ import org.apache.hadoop.hbase.client.HTable;
import org.apache.kylin.common.KylinConfig;
import org.apache.kylin.common.util.HBaseRegionSizeCalculator;
import org.apache.kylin.common.util.HadoopUtil;
-import org.apache.kylin.cube.CubeInstance;
import org.apache.kylin.cube.CubeBuilder;
+import org.apache.kylin.cube.CubeInstance;
import org.apache.kylin.cube.CubeManager;
import org.apache.kylin.cube.CubeSegment;
import org.apache.kylin.cube.cuboid.CuboidCLI;
@@ -74,6 +74,8 @@ public class CubeService extends BasicService {
private static final Logger logger = LoggerFactory.getLogger(CubeService.class);
+ private static WeakHashMap<String, HBaseResponse> htableInfoCache = new WeakHashMap<>();
+
@Autowired
private AccessService accessService;
@@ -433,6 +435,10 @@ public class CubeService extends BasicService {
* @throws IOException Exception when HTable resource is not closed correctly.
*/
public HBaseResponse getHTableInfo(String tableName) throws IOException {
+ if (htableInfoCache.containsKey(tableName)) {
+ return htableInfoCache.get(tableName);
+ }
+
// Get HBase storage conf.
String hbaseUrl = KylinConfig.getInstanceFromEnv().getStorageUrl();
Configuration hconf = HadoopUtil.newHBaseConfiguration(hbaseUrl);
@@ -464,6 +470,8 @@ public class CubeService extends BasicService {
}
}
+ htableInfoCache.put(tableName, hr);
+
return hr;
}
[2/2] incubator-kylin git commit: KYLIN-864 revert changes on
TimedJsonStreamParser
Posted by ma...@apache.org.
KYLIN-864 revert changes on TimedJsonStreamParser
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/cb46b808
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/cb46b808
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/cb46b808
Branch: refs/heads/0.8
Commit: cb46b8085b8fdfd01340bbe5dfd6e9e6876e506e
Parents: f7d15ae
Author: honma <ho...@ebay.com>
Authored: Thu Jul 2 15:57:02 2015 +0800
Committer: honma <ho...@ebay.com>
Committed: Thu Jul 2 15:57:02 2015 +0800
----------------------------------------------------------------------
.../java/org/apache/kylin/streaming/TimedJsonStreamParser.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/cb46b808/streaming/src/main/java/org/apache/kylin/streaming/TimedJsonStreamParser.java
----------------------------------------------------------------------
diff --git a/streaming/src/main/java/org/apache/kylin/streaming/TimedJsonStreamParser.java b/streaming/src/main/java/org/apache/kylin/streaming/TimedJsonStreamParser.java
index 908aa85..c7ff941 100644
--- a/streaming/src/main/java/org/apache/kylin/streaming/TimedJsonStreamParser.java
+++ b/streaming/src/main/java/org/apache/kylin/streaming/TimedJsonStreamParser.java
@@ -65,6 +65,12 @@ public final class TimedJsonStreamParser implements StreamParser {
private final ObjectMapper mapper = new ObjectMapper();
private final JavaType mapType = MapType.construct(HashMap.class, SimpleType.construct(String.class), SimpleType.construct(String.class));
+ @SuppressWarnings("unused")
+ public TimedJsonStreamParser(List<TblColRef> allColumns) {
+ this.allColumns = allColumns;
+ this.formatTs = false;
+ }
+
public TimedJsonStreamParser(List<TblColRef> allColumns, boolean formatTs) {
this.allColumns = allColumns;
this.formatTs = formatTs;