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 2017/10/12 13:51:15 UTC

[1/4] kylin git commit: Sleep 3 seconds before do query pushdown test in case cache not wiped

Repository: kylin
Updated Branches:
  refs/heads/2.2.x b0dfc049c -> 076119559


Sleep 3 seconds before do query pushdown test in case cache not wiped


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

Branch: refs/heads/2.2.x
Commit: bd7cb9c9570f3d3cb0ceeb8f4c6be81853eb59bd
Parents: ef7d290
Author: nichunen <ch...@kyligence.io>
Authored: Fri Sep 29 19:33:37 2017 +0800
Committer: Li Yang <li...@apache.org>
Committed: Fri Sep 29 19:37:44 2017 +0800

----------------------------------------------------------------------
 build/smoke-test/testQuery.py | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/bd7cb9c9/build/smoke-test/testQuery.py
----------------------------------------------------------------------
diff --git a/build/smoke-test/testQuery.py b/build/smoke-test/testQuery.py
index f0eec07..ec1702e 100644
--- a/build/smoke-test/testQuery.py
+++ b/build/smoke-test/testQuery.py
@@ -86,6 +86,9 @@ class testQuery(unittest.TestCase):
 
         self.assertEqual(status_code, 200, 'Disable cube failed.')
 
+        # Sleep 3 seconds to ensure cache wiped while do query pushdown
+        time.sleep(3)
+
         query_url = testQuery.base_url + "/query"
         for sql_file in sql_files:
             index += 1


[2/4] kylin git commit: minor, fix NPE in ACL ValidateUtil getALlUsers

Posted by li...@apache.org.
minor, fix NPE in ACL ValidateUtil getALlUsers


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

