kylin git commit: hotfix, Cuboid.translateToValidCuboid() can return invalid cuboid where input is 0

2016-01-18 Thread liyang
Repository: kylin
Updated Branches:
  refs/heads/1.x-staging d00818926 -> 4f4532260


hotfix, Cuboid.translateToValidCuboid() can return invalid cuboid where input 
is 0


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

Branch: refs/heads/1.x-staging
Commit: 4f4532260a3b93d51c58a8d842a51d4bce9c4af0
Parents: d008189
Author: Li, Yang 
Authored: Mon Jan 18 16:45:35 2016 +0800
Committer: Li, Yang 
Committed: Mon Jan 18 16:45:35 2016 +0800

--
 .../org/apache/kylin/cube/cuboid/Cuboid.java| 79 +---
 .../apache/kylin/cube/cuboid/CuboidTest.java|  2 +-
 2 files changed, 4 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/4f453226/cube/src/main/java/org/apache/kylin/cube/cuboid/Cuboid.java
--
diff --git a/cube/src/main/java/org/apache/kylin/cube/cuboid/Cuboid.java 
b/cube/src/main/java/org/apache/kylin/cube/cuboid/Cuboid.java
index 7f2b7ab..17d62e7 100644
--- a/cube/src/main/java/org/apache/kylin/cube/cuboid/Cuboid.java
+++ b/cube/src/main/java/org/apache/kylin/cube/cuboid/Cuboid.java
@@ -151,22 +151,9 @@ public class Cuboid implements Comparable {
 if (cuboidWithoutMandatory != 0) {
 return cuboidID;
 } else {
-// no column (except mandatory), add one column
-long toAddCol = (1 << (BitSet.valueOf(new long[] { 
rowkey.getTailMask() }).cardinality()));
-// check if the toAddCol belongs to any hierarchy
-List hierarchyMaskList = 
rowkey.getHierarchyMasks();
-if (hierarchyMaskList != null && hierarchyMaskList.size() > 0) 
{
-for (HierarchyMask hierarchyMasks : hierarchyMaskList) {
-long result = toAddCol & hierarchyMasks.fullMask;
-if (result > 0) {
-// replace it with the root col in hierarchy
-toAddCol = hierarchyMasks.allMasks[0];
-break;
-}
-}
-}
-cuboidID = cuboidID | toAddCol;
-return cuboidID;
+// no column except mandatory, add one column
+cuboidID = cuboidID | 
Long.lowestOneBit(rowkey.getAggrGroupFullMask());
+return translateToValidCuboid(cubeDesc, cuboidID);
 }
 }
 
@@ -176,66 +163,6 @@ public class Cuboid implements Comparable {
 
 }
 
