You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by qh...@apache.org on 2015/05/18 13:17:14 UTC

[1/2] incubator-kylin git commit: optimize log

Repository: incubator-kylin
Updated Branches:
  refs/heads/streaming-localdict [created] f40d62bfa


optimize log


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

Branch: refs/heads/streaming-localdict
Commit: 3b3e05ef073af8d7e7c52db12383da94ab31f9fe
Parents: 4cf65f0
Author: qianhao.zhou <qi...@ebay.com>
Authored: Fri May 15 13:01:20 2015 +0800
Committer: qianhao.zhou <qi...@ebay.com>
Committed: Fri May 15 13:01:20 2015 +0800

----------------------------------------------------------------------
 .../apache/kylin/metadata/serializer/BigDecimalSerializer.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/3b3e05ef/metadata/src/main/java/org/apache/kylin/metadata/serializer/BigDecimalSerializer.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/serializer/BigDecimalSerializer.java b/metadata/src/main/java/org/apache/kylin/metadata/serializer/BigDecimalSerializer.java
index cf146fb..af67112 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/serializer/BigDecimalSerializer.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/serializer/BigDecimalSerializer.java
@@ -38,6 +38,7 @@ public class BigDecimalSerializer extends DataTypeSerializer<BigDecimal> {
     
     final DataType type;
     final int maxLength;
+    int counter = 0;
     
     public BigDecimalSerializer(DataType type) {
         this.type = type;
@@ -48,7 +49,9 @@ public class BigDecimalSerializer extends DataTypeSerializer<BigDecimal> {
     @Override
     public void serialize(BigDecimal value, ByteBuffer out) {
         if (value.scale() > type.getScale()) {
-            logger.warn("value's scale has exceeded the " + type.getScale() +", cut it off, to ensure encoded value do not exceed maxLength " + maxLength);
+            if (counter % 10000 == 0) {
+                logger.warn("value's scale has exceeded the " + type.getScale() + ", cut it off, to ensure encoded value do not exceed maxLength " + maxLength + " times:" + (counter++));
+            }
             value = value.setScale(type.getScale(), BigDecimal.ROUND_HALF_EVEN);
         }
         byte[] bytes = value.unscaledValue().toByteArray();


[2/2] incubator-kylin git commit: KYLIN-770

Posted by qh...@apache.org.
KYLIN-770


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

Branch: refs/heads/streaming-localdict
Commit: f40d62bfad2dab207f2765dcaa305a0f81858559
Parents: 3b3e05e
Author: qianhao.zhou <qi...@ebay.com>
Authored: Mon May 18 19:17:00 2015 +0800
Committer: qianhao.zhou <qi...@ebay.com>
Committed: Mon May 18 19:17:00 2015 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/kylin/rest/service/CacheService.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f40d62bf/server/src/main/java/org/apache/kylin/rest/service/CacheService.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java
index 6ce8b83..913ae35 100644
--- a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java
+++ b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java
@@ -26,6 +26,9 @@ import org.apache.kylin.invertedindex.IIManager;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.project.ProjectManager;
 import org.apache.kylin.metadata.realization.RealizationType;
+import org.apache.kylin.rest.controller.QueryController;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Caching;
 import org.springframework.stereotype.Component;
 
 import java.io.IOException;
@@ -36,6 +39,7 @@ import java.util.List;
 @Component("cacheService")
 public class CacheService extends BasicService {
 
+    @Caching(evict = { @CacheEvict(value = QueryController.SUCCESS_QUERY_CACHE, allEntries = true), @CacheEvict(value = QueryController.EXCEPTION_QUERY_CACHE, allEntries = true) })
     public void rebuildCache(Broadcaster.TYPE cacheType, String cacheKey) {
         final String log = "rebuild cache type: " + cacheType + " name:" + cacheKey;
         try {
@@ -93,6 +97,7 @@ public class CacheService extends BasicService {
         }
     }
 
+    @Caching(evict = { @CacheEvict(value = QueryController.SUCCESS_QUERY_CACHE, allEntries = true), @CacheEvict(value = QueryController.EXCEPTION_QUERY_CACHE, allEntries = true) })
     public void removeCache(Broadcaster.TYPE cacheType, String cacheKey) {
         final String log = "remove cache type: " + cacheType + " name:" + cacheKey;
         try {