Branch: refs/heads/2.2.x
Commit: 5fbd9525d1dbe0892675f94c38df93b625fefa9e
Parents: bd7cb9c
Author: Billy Liu <bi...@apache.org>
Authored: Sat Sep 30 15:04:19 2017 +0800
Committer: Billy Liu <bi...@apache.org>
Committed: Sat Sep 30 16:14:10 2017 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/rest/util/ValidateUtil.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/5fbd9525/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java b/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java
index abb326f..7e513ae 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java
@@ -122,8 +122,10 @@ public class ValidateUtil {
         ProjectInstance prj = projectService.getProjectManager().getProject(project);
         AclEntity ae = accessService.getAclEntity("ProjectInstance", prj.getUuid());
         Acl acl = accessService.getAcl(ae);
-        for (AccessControlEntry ace : acl.getEntries()) {
-            allUsers.add(((PrincipalSid) ace.getSid()).getPrincipal());
+        if (acl != null && acl.getEntries() != null) {
+            for (AccessControlEntry ace : acl.getEntries()) {
+                allUsers.add(((PrincipalSid) ace.getSid()).getPrincipal());
+            }
         }
         return allUsers;
     }


[3/4] kylin git commit: KYLIN-2794 MultipleDictionaryValueEnumerator should output values in sorted order

Posted by li...@apache.org.
KYLIN-2794 MultipleDictionaryValueEnumerator should output values in sorted order


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

Branch: refs/heads/2.2.x
Commit: 622bafe278ec1ca3039e2e2c23764c80a7aed631
Parents: 5fbd952
Author: Li Yang <li...@apache.org>
Authored: Mon Oct 9 06:25:31 2017 +0800
Committer: Li Yang <li...@apache.org>
Committed: Mon Oct 9 06:30:06 2017 +0800

----------------------------------------------------------------------
 .../dict/MultipleDictionaryValueEnumerator.java | 50 ++++++++++--------
 .../MultipleDictionaryValueEnumeratorTest.java  | 54 ++++++++++++--------
 2 files changed, 62 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/622bafe2/core-dictionary/src/main/java/org/apache/kylin/dict/MultipleDictionaryValueEnumerator.java
----------------------------------------------------------------------
diff --git a/core-dictionary/src/main/java/org/apache/kylin/dict/MultipleDictionaryValueEnumerator.java b/core-dictionary/src/main/java/org/apache/kylin/dict/MultipleDictionaryValueEnumerator.java
index c1bc5d5..f0d4e34 100644
--- a/core-dictionary/src/main/java/org/apache/kylin/dict/MultipleDictionaryValueEnumerator.java
+++ b/core-dictionary/src/main/java/org/apache/kylin/dict/MultipleDictionaryValueEnumerator.java
@@ -30,20 +30,16 @@ import com.google.common.collect.Lists;
  */
 @SuppressWarnings("rawtypes")
 public class MultipleDictionaryValueEnumerator implements IDictionaryValueEnumerator {
-    private int curDictIndex = 0;
-    private Dictionary<String> curDict;
-    private int curKey;
+    private List<Integer> curKeys = Lists.newArrayList();
     private String curValue = null;
     private List<Dictionary<String>> dictionaryList;
 
     public MultipleDictionaryValueEnumerator(List<DictionaryInfo> dictionaryInfoList) {
         dictionaryList = Lists.newArrayListWithCapacity(dictionaryInfoList.size());
         for (DictionaryInfo dictInfo : dictionaryInfoList) {
+            Dictionary<String> dictionary = (Dictionary<String>) dictInfo.getDictionaryObject();
             dictionaryList.add((Dictionary<String>) dictInfo.getDictionaryObject());
-        }
-        if (!dictionaryList.isEmpty()) {
-            curDict = dictionaryList.get(0);
-            curKey = curDict.getMinId();
+            curKeys.add(dictionary.getMinId());
         }
     }
 
@@ -54,22 +50,34 @@ public class MultipleDictionaryValueEnumerator implements IDictionaryValueEnumer
 
     @Override
     public boolean moveNext() throws IOException {
-        while (curDictIndex < dictionaryList.size()) {
-            if (curKey <= curDict.getMaxId()) {
-                curValue = curDict.getValueFromId(curKey);
-                curKey ++;
-
-                return true;
-            }
-
-            // move to next dict if exists
-            if (++curDictIndex < dictionaryList.size()) {
-                curDict = dictionaryList.get(curDictIndex);
-                curKey = curDict.getMinId();
+        String minValue = null;
+        int curDictIndex = 0;
+        
+        // multi-merge dictionary forest
+        for (int i = 0; i < dictionaryList.size(); i++) {
+            Dictionary<String> dict = dictionaryList.get(i);
+            if (dict == null)
+                continue;
+            
+            int curKey = curKeys.get(i);
+            if (curKey > dict.getMaxId())
+                continue;
+            
+            String curValue = dict.getValueFromId(curKey);
+            if (minValue == null || minValue.compareTo(curValue) > 0) {
+                minValue = curValue;
+                curDictIndex = i;
             }
         }
-        curValue = null;
-        return false;
+        
+        if (minValue == null) {
+            curValue = null;
+            return false;
+        }
+        
+        curValue = minValue;
+        curKeys.set(curDictIndex, curKeys.get(curDictIndex) + 1);
+        return true;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/kylin/blob/622bafe2/core-dictionary/src/test/java/org/apache/kylin/dict/MultipleDictionaryValueEnumeratorTest.java
----------------------------------------------------------------------
diff --git a/core-dictionary/src/test/java/org/apache/kylin/dict/MultipleDictionaryValueEnumeratorTest.java b/core-dictionary/src/test/java/org/apache/kylin/dict/MultipleDictionaryValueEnumeratorTest.java
index 2e90bcf..3496c00 100644
--- a/core-dictionary/src/test/java/org/apache/kylin/dict/MultipleDictionaryValueEnumeratorTest.java
+++ b/core-dictionary/src/test/java/org/apache/kylin/dict/MultipleDictionaryValueEnumeratorTest.java
@@ -56,52 +56,63 @@ public class MultipleDictionaryValueEnumeratorTest {
     @Test
     public void testNormalDicts() throws IOException {
         List<DictionaryInfo> dictionaryInfoList = new ArrayList<>(2);
-        dictionaryInfoList.add(createDictInfo(new int[]{0, 1, 2}));
-        dictionaryInfoList.add(createDictInfo(new int[]{4, 5, 6}));
+        dictionaryInfoList.add(createDictInfo(new int[] { 0, 1, 2 }));
+        dictionaryInfoList.add(createDictInfo(new int[] { 4, 5, 6 }));
 
         Integer[] values = enumerateDictInfoList(dictionaryInfoList);
         assertEquals(6, values.length);
-        assertArrayEquals(new Integer[]{0, 1, 2, 4, 5, 6}, values);
+        assertArrayEquals(new Integer[] { 0, 1, 2, 4, 5, 6 }, values);
     }
 
     @Test
     public void testFirstEmptyDicts() throws IOException {
         List<DictionaryInfo> dictionaryInfoList = new ArrayList<>(2);
-        dictionaryInfoList.add(createDictInfo(new int[]{}));
-        dictionaryInfoList.add(createDictInfo(new int[]{4, 5, 6}));
+        dictionaryInfoList.add(createDictInfo(new int[] {}));
+        dictionaryInfoList.add(createDictInfo(new int[] { 4, 5, 6 }));
 
         Integer[] values = enumerateDictInfoList(dictionaryInfoList);
         assertEquals(3, values.length);
-        assertArrayEquals(new Integer[]{4, 5, 6}, values);
+        assertArrayEquals(new Integer[] { 4, 5, 6 }, values);
     }
 
     @Test
     public void testMiddleEmptyDicts() throws IOException {
         List<DictionaryInfo> dictionaryInfoList = new ArrayList<>(3);
-        dictionaryInfoList.add(createDictInfo(new int[]{0, 1, 2}));
-        dictionaryInfoList.add(createDictInfo(new int[]{}));
-        dictionaryInfoList.add(createDictInfo(new int[]{7, 8, 9}));
+        dictionaryInfoList.add(createDictInfo(new int[] { 0, 1, 2 }));
+        dictionaryInfoList.add(createDictInfo(new int[] {}));
+        dictionaryInfoList.add(createDictInfo(new int[] { 7, 8, 9 }));
 
         Integer[] values = enumerateDictInfoList(dictionaryInfoList);
         assertEquals(6, values.length);
-        assertArrayEquals(new Integer[]{0, 1, 2, 7, 8, 9}, values);
+        assertArrayEquals(new Integer[] { 0, 1, 2, 7, 8, 9 }, values);
     }
 
     @Test
     public void testLastEmptyDicts() throws IOException {
         List<DictionaryInfo> dictionaryInfoList = new ArrayList<>(3);
-        dictionaryInfoList.add(createDictInfo(new int[]{0, 1, 2}));
-        dictionaryInfoList.add(createDictInfo(new int[]{6, 7, 8}));
-        dictionaryInfoList.add(createDictInfo(new int[]{}));
+        dictionaryInfoList.add(createDictInfo(new int[] { 0, 1, 2 }));
+        dictionaryInfoList.add(createDictInfo(new int[] { 6, 7, 8 }));
+        dictionaryInfoList.add(createDictInfo(new int[] {}));
 
         Integer[] values = enumerateDictInfoList(dictionaryInfoList);
         assertEquals(6, values.length);
-        assertArrayEquals(new Integer[]{0, 1, 2, 6, 7, 8}, values);
+        assertArrayEquals(new Integer[] { 0, 1, 2, 6, 7, 8 }, values);
+    }
+
+    @Test
+    public void testUnorderedDicts() throws IOException {
+        List<DictionaryInfo> dictionaryInfoList = new ArrayList<>(3);
+        dictionaryInfoList.add(createDictInfo(new int[] { 0, 1, 6 }));
+        dictionaryInfoList.add(createDictInfo(new int[] { 3, 7, 8 }));
+        dictionaryInfoList.add(createDictInfo(new int[] { 2, 7, 9 }));
+        Integer[] values = enumerateDictInfoList(dictionaryInfoList);
+        assertEquals(9, values.length);
+        assertArrayEquals(new Integer[] { 0, 1, 2, 3, 6, 7, 7, 8, 9 }, values);
     }
 
     public static class MockDictionary extends Dictionary<String> {
         private static final long serialVersionUID = 1L;
-        
+
         public int[] values;
 
         @Override
@@ -111,7 +122,7 @@ public class MultipleDictionaryValueEnumeratorTest {
 
         @Override
         public int getMaxId() {
-            return values.length-1;
+            return values.length - 1;
         }
 
         @Override
@@ -134,16 +145,17 @@ public class MultipleDictionaryValueEnumeratorTest {
             return "" + values[id];
         }
 
-
         @Override
-        public void dump(PrintStream out) {}
+        public void dump(PrintStream out) {
+        }
 
         @Override
-        public void write(DataOutput out) throws IOException {}
+        public void write(DataOutput out) throws IOException {
+        }
 
         @Override
-        public void readFields(DataInput in) throws IOException {}
-
+        public void readFields(DataInput in) throws IOException {
+        }
 
         @Override
         public boolean contains(Dictionary another) {


[4/4] kylin git commit: Merge commit 'b0dfc049c1b4cd39d943de0a7a8760ba3d6fdfab' into kap-2.5.x

Posted by li...@apache.org.
Merge commit 'b0dfc049c1b4cd39d943de0a7a8760ba3d6fdfab' into kap-2.5.x


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

Branch: refs/heads/2.2.x
Commit: 0761195598f44a33f971399c006b40450be3828b
Parents: 622bafe b0dfc04
Author: lidongsjtu <li...@apache.org>
Authored: Thu Oct 12 20:19:20 2017 +0800
Committer: lidongsjtu <li...@apache.org>
Committed: Thu Oct 12 20:19:20 2017 +0800

----------------------------------------------------------------------
 build/script/download-tomcat.sh                 |  4 +--
 .../org/apache/kylin/common/KylinVersion.java   |  2 +-
 .../main/resources/kylin-defaults.properties    |  2 +-
 .../kylin/cube/gridtable/RecordComparators.java | 18 +++++++++++---
 .../storage/gtrecord/DictGridTableTest.java     |  8 ++++++
 .../algorithm/ITGeneticAlgorithmTest.java       |  2 +-
 pom.xml                                         |  2 +-
 webapp/app/js/controllers/access.js             | 10 ++++----
 webapp/app/js/controllers/streamingConfig.js    |  8 +++---
 webapp/app/js/listeners.js                      |  8 +++---
 webapp/app/partials/common/access.html          |  8 +++---
 webapp/app/partials/cubes/cube_detail.html      | 26 ++++++++++----------
 12 files changed, 59 insertions(+), 39 deletions(-)
----------------------------------------------------------------------