-// Breadth-First-Search
-
-/**
- * @deprecated due to poor performance
- * @param cube
- * @param cuboidID
- * @return
- */
-private static long translateToValidCuboidDeprecated(CubeDesc cube, long 
cuboidID) {
-if (Cuboid.isValid(cube, cuboidID)) {
-return cuboidID;
-}
-
-HashSet dedupped = new HashSet();
-Queue queue = new LinkedList();
-List parents = Cuboid.getAllPossibleParents(cube, cuboidID);
-
-// check each parent
-addToQueue(queue, parents, dedupped);
-while (queue.size() > 0) {
-long parent = pollFromQueue(queue, dedupped);
-if (Cuboid.isValid(cube, parent)) {
-return parent;
-} else {
-addToQueue(queue, Cuboid.getAllPossibleParents(cube, parent), 
dedupped);
-}
-}
-return -1;
-}
-
-private static List getAllPossibleParents(CubeDesc cube, long 
cuboidID) {
-List allPossibleParents = new ArrayList();
-
-for (int i = 0; i < cube.getRowkey().getRowKeyColumns().length; i++) {
-long mask = 1L << i;
-long parentId = cuboidID | mask;
-if (parentId != cuboidID) {
-allPossibleParents.add(parentId);
-}
-}
-
-return allPossibleParents;
-}
-
-private static void addToQueue(Queue queue, List parents, 
HashSet dedupped) {
-Collections.sort(parents);
-for (Long p : parents) {
-if (!dedupped.contains(p)) {
-dedupped.add(p);
-queue.offer(p);
-}
-}
-}
-
-private static long pollFromQueue(Queue queue, HashSet 
dedupped) {
-long element = queue.poll();
-dedupped.remove(element);
-return element;
-}
-
 private static boolean checkBaseCuboid(RowKeyDesc rowkey, long cuboidID) {
 long baseCuboidId = rowkey.getFullMask();
 if (cuboidID > baseCuboidId) {


kylin git commit: KYLIN-1327 Tool for batch updating host information of htables

2016-01-18 Thread lidong
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc f1a922473 -> 34c95286b


KYLIN-1327 Tool for batch updating host information of htables


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

Branch: refs/heads/2.0-rc
Commit: 34c95286b230e58e80714edc22069002a0f61fae
Parents: f1a9224
Author: lidongsjtu 
Authored: Mon Jan 18 16:18:51 2016 +0800
Committer: lidongsjtu 
Committed: Mon Jan 18 16:44:15 2016 +0800

--
 .../storage/hbase/util/UpdateHTableHostCLI.java | 192 +++
 1 file changed, 192 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/34c95286/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
--
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
new file mode 100644
index 000..1ff98a4
--- /dev/null
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kylin.storage.hbase.util;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.kylin.common.KylinConfig;
+import org.apache.kylin.cube.CubeInstance;
+import org.apache.kylin.cube.CubeManager;
+import org.apache.kylin.cube.CubeSegment;
+import org.apache.kylin.invertedindex.IIInstance;
+import org.apache.kylin.invertedindex.IIManager;
+import org.apache.kylin.invertedindex.IISegment;
+import org.apache.kylin.metadata.model.SegmentStatusEnum;
+import org.apache.kylin.metadata.realization.IRealizationConstants;
+import org.apache.kylin.metadata.realization.RealizationStatusEnum;
+import org.apache.kylin.storage.hbase.HBaseConnection;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Created by dongli on 1/18/16.
+ */
+public class UpdateHTableHostCLI {
+private static final Log logger = 
LogFactory.getLog(UpdateHTableHostCLI.class);
+private List updatedResources = Lists.newArrayList();
+private List errorMsgs = Lists.newArrayList();
+
+private List htables;
+private HBaseAdmin hbaseAdmin;
+private KylinConfig kylinConfig;
+
+public UpdateHTableHostCLI(List htables) throws IOException {
+this.htables = htables;
+this.hbaseAdmin = new 
HBaseAdmin(HBaseConnection.getCurrentHBaseConfiguration());
+this.kylinConfig = KylinConfig.getInstanceFromEnv();
+}
+
+public static void main(String args[]) throws Exception {
+if (args.length < 1) {
+printUsageAndExit();
+}
+
+List tableNames = 
getHTableNames(KylinConfig.getInstanceFromEnv());
+String filterType = args[0].toLowerCase();
+if (filterType.equals("-table")) {
+tableNames = filterByTables(tableNames, 
Arrays.asList(args).subList(1, args.length));
+} else if (filterType.equals("-cube")) {
+tableNames = filterByCubes(tableNames, 
Arrays.asList(args).subList(1, args.length));
+} else if (!filterType.equals("-all")) {
+printUsageAndExit();
+}
+
+UpdateHTableHostCLI updateHTableHostCLI = new 
UpdateHTableHostCLI(tableNames);
+updateHTableHostCLI.execute();
+
+
logger.info("=");
+logger.info("Run UpdateHTableHostCLI completed;");
+
+if 

[1/2] kylin git commit: KYLIN-1219 fix conflict url pattern in kylinSecurity.xml configuration

2016-01-18 Thread shaofengshi
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 7b210fc41 -> 573c84e61


KYLIN-1219 fix conflict url pattern in kylinSecurity.xml configuration


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

Branch: refs/heads/2.x-staging
Commit: 4c2e57edc50eb0b71881ada5d1ebc5c81e8e3657
Parents: 7b210fc
Author: shaofengshi 
Authored: Tue Jan 19 09:50:19 2016 +0800
Committer: shaofengshi 
Committed: Tue Jan 19 09:57:35 2016 +0800

--
 .../src/main/java/org/apache/kylin/rest/service/AdminService.java | 1 +
 server/src/main/resources/kylinSecurity.xml   | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/4c2e57ed/server/src/main/java/org/apache/kylin/rest/service/AdminService.java
--
diff --git 
a/server/src/main/java/org/apache/kylin/rest/service/AdminService.java 
b/server/src/main/java/org/apache/kylin/rest/service/AdminService.java
index 0541ba3..1a9ae95 100644
--- a/server/src/main/java/org/apache/kylin/rest/service/AdminService.java
+++ b/server/src/main/java/org/apache/kylin/rest/service/AdminService.java
@@ -96,6 +96,7 @@ public class AdminService extends BasicService {
 }
 }
 
+@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN)
 public void cleanupStorage() {
 StorageCleanupJob job = new StorageCleanupJob();
 String[] args = new String[] { "-delete", "true" };

http://git-wip-us.apache.org/repos/asf/kylin/blob/4c2e57ed/server/src/main/resources/kylinSecurity.xml
--
diff --git a/server/src/main/resources/kylinSecurity.xml 
b/server/src/main/resources/kylinSecurity.xml
index f9884c7..4a9b929 100644
--- a/server/src/main/resources/kylinSecurity.xml
+++ b/server/src/main/resources/kylinSecurity.xml
@@ -176,9 +176,6 @@



-   
-   
-   
 





[2/2] kylin git commit: KYLIN-1327 Add from filter to UpdateHTableHostCLI

2016-01-18 Thread lidong
KYLIN-1327 Add from filter to UpdateHTableHostCLI


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

Branch: refs/heads/2.0-rc
Commit: dfcebb3eaf33b60cdf6e3b93933994e7021591e6
Parents: 203f63b
Author: lidongsjtu 
Authored: Tue Jan 19 10:40:00 2016 +0800
Committer: lidongsjtu 
Committed: Tue Jan 19 10:40:18 2016 +0800

--
 .../storage/hbase/util/UpdateHTableHostCLI.java | 32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/dfcebb3e/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
--
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
index 1ff98a4..f70ca10 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
@@ -54,9 +54,11 @@ public class UpdateHTableHostCLI {
 private List htables;
 private HBaseAdmin hbaseAdmin;
 private KylinConfig kylinConfig;
+private String oldHostValue;
 
-public UpdateHTableHostCLI(List htables) throws IOException {
+public UpdateHTableHostCLI(List htables, String oldHostValue) 
throws IOException {
 this.htables = htables;
+this.oldHostValue = oldHostValue;
 this.hbaseAdmin = new 
HBaseAdmin(HBaseConnection.getCurrentHBaseConfiguration());
 this.kylinConfig = KylinConfig.getInstanceFromEnv();
 }
@@ -67,16 +69,21 @@ public class UpdateHTableHostCLI {
 }
 
 List tableNames = 
getHTableNames(KylinConfig.getInstanceFromEnv());
-String filterType = args[0].toLowerCase();
+if (!args[0].toLowerCase().equals("-from")) {
+printUsageAndExit();
+}
+String oldHostValue = args[1].toLowerCase();
+String filterType = args[2].toLowerCase();
 if (filterType.equals("-table")) {
-tableNames = filterByTables(tableNames, 
Arrays.asList(args).subList(1, args.length));
+tableNames = filterByTables(tableNames, 
Arrays.asList(args).subList(3, args.length));
 } else if (filterType.equals("-cube")) {
-tableNames = filterByCubes(tableNames, 
Arrays.asList(args).subList(1, args.length));
+tableNames = filterByCubes(tableNames, 
Arrays.asList(args).subList(3, args.length));
 } else if (!filterType.equals("-all")) {
 printUsageAndExit();
 }
+logger.info("These htables are needed to be updated: " + 
StringUtils.join(tableNames, ","));
 
-UpdateHTableHostCLI updateHTableHostCLI = new 
UpdateHTableHostCLI(tableNames);
+UpdateHTableHostCLI updateHTableHostCLI = new 
UpdateHTableHostCLI(tableNames, oldHostValue);
 updateHTableHostCLI.execute();
 
 
logger.info("=");
@@ -104,7 +111,7 @@ public class UpdateHTableHostCLI {
 }
 
 private static void printUsageAndExit() {
-logger.info("Usage: exec -all|-cube cubeA,cubeB|-table tableA,tableB");
+logger.info("Usage: exec -from oldHostValue -all|-cube 
cubeA,cubeB|-table tableA,tableB");
 System.exit(0);
 }
 
@@ -172,17 +179,20 @@ public class UpdateHTableHostCLI {
 
 private void updateHtable(String tableName) throws IOException {
 HTableDescriptor desc = 
hbaseAdmin.getTableDescriptor(TableName.valueOf(tableName));
-hbaseAdmin.disableTable(tableName);
-desc.setValue(IRealizationConstants.HTableTag, 
kylinConfig.getMetadataUrlPrefix());
-hbaseAdmin.modifyTable(tableName, desc);
-hbaseAdmin.enableTable(tableName);
+if 
(oldHostValue.equals(desc.getValue(kylinConfig.getMetadataUrlPrefix( {
+desc.setValue(IRealizationConstants.HTableTag, 
kylinConfig.getMetadataUrlPrefix());
+hbaseAdmin.disableTable(tableName);
+hbaseAdmin.modifyTable(tableName, desc);
+hbaseAdmin.enableTable(tableName);
+
+updatedResources.add(tableName);
+}
 }
 
 public void execute() {
 for (String htable : htables) {
 try {
 updateHtable(htable);
-updatedResources.add(htable);
 } catch (IOException ex) {
 ex.printStackTrace();
 errorMsgs.add("Update HTable[" + htable + "] failed: " + 

kylin git commit: minor, removed unused pom files

2016-01-18 Thread lidong
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc dfcebb3ea -> d3b97e25e


minor, removed unused pom files


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

Branch: refs/heads/2.0-rc
Commit: d3b97e25efd42558322e8f0f1b84e25293bf4752
Parents: dfcebb3
Author: lidongsjtu 
Authored: Tue Jan 19 10:54:38 2016 +0800
Committer: lidongsjtu 
Committed: Tue Jan 19 10:54:38 2016 +0800

--
 cube/pom.xml | 186 --
 metadata/pom.xml | 156 --
 monitor/pom.xml  | 152 -
 3 files changed, 494 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/d3b97e25/cube/pom.xml
--
diff --git a/cube/pom.xml b/cube/pom.xml
deleted file mode 100644
index 7e23dea..000
--- a/cube/pom.xml
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
-http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
-4.0.0
-
-kylin-cube
-jar
-Kylin:Cube
-
-
-org.apache.kylin
-kylin
-1.1.1-incubating-SNAPSHOT
-
-
-
-
-
-org.apache.kylin
-kylin-common
-test-jar
-test
-${project.parent.version}
-
-
-
-
-org.apache.kylin
-kylin-metadata
-${project.parent.version}
-
-
-org.apache.kylin
-kylin-dictionary
-${project.parent.version}
-
-
-
-commons-cli
-commons-cli
-
-
-commons-lang
-commons-lang
-
-
-commons-io
-commons-io
-
-
-log4j
-log4j
-
-
-com.fasterxml.jackson.core
-jackson-databind
-
-
-commons-httpclient
-commons-httpclient
-
-
-com.google.guava
-guava
-
-
-com.ning
-compress-lzf
-
-
-org.roaringbitmap
-RoaringBitmap
-
-
-
-
-
-
-org.apache.hadoop
-hadoop-common
-provided
-
-
-org.apache.hadoop
-hadoop-annotations
-provided
-
-
-org.apache.hadoop
-hadoop-mapreduce-client-core
-provided
-
-
-org.apache.hadoop
-hadoop-minicluster
-test
-
-
-org.apache.mrunit
-mrunit
-hadoop2
-test
-
-
-org.apache.hbase
-hbase-hadoop2-compat
-provided
-
-
-org.apache.hbase
-hbase-common
-provided
-
-
-org.apache.hbase
-hbase-client
-provided
-
-
-org.apache.hbase
-hbase-server
-provided
-
-
-
-org.apache.hadoop
-hadoop-mapreduce-client-jobclient
-
-
-
-
-org.apache.hadoop
-hadoop-mapreduce-client-jobclient
-provided
-
-
-junit
-junit
-test
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/kylin/blob/d3b97e25/metadata/pom.xml
--
diff --git a/metadata/pom.xml b/metadata/pom.xml
deleted file mode 100644
index 49db6b9..000
--- a/metadata/pom.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
-
-http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
-4.0.0
-
-kylin-metadata
-jar
-Kylin:Metadata
-
-
-org.apache.kylin
-kylin
-1.1.1-incubating-SNAPSHOT
-
-
-
-
-
-
-
-org.apache.kylin
-kylin-common
-${project.parent.version}
-
-
-
-org.apache.kylin
-kylin-common
-test-jar
-test
-${project.parent.version}
-
-

kylin git commit: minor,create model,cube permission bug fix

2016-01-18 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 450e4cb4e -> 4379ecb69


minor,create model,cube permission bug fix


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

Branch: refs/heads/2.0-rc
Commit: 4379ecb6901d7c7d33d1cc8723e3ce823da3e75b
Parents: 450e4cb
Author: jian 
Authored: Tue Jan 19 12:52:54 2016 +0800
Committer: jian 
Committed: Tue Jan 19 12:53:20 2016 +0800

--
 webapp/app/partials/models/models_tree.html | 25 ++--
 1 file changed, 6 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/4379ecb6/webapp/app/partials/models/models_tree.html
--
diff --git a/webapp/app/partials/models/models_tree.html 
b/webapp/app/partials/models/models_tree.html
index 1368b40..a568f40 100644
--- a/webapp/app/partials/models/models_tree.html
+++ b/webapp/app/partials/models/models_tree.html
@@ -18,18 +18,6 @@
 
 
 
-
-
-
-  
-
-
-
-
-
-
-
-  
   
 
 
@@ -37,11 +25,12 @@
   
 
 
-  
-New 
Model
+  
+New Model
   
-  
-New Cube
+  
+  
+New Cube
   
 
 
@@ -58,12 +47,10 @@
 
   
 {{model.name}}
-
-
 
 
 
-  
+  
   
 
 



[1/2] kylin git commit: KYLIN-1329 Bug fix for ACL exception when deleting model

2016-01-18 Thread lidong
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 32bdcdbd3 -> dfcebb3ea


KYLIN-1329 Bug fix for ACL exception when deleting model


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

Branch: refs/heads/2.0-rc
Commit: 203f63baa0fa0e4cae3a5cabe1dfedbd8e3c0d8d
Parents: 32bdcdb
Author: lidongsjtu 
Authored: Tue Jan 19 10:29:22 2016 +0800
Committer: lidongsjtu 
Committed: Tue Jan 19 10:40:17 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/kylin/blob/203f63ba/server/src/main/java/org/apache/kylin/rest/service/AccessService.java
--
diff --git 
a/server/src/main/java/org/apache/kylin/rest/service/AccessService.java 
b/server/src/main/java/org/apache/kylin/rest/service/AccessService.java
index cd93eba..5370bba 100644
--- a/server/src/main/java/org/apache/kylin/rest/service/AccessService.java
+++ b/server/src/main/java/org/apache/kylin/rest/service/AccessService.java
@@ -219,6 +219,10 @@ public class AccessService {
 public void clean(AclEntity ae, boolean deleteChildren) {
 Assert.notNull(ae, "Acl domain object required");
 
+// For those may have null uuid, like DataModel, won't delete Acl.
+if (ae.getId() == null)
+return;
+
 ObjectIdentity objectIdentity = new ObjectIdentityImpl(ae.getClass(), 
ae.getId());
 
 try {



kylin git commit: fix issues in 2.0 upgrade, part 2

2016-01-18 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 4646cdb25 -> ae3bab684


fix issues in 2.0 upgrade, part 2


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

Branch: refs/heads/2.0-rc
Commit: ae3bab68489a37652513029daac0c8a156b02f87
Parents: 4646cdb
Author: honma 
Authored: Tue Jan 19 13:48:35 2016 +0800
Committer: honma 
Committed: Tue Jan 19 13:48:41 2016 +0800

--
 .../java/org/apache/kylin/cube/cuboid/CuboidTest.java |  2 +-
 .../storage/hbase/cube/v2/CubeHBaseEndpointRPC.java   | 14 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/ae3bab68/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidTest.java
--
diff --git 
a/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidTest.java 
b/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidTest.java
index c17ee01..90ec655 100644
--- a/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidTest.java
+++ b/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidTest.java
@@ -148,7 +148,7 @@ public class CuboidTest extends LocalFileMetadataTestCase {
 Cuboid cuboid;
 
 cuboid = Cuboid.findById(cube, 0);
-assertEquals(toLong("100111000"), cuboid.getId());
+assertEquals(toLong("10100"), cuboid.getId());
 
 cuboid = Cuboid.findById(cube, 1);
 assertEquals(toLong("10111"), cuboid.getId());

http://git-wip-us.apache.org/repos/asf/kylin/blob/ae3bab68/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
--
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
index 5cca195..d6ef16c 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
@@ -255,11 +255,11 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC {
 final ExpectedSizeIterator epResultItr = new 
ExpectedSizeIterator(scanRequests.size() * shardNum);
 
 for (final Pair epRange : 
getEPKeyRanges(cuboidBaseShard, shardNum, totalShards)) {
-for (int i = 0; i < scanRequests.size(); ++i) {
-final int scanIndex = i;
-executorService.submit(new Runnable() {
-@Override
-public void run() {
+executorService.submit(new Runnable() {
+@Override
+public void run() {
+for (int i = 0; i < scanRequests.size(); ++i) {
+int scanIndex = i;
 CubeVisitProtos.CubeVisitRequest.Builder builder = 
CubeVisitProtos.CubeVisitRequest.newBuilder();
 
builder.setGtScanRequest(scanRequestByteStrings.get(scanIndex)).setHbaseRawScan(rawScanByteStrings.get(scanIndex));
 for (IntList intList : hbaseColumnsToGTIntList) {
@@ -285,8 +285,8 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC {
 }
 }
 }
-});
-}
+}
+});
 }
 
 return new EndpointResultsAsGTScanner(fullGTInfo, epResultItr, 
scanRequests.get(0).getColumns(), totalScannedCount.get());



kylin git commit: KYLIN-1328 add break after remove model cache

2016-01-18 Thread lidong
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 000d883b1 -> ea95e6b0d


KYLIN-1328 add break after remove model cache


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

Branch: refs/heads/2.x-staging
Commit: ea95e6b0dccb93c976ada7a1d403b9909a860b94
Parents: 000d883
Author: lidongsjtu 
Authored: Tue Jan 19 15:30:32 2016 +0800
Committer: lidongsjtu 
Committed: Tue Jan 19 15:32:04 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/kylin/blob/ea95e6b0/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 27650b2..83b9ac7 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
@@ -262,6 +262,7 @@ public class CacheService extends BasicService {
 throw new UnsupportedOperationException(log);
 case DATA_MODEL:
 getMetadataManager().removeModelCache(cacheKey);
+break;
 default:
 throw new RuntimeException("invalid cacheType:" + cacheType);
 }



[1/3] kylin git commit: enable filter in ResourceTool

2016-01-18 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 573c84e61 -> 000d883b1


enable filter in ResourceTool


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

Branch: refs/heads/2.x-staging
Commit: a7923b9698c1ca0e9677759744ef8a64996b1aaa
Parents: 573c84e
Author: honma 
Authored: Tue Jan 19 15:05:38 2016 +0800
Committer: honma 
Committed: Tue Jan 19 15:05:38 2016 +0800

--
 .../kylin/common/persistence/ResourceTool.java  | 31 ++--
 1 file changed, 22 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/a7923b96/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java
--
diff --git 
a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java
 
b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java
index c3038dd..4a23ba3 100644
--- 
a/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java
+++ 
b/core-common/src/main/java/org/apache/kylin/common/persistence/ResourceTool.java
@@ -26,6 +26,7 @@ import org.apache.kylin.common.util.StringUtil;
 
 public class ResourceTool {
 
+private static String[] includes = null;
 private static String[] excludes = null;
 
 public static void main(String[] args) throws IOException {
@@ -38,6 +39,10 @@ public class ResourceTool {
 return;
 }
 
+String include = System.getProperty("include");
+if (include != null) {
+includes = include.split("\\s*,\\s*");
+}
 String exclude = System.getProperty("exclude");
 if (exclude != null) {
 excludes = exclude.split("\\s*,\\s*");
@@ -83,7 +88,7 @@ public class ResourceTool {
 
 // case of resource (not a folder)
 if (children == null) {
-if (matchExclude(path) == false) {
+if (matchFilter(path)) {
 RawResource res = src.getResource(path);
 if (res != null) {
 dst.putResource(path, res.inputStream, res.timestamp);
@@ -100,14 +105,22 @@ public class ResourceTool {
 }
 }
 
-private static boolean matchExclude(String path) {
-if (excludes == null)
-return false;
-for (String exclude : excludes) {
-if (path.startsWith(exclude))
-return true;
+private static boolean matchFilter(String path) {
+if (includes != null) {
+boolean in = false;
+for (String include : includes) {
+in = in || path.startsWith(include);
+}
+if (!in)
+return false;
+}
+if (excludes != null) {
+for (String exclude : excludes) {
+if (path.startsWith(exclude))
+return false;
+}
 }
-return false;
+return true;
 }
 
 public static void reset(KylinConfig config) throws IOException {
@@ -118,7 +131,7 @@ public class ResourceTool {
 private static void resetR(ResourceStore store, String path) throws 
IOException {
 ArrayList children = store.listResources(path);
 if (children == null) { // path is a resource (not a folder)
-if (matchExclude(path) == false) {
+if (matchFilter(path)) {
 store.deleteResource(path);
 }
 } else {