kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject kylin git commit: KYLIN-2033 Simple test pass
Date Fri, 23 Sep 2016 09:27:27 GMT
Repository: kylin
Updated Branches:
  refs/heads/KYLIN-2033 0aaa6913c -> 74333874b


KYLIN-2033 Simple test pass


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

Branch: refs/heads/KYLIN-2033
Commit: 74333874b0817fea07357b37e6a87fa04c431840
Parents: 0aaa691
Author: Li Yang <liyang@apache.org>
Authored: Fri Sep 23 17:07:24 2016 +0800
Committer: Li Yang <liyang@apache.org>
Committed: Fri Sep 23 17:07:24 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/common/util/AbstractKylinTestCase.java | 1 -
 .../java/org/apache/kylin/metadata/MetadataManager.java     | 9 +++++----
 .../org/apache/kylin/metadata/cachesync/Broadcaster.java    | 9 ++++++++-
 .../org/apache/kylin/rest/service/CacheServiceTest.java     | 2 --
 4 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/74333874/core-common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
----------------------------------------------------------------------
diff --git a/core-common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
b/core-common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
index 556019f..14bf90b 100644
--- a/core-common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
+++ b/core-common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
@@ -49,7 +49,6 @@ public abstract class AbstractKylinTestCase {
         cleanupCache();
         System.clearProperty(KylinConfig.KYLIN_CONF);
         KylinConfig.destroyInstance();
-
     }
 
     private static void cleanupCache() {

http://git-wip-us.apache.org/repos/asf/kylin/blob/74333874/core-metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java b/core-metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java
index 63da3f4..9be3faf 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/MetadataManager.java
@@ -540,8 +540,8 @@ public class MetadataManager {
             dataModelDesc.init(config, this.getAllTablesMap());
             dataModelDescMap.putLocal(dataModelDesc.getName(), dataModelDesc);
             return dataModelDesc;
-        } catch (IOException e) {
-            throw new IllegalStateException("Error to load" + path, e);
+        } catch (Exception e) {
+            throw new IllegalStateException("Error to load " + path, e);
         }
     }
 
@@ -570,9 +570,10 @@ public class MetadataManager {
         String name = desc.getName();
         if (dataModelDescMap.containsKey(name))
             throw new IllegalArgumentException("DataModelDesc '" + name + "' already exists");
-        ProjectManager.getInstance(config).updateModelToProject(name, projectName);
         desc.setOwner(owner);
-        return saveDataModelDesc(desc);
+        desc = saveDataModelDesc(desc);
+        ProjectManager.getInstance(config).updateModelToProject(name, projectName);
+        return desc;
     }
 
     public DataModelDesc updateDataModelDesc(DataModelDesc desc) throws IOException {

http://git-wip-us.apache.org/repos/asf/kylin/blob/74333874/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java
b/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java
index d1baa64..aa9a475 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java
@@ -138,6 +138,7 @@ public class Broadcaster {
         if (all != null && all.contains(listener)) {
             return;
         }
+        logger.debug("registering no. " + (all == null ? 0 : all.size()) + " listener " +
listener);
 
         for (String entity : entities) {
             if (!StringUtils.isBlank(entity))
@@ -173,7 +174,11 @@ public class Broadcaster {
         List<Listener> list = listenerMap.get(entity);
         if (list == null)
             return;
-
+        
+        logger.debug("Broadcast metadata change: entity=" + entity + ", event=" + event +
", cacheKey=" + cacheKey + ", listeners=" + list);
+        
+        // prevents concurrent modification exception
+        list = Lists.newArrayList(list);
         switch (entity) {
         case SYNC_ALL:
             for (Listener l : list) {
@@ -198,6 +203,8 @@ public class Broadcaster {
             }
             break;
         }
+        
+        logger.debug("Broadcast metadata change done");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/kylin/blob/74333874/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
index 483ccc1..af9ccc0 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
@@ -141,12 +141,10 @@ public class CacheServiceTest extends LocalFileMetadataTestCase {
     @Before
     public void setUp() throws Exception {
         counter.set(0L);
-        createTestMetadata();
     }
 
     @After
     public void after() throws Exception {
-        cleanupTestMetadata();
     }
 
     private void waitForCounterAndClear(long count) {


Mime
View raw message