[5/6] kylin git commit: minor, move all hll and topn related code to core-metadata

2016-01-27 Thread mahongbin
minor, move all hll and topn related code to core-metadata


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

Branch: refs/heads/2.x-staging
Commit: daa294b679cf857422acce9cf2c86b6c950a5b67
Parents: 5f4c581
Author: honma 
Authored: Wed Jan 27 22:19:00 2016 +0800
Committer: honma 
Committed: Wed Jan 27 22:19:00 2016 +0800

--
 core-common/pom.xml |   6 +-
 .../common/hll/HyperLogLogPlusCounter.java  | 340 ---
 .../kylin/common/hll/HyperLogLogPlusTable.java  | 199 ---
 .../org/apache/kylin/common/topn/Counter.java   |  83 -
 .../common/topn/DoubleDeltaSerializer.java  | 193 ---
 .../kylin/common/topn/DoublyLinkedList.java | 141 
 .../org/apache/kylin/common/topn/ListNode2.java |  51 ---
 .../apache/kylin/common/topn/TopNCounter.java   | 335 --
 .../common/hll/HyperLogLogCounterTest.java  | 245 -
 .../common/topn/DoubleDeltaSerializerTest.java  |  85 -
 .../kylin/common/topn/TopNCounterBasicTest.java | 132 ---
 .../common/topn/TopNCounterCombinationTest.java |  62 
 .../kylin/common/topn/TopNCounterTest.java  | 306 -
 .../cube/inmemcubing/InMemCubeBuilder.java  |   4 +-
 .../org/apache/kylin/cube/util/CubingUtils.java |   2 +-
 .../apache/kylin/gridtable/UnitTestSupport.java |   2 +-
 .../gridtable/AggregationCacheMemSizeTest.java  |   2 +-
 .../metadata/measure/MeasureCodecTest.java  |  18 +-
 core-metadata/pom.xml   |   5 +
 .../kylin/measure/hllc/HLLCAggregator.java  |   1 -
 .../kylin/measure/hllc/HLLCMeasureType.java |   1 -
 .../kylin/measure/hllc/HLLCSerializer.java  |   1 -
 .../measure/hllc/HLLDistinctCountAggFunc.java   |   1 -
 .../measure/hllc/HyperLogLogPlusCounter.java| 340 +++
 .../measure/hllc/HyperLogLogPlusTable.java  | 199 +++
 .../org/apache/kylin/measure/topn/Counter.java  |  83 +
 .../measure/topn/DoubleDeltaSerializer.java | 193 +++
 .../kylin/measure/topn/DoublyLinkedList.java| 141 
 .../apache/kylin/measure/topn/ListNode2.java|  51 +++
 .../kylin/measure/topn/TopNAggregator.java  |   1 -
 .../apache/kylin/measure/topn/TopNCounter.java  | 335 ++
 .../measure/topn/TopNCounterSerializer.java |   3 -
 .../kylin/measure/topn/TopNMeasureType.java |   2 -
 .../topn/TopNCounterSerializerTest.java |   2 +-
 .../measure/hll/HyperLogLogCounterTest.java | 245 +
 .../measure/topn/DoubleDeltaSerializerTest.java |  85 +
 .../measure/topn/TopNCounterBasicTest.java  | 131 +++
 .../topn/TopNCounterCombinationTest.java|  62 
 .../kylin/measure/topn/TopNCounterTest.java | 306 +
 .../kylin/engine/mr/common/CubeStatsReader.java |   2 +-
 .../kylin/engine/mr/common/CuboidStatsUtil.java |   2 +-
 .../mr/steps/FactDistinctColumnsReducer.java|   2 +-
 .../mr/steps/FactDistinctHiveColumnsMapper.java |   2 +-
 .../engine/mr/steps/MergeStatisticsStep.java|   2 +-
 .../kylin/engine/mr/steps/CubeSamplingTest.java |   3 +-
 .../steps/FactDistinctColumnsReducerTest.java   |   2 +-
 .../apache/kylin/engine/spark/SparkCubing.java  |   3 +-
 .../engine/streaming/IStreamingOutput.java  |   2 +-
 .../streaming/OneOffStreamingBuilder.java   |   2 +-
 .../engine/streaming/StreamingBatchBuilder.java |   2 +-
 .../streaming/cube/StreamingCubeBuilder.java|   2 +-
 .../invertedindex/measure/FixedHLLCodec.java|   2 +-
 .../cardinality/ColumnCardinalityMapper.java|   2 +-
 .../cardinality/ColumnCardinalityReducer.java   |   2 +-
 .../ColumnCardinalityReducerTest.java   |   4 +-
 .../endpoint/EndpointAggregators.java   |   2 +-
 .../hbase/steps/HBaseStreamingOutput.java   |   2 +-
 57 files changed, 2210 insertions(+), 2224 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/daa294b6/core-common/pom.xml
--
diff --git a/core-common/pom.xml b/core-common/pom.xml
index 28566d6..bfdc662 100644
--- a/core-common/pom.xml
+++ b/core-common/pom.xml
@@ -109,11 +109,7 @@
 
 
 
-
-org.apache.commons
-commons-math3
-test
-
+   
 
 junit
 junit

http://git-wip-us.apache.org/repos/asf/kylin/blob/daa294b6/core-common/src/main/java/org/apache/kylin/common/hll/HyperLogLogPlusCounter.java
--
diff --git 

[4/6] kylin git commit: minor, move all hll and topn related code to core-metadata

2016-01-27 Thread mahongbin
http://git-wip-us.apache.org/repos/asf/kylin/blob/daa294b6/core-common/src/main/java/org/apache/kylin/common/hll/HyperLogLogPlusTable.java
--
diff --git 
a/core-common/src/main/java/org/apache/kylin/common/hll/HyperLogLogPlusTable.java
 
b/core-common/src/main/java/org/apache/kylin/common/hll/HyperLogLogPlusTable.java
deleted file mode 100644
index 25ee404..000
--- 
a/core-common/src/main/java/org/apache/kylin/common/hll/HyperLogLogPlusTable.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * 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.common.hll;
-
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-/**
- * @author xjiang
- * 
- */
-public class HyperLogLogPlusTable {
-
-// threshold and bias data taken from google's bias correction data set:
-// 
https://docs.google.com/document/d/1gyjfMHy43U9OWBXxfaeG-3MjGzejW1dlpyMwEYAAWEI/view?fullscreen#
-public static final double[] thresholdData = { 10, 20, 40, 80, 220, 400, 
900, 1800, 3100, 6500, 15500, 2, 5, 12, 35 };
-
-public static final double[][] rawEstimateData = {
-// precision 4
-{ 11, 11.717, 12.207, 12.7896, 13.2882, 13.8204, 14.3772, 14.9342, 
15.5202, 16.161, 16.7722, 17.4636, 18.0396, 18.6766, 19.3566, 20.0454, 20.7936, 
21.4856, 22.2666, 22.9946, 23.766, 24.4692, 25.3638, 26.0764, 26.7864, 27.7602, 
28.4814, 29.433, 30.2926, 31.0664, 31.9996, 32.7956, 33.5366, 34.5894, 35.5738, 
36.2698, 37.3682, 38.0544, 39.2342, 40.0108, 40.7966, 41.9298, 42.8704, 
43.6358, 44.5194, 45.773, 46.6772, 47.6174, 48.4888, 49.3304, 50.2506, 51.4996, 
52.3824, 53.3078, 54.3984, 55.5838, 56.6618, 57.2174, 58.3514, 59.0802, 
60.1482, 61.0376, 62.3598, 62.8078, 63.9744, 64.914, 65.781, 67.1806, 68.0594, 
68.8446, 69.7928, 70.8248, 71.8324, 72.8598, 73.6246, 74.7014, 75.393, 76.6708, 
77.2394, },
-// precision 5
-{ 23, 23.1194, 23.8208, 24.2318, 24.77, 25.2436, 25.7774, 26.2848, 
26.8224, 27.3742, 27.9336, 28.503, 29.0494, 29.6292, 30.2124, 30.798, 31.367, 
31.9728, 32.5944, 33.217, 33.8438, 34.3696, 35.0956, 35.7044, 36.324, 37.0668, 
37.6698, 38.3644, 39.049, 39.6918, 40.4146, 41.082, 41.687, 42.5398, 43.2462, 
43.857, 44.6606, 45.4168, 46.1248, 46.9222, 47.6804, 48.447, 49.3454, 49.9594, 
50.7636, 51.5776, 52.331, 53.19, 53.9676, 54.7564, 55.5314, 56.4442, 57.3708, 
57.9774, 58.9624, 59.8796, 60.755, 61.472, 62.2076, 63.1024, 63.8908, 64.7338, 
65.7728, 66.629, 67.413, 68.3266, 69.1524, 70.2642, 71.1806, 72.0566, 72.9192, 
73.7598, 74.3516, 75.5802, 76.4386, 77.4916, 78.1524, 79.1892, 79.8414, 
80.8798, 81.8376, 82.4698, 83.7656, 84.331, 85.5914, 86.6012, 87.7016, 88.5582, 
89.3394, 90.3544, 91.4912, 92.308, 93.3552, 93.9746, 95.2052, 95.727, 97.1322, 
98.3944, 98.7588, 100.242, 101.1914, 102.2538, 102.8776, 103.6292, 105.1932, 
105.9152, 107.0868, 107.6728, 108.7144, 110.3114, 110.8716,
-111.245, 112.7908, 113.7064, 114.636, 115.7464, 116.1788, 
117.7464, 118.4896, 119.6166, 120.5082, 121.7798, 122.9028, 123.4426, 124.8854, 
125.705, 126.4652, 128.3464, 128.3462, 130.0398, 131.0342, 131.0042, 132.4766, 
133.511, 134.7252, 135.425, 136.5172, 138.0572, 138.6694, 139.3712, 140.8598, 
141.4594, 142.554, 143.4006, 144.7374, 146.1634, 146.8994, 147.605, 147.9304, 
149.1636, 150.2468, 151.5876, 152.2096, 153.7032, 154.7146, 155.807, 156.9228, 
157.0372, 158.5852, },
-// precision 6
-{ 46, 46.1902, 47.271, 47.8358, 48.8142, 49.2854, 50.317, 51.354, 
51.8924, 52.9436, 53.4596, 54.5262, 55.6248, 56.1574, 57.2822, 57.837, 58.9636, 
60.074, 60.7042, 61.7976, 62.4772, 63.6564, 64.7942, 65.5004, 66.686, 67.291, 
68.5672, 69.8556, 70.4982, 71.8204, 72.4252, 73.7744, 75.0786, 75.8344, 
77.0294, 77.8098, 79.0794, 80.5732, 81.1878, 82.5648, 83.2902, 84.6784, 
85.3352, 86.8946, 88.3712, 89.0852, 90.499, 91.2686, 92.6844, 94.2234, 94.9732, 
96.3356, 97.2286, 98.7262, 100.3284, 101.1048, 102.5962, 103.3562, 105.1272, 
106.4184, 107.4974, 109.0822, 109.856, 111.48, 113.2834, 114.0208, 115.637, 
116.5174, 118.0576, 119.7476, 120.427, 122.1326, 123.2372, 125.2788, 126.6776, 
127.7926, 129.1952, 129.9564, 131.6454, 

[6/6] kylin git commit: minor, check hdfs permission at build cube

2016-01-27 Thread mahongbin
minor, check hdfs permission at build cube


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

Branch: refs/heads/2.x-staging
Commit: f4667226d1ba34471c27192b95a0494f5f991d88
Parents: daa294b
Author: honma 
Authored: Thu Jan 28 10:34:25 2016 +0800
Committer: honma 
Committed: Thu Jan 28 10:34:25 2016 +0800

--
 .../kylin/provision/BuildCubeWithEngine.java | 19 +++
 1 file changed, 19 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/f4667226/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java
--
diff --git 
a/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java 
b/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java
index 32facf1..f44fc38 100644
--- a/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java
+++ b/kylin-it/src/test/java/org/apache/kylin/provision/BuildCubeWithEngine.java
@@ -19,6 +19,7 @@
 package org.apache.kylin.provision;
 
 import java.io.File;
+import java.io.IOException;
 import java.lang.reflect.Method;
 import java.text.SimpleDateFormat;
 import java.util.List;
@@ -32,6 +33,9 @@ import java.util.concurrent.Future;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.common.util.AbstractKylinTestCase;
@@ -43,6 +47,7 @@ import org.apache.kylin.cube.CubeSegment;
 import org.apache.kylin.cube.CubeUpdate;
 import org.apache.kylin.engine.EngineFactory;
 import org.apache.kylin.engine.mr.CubingJob;
+import org.apache.kylin.engine.mr.HadoopUtil;
 import org.apache.kylin.job.DeployUtil;
 import org.apache.kylin.job.engine.JobEngineConfig;
 import org.apache.kylin.job.execution.AbstractExecutable;
@@ -93,6 +98,20 @@ public class BuildCubeWithEngine {
 }
 
 
HBaseMetadataTestCase.staticCreateTestMetadata(AbstractKylinTestCase.SANDBOX_TEST_DATA);
+
+try {
+//check hdfs permission
+Configuration hconf = HadoopUtil.getCurrentConfiguration();
+FileSystem fileSystem = FileSystem.get(hconf);
+String hdfsWorkingDirectory = 
KylinConfig.getInstanceFromEnv().getHdfsWorkingDirectory();
+Path coprocessorDir = new Path(hdfsWorkingDirectory);
+boolean success = fileSystem.mkdirs(coprocessorDir);
+if (!success) {
+throw new IOException("mkdir fails");
+}
+} catch (IOException e) {
+throw new RuntimeException("failed to create 
kylin.hdfs.working.dir, Please make sure the user has right to access " + 
KylinConfig.getInstanceFromEnv().getHdfsWorkingDirectory(), e);
+}
 }
 
 public void before() throws Exception {



[1/6] kylin git commit: minor, move all hll and topn related code to core-metadata

2016-01-27 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 5f4c581e6 -> f4667226d


http://git-wip-us.apache.org/repos/asf/kylin/blob/daa294b6/core-metadata/src/main/java/org/apache/kylin/measure/topn/DoublyLinkedList.java
--
diff --git 
a/core-metadata/src/main/java/org/apache/kylin/measure/topn/DoublyLinkedList.java
 
b/core-metadata/src/main/java/org/apache/kylin/measure/topn/DoublyLinkedList.java
new file mode 100644
index 000..03e4066
--- /dev/null
+++ 
b/core-metadata/src/main/java/org/apache/kylin/measure/topn/DoublyLinkedList.java
@@ -0,0 +1,141 @@
+/*
+ * 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.measure.topn;
+
+
+/**
+ * Modified from DoublyLinkedList.java in https://github.com/addthis/stream-lib
+ * 
+ * @param 
+ */
+public class DoublyLinkedList {
+
+private int size = 0;
+private ListNode2 tail;
+private ListNode2 head;
+
+/**
+ * Append to head of list
+ */
+public ListNode2 add(T value) {
+ListNode2 node = new ListNode2(value);
+add(node);
+
+return node;
+}
+
+/**
+ * Prepend to tail of list
+ */
+public ListNode2 enqueue(T value) {
+ListNode2 node = new ListNode2(value);
+   
+return enqueue(node);
+}
+
+public ListNode2 enqueue(ListNode2 node) {
+if (size++ == 0) {
+head = node;
+} else {
+node.next = tail;
+tail.prev = node;
+}
+
+tail = node;
+
+return node;
+}
+
+public void add(ListNode2 node) {
+node.prev = head;
+node.next = null;
+
+if (size++ == 0) {
+tail = node;
+} else {
+head.next = node;
+}
+
+head = node;
+}
+
+public ListNode2 addAfter(ListNode2 node, T value) {
+ListNode2 newNode = new ListNode2(value);
+addAfter(node, newNode);
+return newNode;
+}
+
+public void addAfter(ListNode2 node, ListNode2 newNode) {
+newNode.next = node.next;
+newNode.prev = node;
+node.next = newNode;
+if (newNode.next == null) {
+head = newNode;
+} else {
+newNode.next.prev = newNode;
+}
+size++;
+}
+
+
+public void addBefore(ListNode2 node, ListNode2 newNode) {
+newNode.prev = node.prev;
+newNode.next = node;
+node.prev = newNode;
+if (newNode.prev == null) {
+tail = newNode;
+} else {
+newNode.prev.next = newNode;
+}
+size++;
+}
+
+public void remove(ListNode2 node) {
+if (node == tail) {
+tail = node.next;
+} else {
+node.prev.next = node.next;
+}
+
+if (node == head) {
+head = node.prev;
+} else {
+node.next.prev = node.prev;
+}
+size--;
+}
+
+public int size() {
+return size;
+}
+
+
+public ListNode2 head() {
+return head;
+}
+
+public ListNode2 tail() {
+return tail;
+}
+
+public boolean isEmpty() {
+return size == 0;
+}
+
+}

http://git-wip-us.apache.org/repos/asf/kylin/blob/daa294b6/core-metadata/src/main/java/org/apache/kylin/measure/topn/ListNode2.java
--
diff --git 
a/core-metadata/src/main/java/org/apache/kylin/measure/topn/ListNode2.java 
b/core-metadata/src/main/java/org/apache/kylin/measure/topn/ListNode2.java
new file mode 100644
index 000..b2f47c9
--- /dev/null
+++ b/core-metadata/src/main/java/org/apache/kylin/measure/topn/ListNode2.java
@@ -0,0 +1,51 @@
+/*
+ * 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
+ * 
+ * 

kylin git commit: minor, fix jobs page ui display issue

2016-01-27 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging bda79cac4 -> a29faec53


minor, fix jobs page ui display issue


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

Branch: refs/heads/2.x-staging
Commit: a29faec533909b26ac8d6a224ba9055b726c1aa7
Parents: bda79ca
Author: janzhongi 
Authored: Wed Jan 27 19:40:44 2016 +0800
Committer: janzhongi 
Committed: Wed Jan 27 19:40:44 2016 +0800

--
 webapp/app/partials/jobs/jobs.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/a29faec5/webapp/app/partials/jobs/jobs.html
--
diff --git a/webapp/app/partials/jobs/jobs.html 
b/webapp/app/partials/jobs/jobs.html
index 4c2ebc3..730 100644
--- a/webapp/app/partials/jobs/jobs.html
+++ b/webapp/app/partials/jobs/jobs.html
@@ -21,7 +21,7 @@
 
 
 
-
+
 
 
 



kylin git commit: minor, UI permission for analyst update

2016-01-27 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc ec208d1ff -> 8ea8e471a


minor, UI permission for analyst update


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

Branch: refs/heads/2.0-rc
Commit: 8ea8e471a24c30ab6acc991d417a940ce12cbb29
Parents: ec208d1
Author: janzhongi 
Authored: Wed Jan 27 19:55:26 2016 +0800
Committer: janzhongi 
Committed: Wed Jan 27 19:55:26 2016 +0800

--
 webapp/app/partials/jobs/jobs.html  | 4 ++--
 webapp/app/partials/models/models.html  | 4 ++--
 webapp/app/partials/models/models_tree.html | 2 +-
 webapp/app/partials/query/query.html| 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/8ea8e471/webapp/app/partials/jobs/jobs.html
--
diff --git a/webapp/app/partials/jobs/jobs.html 
b/webapp/app/partials/jobs/jobs.html
index fca5f88..a3b8324 100644
--- a/webapp/app/partials/jobs/jobs.html
+++ b/webapp/app/partials/jobs/jobs.html
@@ -20,9 +20,9 @@
 
 
 
-
+
 
-
+  
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/8ea8e471/webapp/app/partials/models/models.html
--
diff --git a/webapp/app/partials/models/models.html 
b/webapp/app/partials/models/models.html
index 4d8c7ac..1280214 100644
--- a/webapp/app/partials/models/models.html
+++ b/webapp/app/partials/models/models.html
@@ -19,9 +19,9 @@
 
 
 
-
+
 
-
+
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/8ea8e471/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 8f76113..8201727 100644
--- a/webapp/app/partials/models/models_tree.html
+++ b/webapp/app/partials/models/models_tree.html
@@ -20,7 +20,7 @@
 
   
 
-
+
New
   
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/8ea8e471/webapp/app/partials/query/query.html
--
diff --git a/webapp/app/partials/query/query.html 
b/webapp/app/partials/query/query.html
index d34dbc7..0af08d6 100644
--- a/webapp/app/partials/query/query.html
+++ b/webapp/app/partials/query/query.html
@@ -19,9 +19,9 @@
 
 
 
-
+
 
-
+  
 
 
 



[1/2] kylin git commit: KYLIN-1341, display model json and update project permission

2016-01-27 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging cd5e21b4c -> bda79cac4


KYLIN-1341, display model json and update project permission


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

Branch: refs/heads/2.x-staging
Commit: bda79cac47b944e8ea0caaf83c4038dac5d4a60a
Parents: 85319c0
Author: janzhongi 
Authored: Wed Jan 27 19:33:42 2016 +0800
Committer: janzhongi 
Committed: Wed Jan 27 19:33:57 2016 +0800

--
 .../rest/controller/ProjectController.java  | 83 ++--
 webapp/app/js/controllers/cubeModel.js  |  7 +-
 webapp/app/partials/cubes/cube_detail.html  |  6 --
 webapp/app/partials/jobs/jobs.html  |  6 +-
 webapp/app/partials/models/model_detail.html| 13 ++-
 webapp/app/partials/models/models.html  |  4 +-
 webapp/app/partials/models/models_tree.html |  2 +-
 webapp/app/partials/query/query.html|  4 +-
 8 files changed, 61 insertions(+), 64 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/bda79cac/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
--
diff --git 
a/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java 
b/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
index 5e65b3b..980ec8c 100644
--- 
a/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
+++ 
b/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
@@ -66,13 +66,14 @@ public class ProjectController extends BasicController {
 private AccessService accessService;
 @Autowired
 private CubeService cubeService;
+
 /**
  * Get available project list
- * 
+ *
  * @return Table metadata array
  * @throws IOException
  */
-@RequestMapping(value = "", method = { RequestMethod.GET })
+@RequestMapping(value = "", method = {RequestMethod.GET})
 @ResponseBody
 public List getProjects(@RequestParam(value = "limit", 
required = false) Integer limit, @RequestParam(value = "offset", required = 
false) Integer offset) {
 return projectService.listAllProjects(limit, offset);
@@ -110,71 +111,72 @@ public class ProjectController extends BasicController {
 }
 String userName = userDetails.getUsername();
 for (ProjectInstance projectInstance : projectInstances) {
+if (projectInstance == null) {
+continue;
+}
 
 boolean hasProjectPermission = false;
 AclEntity ae = accessService.getAclEntity("ProjectInstance", 
projectInstance.getId());
 Acl projectAcl = accessService.getAcl(ae);
 //project no Acl info will be skipped
-if(projectAcl == null){
-continue;
-}
+if (projectAcl != null) {
 
-//project owner has permission
-if 
(((PrincipalSid)projectAcl.getOwner()).getPrincipal().equals(userName)) {
-readableProjects.add(projectInstance);
-continue;
-}
-
-//check project permission and role
-for (AccessControlEntry ace : projectAcl.getEntries()) {
-if( ace.getSid() instanceof PrincipalSid && 
((PrincipalSid)ace.getSid()).getPrincipal().equals(userName)) {
-hasProjectPermission = true;
+//project owner has permission
+if (((PrincipalSid) 
projectAcl.getOwner()).getPrincipal().equals(userName)) {
 readableProjects.add(projectInstance);
-break;
+continue;
+}
 
-}else if(ace.getSid() instanceof GrantedAuthoritySid){
-String projectAuthority = ((GrantedAuthoritySid) 
ace.getSid()).getGrantedAuthority();
-if(userAuthority.contains(projectAuthority)){
+//check project permission and role
+for (AccessControlEntry ace : projectAcl.getEntries()) {
+if (ace.getSid() instanceof PrincipalSid && 
((PrincipalSid) ace.getSid()).getPrincipal().equals(userName)) {
 hasProjectPermission = true;
 readableProjects.add(projectInstance);
 break;
+
+} else if (ace.getSid() instanceof GrantedAuthoritySid) {
+String projectAuthority = ((GrantedAuthoritySid) 
ace.getSid()).getGrantedAuthority();
+if 

kylin git commit: minor, set user data in listener

2016-01-27 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 2a441191d -> 201a7ed43


minor, set user data in listener


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

Branch: refs/heads/2.x-staging
Commit: 201a7ed4380733f9b7d6745102a9fafec2e6999b
Parents: 2a44119
Author: janzhongi 
Authored: Wed Jan 27 20:25:05 2016 +0800
Committer: janzhongi 
Committed: Wed Jan 27 20:25:05 2016 +0800

--
 webapp/app/js/listeners.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/201a7ed4/webapp/app/js/listeners.js
--
diff --git a/webapp/app/js/listeners.js b/webapp/app/js/listeners.js
index c35a26a..ab32a0d 100644
--- a/webapp/app/js/listeners.js
+++ b/webapp/app/js/listeners.js
@@ -27,10 +27,10 @@ KylinApp.run(function ($rootScope, $http, $location, 
UserService, Authentication
 
   $rootScope.$on("$routeChangeStart", function () {
 AuthenticationService.ping(function (data) {
+  UserService.setCurUser(data);
   if(!data.userDetails){
 $location.path(UserService.getHomePage());
   }else{
-UserService.setCurUser(data);
 //get project info when login
 if (!ProjectModel.projects.length&&!$rootScope.userAction.islogout) {
 



kylin git commit: minor,UI modeler permission update

2016-01-27 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging a29faec53 -> 2a441191d


minor,UI modeler permission update


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

Branch: refs/heads/2.x-staging
Commit: 2a441191d32eff7bb3061efe48f7087e857809bf
Parents: a29faec
Author: janzhongi 
Authored: Wed Jan 27 19:56:51 2016 +0800
Committer: janzhongi 
Committed: Wed Jan 27 19:56:51 2016 +0800

--
 webapp/app/partials/jobs/jobs.html | 2 +-
 webapp/app/partials/models/models.html | 2 +-
 webapp/app/partials/query/query.html   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/2a441191/webapp/app/partials/jobs/jobs.html
--
diff --git a/webapp/app/partials/jobs/jobs.html 
b/webapp/app/partials/jobs/jobs.html
index 730..daf4578 100644
--- a/webapp/app/partials/jobs/jobs.html
+++ b/webapp/app/partials/jobs/jobs.html
@@ -22,7 +22,7 @@
 
 
 
-
+  
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/2a441191/webapp/app/partials/models/models.html
--
diff --git a/webapp/app/partials/models/models.html 
b/webapp/app/partials/models/models.html
index c0b7a05..88cc6f3 100644
--- a/webapp/app/partials/models/models.html
+++ b/webapp/app/partials/models/models.html
@@ -21,7 +21,7 @@
 
 
 
-
+  
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/2a441191/webapp/app/partials/query/query.html
--
diff --git a/webapp/app/partials/query/query.html 
b/webapp/app/partials/query/query.html
index 7b865fc..0af08d6 100644
--- a/webapp/app/partials/query/query.html
+++ b/webapp/app/partials/query/query.html
@@ -21,7 +21,7 @@
 
 
 
-
+  
 
 
 



kylin git commit: minor, set user data in listener

2016-01-27 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 8ea8e471a -> 95970d5e1


minor, set user data in listener


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

Branch: refs/heads/2.0-rc
Commit: 95970d5e156e2d6ddf1fdf87731f89f3e6f99d9b
Parents: 8ea8e47
Author: janzhongi 
Authored: Wed Jan 27 20:23:30 2016 +0800
Committer: janzhongi 
Committed: Wed Jan 27 20:23:30 2016 +0800

--
 webapp/app/js/listeners.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/95970d5e/webapp/app/js/listeners.js
--
diff --git a/webapp/app/js/listeners.js b/webapp/app/js/listeners.js
index 556acdf..68822b5 100644
--- a/webapp/app/js/listeners.js
+++ b/webapp/app/js/listeners.js
@@ -27,10 +27,10 @@ KylinApp.run(function ($rootScope, $http, $location, 
UserService, Authentication
 
   $rootScope.$on("$routeChangeStart", function () {
   AuthenticationService.ping(function (data) {
+UserService.setCurUser(data);
 if(!data.userDetails){
   $location.path(UserService.getHomePage());
 }else{
-  UserService.setCurUser(data);
   //get project info when login
   if (!ProjectModel.projects.length&&!$rootScope.userAction.islogout) {
 



kylin git commit: KYLIN-1341, display model json and update project permission fix project acl data not exist error

2016-01-27 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 3a0e92c9a -> ec208d1ff


KYLIN-1341, display model json and update project permission fix project acl 
data not exist error


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

Branch: refs/heads/2.0-rc
Commit: ec208d1ff353aa5252282c304821c3c4aeb4edeb
Parents: 3a0e92c
Author: janzhongi 
Authored: Wed Jan 27 17:27:01 2016 +0800
Committer: janzhongi 
Committed: Wed Jan 27 17:27:01 2016 +0800

--
 .../rest/controller/ProjectController.java  | 51 ++--
 webapp/app/js/controllers/cubeModel.js  |  8 +--
 webapp/app/partials/cubes/cube_detail.html  |  7 ---
 webapp/app/partials/models/model_detail.html|  9 ++--
 4 files changed, 34 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/ec208d1f/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
--
diff --git 
a/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java 
b/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
index 07fcc91..81b9dd1 100644
--- 
a/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
+++ 
b/server/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
@@ -112,67 +112,68 @@ public class ProjectController extends BasicController {
 }
 String userName = userDetails.getUsername();
 for (ProjectInstance projectInstance : projectInstances) {
+if(projectInstance == null){
+continue;
+}
 
 boolean hasProjectPermission = false;
 AclEntity ae = accessService.getAclEntity("ProjectInstance", 
projectInstance.getId());
 Acl projectAcl = accessService.getAcl(ae);
 //project no Acl info will be skipped
-if(projectAcl == null){
-continue;
-}
+if (projectAcl != null) {
 
-//project owner has permission
-if 
(((PrincipalSid)projectAcl.getOwner()).getPrincipal().equals(userName)) {
-readableProjects.add(projectInstance);
-continue;
-}
+//project owner has permission
+if (((PrincipalSid) 
projectAcl.getOwner()).getPrincipal().equals(userName)) {
+readableProjects.add(projectInstance);
+continue;
+}
 
-//check project permission and role
-for (AccessControlEntry ace : projectAcl.getEntries()) {
-if( ace.getSid() instanceof PrincipalSid && 
((PrincipalSid)ace.getSid()).getPrincipal().equals(userName)) {
+//check project permission and role
+for (AccessControlEntry ace : projectAcl.getEntries()) {
+if (ace.getSid() instanceof PrincipalSid && 
((PrincipalSid) ace.getSid()).getPrincipal().equals(userName)) {
 hasProjectPermission = true;
 readableProjects.add(projectInstance);
 break;
 
-}else if(ace.getSid() instanceof GrantedAuthoritySid){
-String projectAuthority = ((GrantedAuthoritySid) 
ace.getSid()).getGrantedAuthority();
-if(userAuthority.contains(projectAuthority)){
-hasProjectPermission = true;
-readableProjects.add(projectInstance);
-break;
+} else if (ace.getSid() instanceof GrantedAuthoritySid) {
+String projectAuthority = ((GrantedAuthoritySid) 
ace.getSid()).getGrantedAuthority();
+if (userAuthority.contains(projectAuthority)) {
+hasProjectPermission = true;
+readableProjects.add(projectInstance);
+break;
+}
+
 }
 
 }
-
 }
 if (!hasProjectPermission) {
 List cubeInstances = 
cubeService.listAllCubes(projectInstance.getName());
 
 for (CubeInstance cubeInstance : cubeInstances) {
-if(cubeInstance == null){
+if (cubeInstance == null) {
 continue;
 }
 boolean hasCubePermission = false;
 AclEntity cubeAe = 
accessService.getAclEntity("CubeInstance", cubeInstance.getId());
 Acl 

kylin git commit: KYLIN-1355 Fix package version bug and add script to build a java-hotfix package, instead of a full package

2016-01-27 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 91ae3fc84 -> 5f4c581e6


KYLIN-1355 Fix package version bug and add script to build a java-hotfix 
package, instead of a full package

Changes:
* Add build/script/package_libs.sh  to build library jars only tarball
* Fix version parsing bug in build/script/package.sh

Signed-off-by: honma 


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

Branch: refs/heads/2.x-staging
Commit: 5f4c581e682835e931a7716adec7f02cfa1a51c3
Parents: 91ae3fc
Author: Hao Chen 
Authored: Wed Jan 27 17:44:11 2016 +0800
Committer: honma 
Committed: Wed Jan 27 21:53:32 2016 +0800

--
 build/script/package.sh  |   2 +-
 build/script/package_libs.sh | 100 ++
 2 files changed, 101 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/5f4c581e/build/script/package.sh
--
diff --git a/build/script/package.sh b/build/script/package.sh
index a505501..53c2908 100755
--- a/build/script/package.sh
+++ b/build/script/package.sh
@@ -50,7 +50,7 @@ fi
 
 dir=$(dirname ${0})
 cd ${dir}/../..
-version=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate 
-Dexpression=project.version | grep -E '^[0-9]+\.[0-9]+\.[0-9]+'`
+version=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate 
-Dexpression=project.version | grep -v '\['`
 echo "kylin version: ${version}"
 export version
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/5f4c581e/build/script/package_libs.sh
--
diff --git a/build/script/package_libs.sh b/build/script/package_libs.sh
new file mode 100755
index 000..71c1e8c
--- /dev/null
+++ b/build/script/package_libs.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+#
+# 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.
+#
+
+echo "Checking maven..."
+
+if [ -z "$(command -v mvn)" ]
+then
+echo "Please install maven first so that Kylin packaging can proceed"
+exit 1
+else
+echo "maven check passed"
+fi
+
+echo "Checking git..."
+
+if [ -z "$(command -v git)" ]
+then
+echo "Please install git first so that Kylin packaging can proceed"
+exit 1
+else
+echo "git check passed"
+fi
+
+dir=$(dirname ${0})
+cd ${dir}/../..
+version=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate 
-Dexpression=project.version | grep -v '\['`
+
+if [ "$version" == "" ];then
+   echo "Failed to identify kylin version (current: `pwd`)"
+   exit 1
+fi
+
+echo "kylin version: ${version}"
+export version
+
+#commit id
+cat << EOF > build/commit_SHA1
+# 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.
+#
+EOF
+git rev-parse HEAD >> build/commit_SHA1
+
+echo "package libraries"
+mvn clean install -DskipTests   || { exit 1; }
+
+echo "copy libraries"
+rm -rf build/lib
+mkdir build/lib
+cp assembly/target/kylin-assembly-${version}-job.jar 
build/lib/kylin-job-${version}.jar
+cp storage-hbase/target/kylin-storage-hbase-${version}-coprocessor.jar 
build/lib/kylin-coprocessor-${version}.jar
+cp 

[3/3] kylin git commit: KYLIN-1355 Fix package version bug and add script to build a java-hotfix package, instead of a full package

2016-01-27 Thread mahongbin
KYLIN-1355 Fix package version bug and add script to build a java-hotfix 
package, instead of a full package

Changes:
* Add build/script/package_libs.sh  to build library jars only tarball
* Fix version parsing bug in build/script/package.sh

Signed-off-by: honma 


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

Branch: refs/heads/2.0-rc
Commit: 5bcb78d066bc02b449d6c946396d0e74d43d1f41
Parents: 7c62e36
Author: Hao Chen 
Authored: Wed Jan 27 17:44:11 2016 +0800
Committer: honma 
Committed: Wed Jan 27 21:52:55 2016 +0800

--
 build/script/package.sh  |   2 +-
 build/script/package_libs.sh | 100 ++
 2 files changed, 101 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/5bcb78d0/build/script/package.sh
--
diff --git a/build/script/package.sh b/build/script/package.sh
index a505501..53c2908 100755
--- a/build/script/package.sh
+++ b/build/script/package.sh
@@ -50,7 +50,7 @@ fi
 
 dir=$(dirname ${0})
 cd ${dir}/../..
-version=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate 
-Dexpression=project.version | grep -E '^[0-9]+\.[0-9]+\.[0-9]+'`
+version=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate 
-Dexpression=project.version | grep -v '\['`
 echo "kylin version: ${version}"
 export version
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/5bcb78d0/build/script/package_libs.sh
--
diff --git a/build/script/package_libs.sh b/build/script/package_libs.sh
new file mode 100755
index 000..71c1e8c
--- /dev/null
+++ b/build/script/package_libs.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+#
+# 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.
+#
+
+echo "Checking maven..."
+
+if [ -z "$(command -v mvn)" ]
+then
+echo "Please install maven first so that Kylin packaging can proceed"
+exit 1
+else
+echo "maven check passed"
+fi
+
+echo "Checking git..."
+
+if [ -z "$(command -v git)" ]
+then
+echo "Please install git first so that Kylin packaging can proceed"
+exit 1
+else
+echo "git check passed"
+fi
+
+dir=$(dirname ${0})
+cd ${dir}/../..
+version=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate 
-Dexpression=project.version | grep -v '\['`
+
+if [ "$version" == "" ];then
+   echo "Failed to identify kylin version (current: `pwd`)"
+   exit 1
+fi
+
+echo "kylin version: ${version}"
+export version
+
+#commit id
+cat << EOF > build/commit_SHA1
+# 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.
+#
+EOF
+git rev-parse HEAD >> build/commit_SHA1
+
+echo "package libraries"
+mvn clean install -DskipTests   || { exit 1; }
+
+echo "copy libraries"
+rm -rf build/lib
+mkdir build/lib
+cp assembly/target/kylin-assembly-${version}-job.jar 
build/lib/kylin-job-${version}.jar
+cp storage-hbase/target/kylin-storage-hbase-${version}-coprocessor.jar 
build/lib/kylin-coprocessor-${version}.jar
+cp jdbc/target/kylin-jdbc-${version}.jar build/lib/kylin-jdbc-${version}.jar
+# Copied file becomes 000 for some env (e.g. 

[1/3] kylin git commit: KYLIN-1363 Fix unary operator expected bug

2016-01-27 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 95970d5e1 -> 5bcb78d06


KYLIN-1363 Fix unary operator expected bug

Signed-off-by: honma 


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

Branch: refs/heads/2.0-rc
Commit: c2f523ca407dc2dcd02015ed3f5b559ffe5b969a
Parents: 95970d5
Author: Hao Chen 
Authored: Sun Jan 24 14:28:49 2016 +0800
Committer: honma 
Committed: Wed Jan 27 21:51:05 2016 +0800

--
 build/bin/kylin.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/c2f523ca/build/bin/kylin.sh
--
diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh
index 77a17a8..107ca73 100644
--- a/build/bin/kylin.sh
+++ b/build/bin/kylin.sh
@@ -22,7 +22,7 @@ source ${dir}/check-env.sh
 mkdir -p ${KYLIN_HOME}/logs
 
 # start command
-if [ $1 == "start" ]
+if [ "$1" == "start" ]
 then
 if [ -f "${KYLIN_HOME}/pid" ]
 then
@@ -91,7 +91,7 @@ then
 exit 0
 
 # stop command
-elif [ $1 == "stop" ]
+elif [ "$1" == "stop" ]
 then
 if [ -f "${KYLIN_HOME}/pid" ]
 then



[2/3] kylin git commit: Fix more unary operator expected bugs on v2.x

2016-01-27 Thread mahongbin
Fix more unary operator expected bugs on v2.x

Signed-off-by: honma 


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

Branch: refs/heads/2.0-rc
Commit: 7c62e3652d2b93a58e47c7fc629aeb184a00cc03
Parents: c2f523c
Author: Hao Chen 
Authored: Wed Jan 27 17:58:48 2016 +0800
Committer: honma 
Committed: Wed Jan 27 21:51:12 2016 +0800

--
 build/bin/kylin.sh | 10 +-
 build/bin/metastore.sh |  8 
 2 files changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/7c62e365/build/bin/kylin.sh
--
diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh
index 107ca73..f52f923 100644
--- a/build/bin/kylin.sh
+++ b/build/bin/kylin.sh
@@ -113,14 +113,14 @@ then
 fi
 
 # streaming command
-elif [ $1 == "streaming" ]
+elif [ "$1" == "streaming" ]
 then
 if [ $# -lt 4 ]
 then
 echo "invalid input args $@"
 exit -1
 fi
-if [ $2 == "start" ]
+if [ "$2" == "start" ]
 then
 
 #retrive $hive_dependency and $hbase_dependency
@@ -142,7 +142,7 @@ then
 org.apache.kylin.engine.streaming.cli.StreamingCLI $@ > 
${KYLIN_HOME}/logs/streaming_$3_$4.log 2>&1 & echo $! > 
${KYLIN_HOME}/logs/$3_$4 &
 echo "streaming started name: $3 id: $4"
 exit 0
-elif [ $2 == "stop" ]
+elif [ "$2" == "stop" ]
 then
 if [ ! -f "${KYLIN_HOME}/$3_$4" ]
 then
@@ -165,7 +165,7 @@ then
 fi
 
 # monitor command
-elif [ $1 == "monitor" ]
+elif [ "$1" == "monitor" ]
 then
 echo "monitor job"
 
@@ -189,7 +189,7 @@ then
 exit 0
 
 # tool command
-elif [[ $1 = org.apache.kylin.* ]]
+elif [[ "$1" = org.apache.kylin.* ]]
 then
 #retrive $hive_dependency and $hbase_dependency
 source ${dir}/find-hive-dependency.sh

http://git-wip-us.apache.org/repos/asf/kylin/blob/7c62e365/build/bin/metastore.sh
--
diff --git a/build/bin/metastore.sh b/build/bin/metastore.sh
index 8f237aa..05041f9 100755
--- a/build/bin/metastore.sh
+++ b/build/bin/metastore.sh
@@ -27,7 +27,7 @@
 dir=$(dirname ${0})
 source ${dir}/check-env.sh
 
-if [ $1 == "backup" ]
+if [ "$1" == "backup" ]
 then
 
 mkdir -p ${KYLIN_HOME}/meta_backups
@@ -40,19 +40,19 @@ then
 ${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.common.persistence.ResourceTool download ${_file}
 echo "metadata store backed up to ${_file}"
 
-elif [ $1 == "restore" ]
+elif [ "$1" == "restore" ]
 then
 
 _file=$2
 echo "Starting restoring $_file"
 ${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.common.persistence.ResourceTool upload $_file
 
-elif [ $1 == "reset" ]
+elif [ "$1" == "reset" ]
 then
 
 ${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.common.persistence.ResourceTool  reset
 
-elif [ $1 == "clean" ]
+elif [ "$1" == "clean" ]
 then
 
 ${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.engine.mr.steps.MetadataCleanupJob "${@:2}"



[1/2] kylin git commit: Fix more unary operator expected bugs on v1.x

2016-01-27 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/1.x-staging 4a5d05992 -> d6974474a


Fix more unary operator expected bugs on v1.x

Signed-off-by: honma 


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

Branch: refs/heads/1.x-staging
Commit: d6974474aaa827793981f79df14f2a6ce8612733
Parents: 4e18dfe
Author: Hao Chen 
Authored: Wed Jan 27 18:00:48 2016 +0800
Committer: honma 
Committed: Wed Jan 27 21:39:14 2016 +0800

--
 bin/kylin.sh | 2 +-
 bin/metastore.sh | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/d6974474/bin/kylin.sh
--
diff --git a/bin/kylin.sh b/bin/kylin.sh
index 5bf3eab..6b0a495 100755
--- a/bin/kylin.sh
+++ b/bin/kylin.sh
@@ -115,7 +115,7 @@ then
 fi
 
 # tool command
-elif [[ $1 = org.apache.kylin.* ]]
+elif [[ "$1" = org.apache.kylin.* ]]
 then
 #retrive $hive_dependency and $hbase_dependency
 source ${dir}/find-hive-dependency.sh

http://git-wip-us.apache.org/repos/asf/kylin/blob/d6974474/bin/metastore.sh
--
diff --git a/bin/metastore.sh b/bin/metastore.sh
index 39593d4..5d4ef40 100755
--- a/bin/metastore.sh
+++ b/bin/metastore.sh
@@ -28,7 +28,7 @@
 dir=$(dirname ${0})
 source ${dir}/check-env.sh
 
-if [ $1 == "backup" ]
+if [ "$1" == "backup" ]
 then
 
 mkdir -p ${KYLIN_HOME}/meta_backups
@@ -41,19 +41,19 @@ then
 ${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.common.persistence.ResourceTool download ${_file}
 echo "metadata store backed up to ${_file}"
 
-elif [ $1 == "restore" ]
+elif [ "$1" == "restore" ]
 then
 
 _file=$2
 echo "Starting restoring $_file"
 ${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.common.persistence.ResourceTool upload $_file
 
-elif [ $1 == "reset" ]
+elif [ "$1" == "reset" ]
 then
 
 ${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.common.persistence.ResourceTool  reset
 
-elif [ $1 == "clean" ]
+elif [ "$1" == "clean" ]
 then
 
 ${KYLIN_HOME}/bin/kylin.sh 
org.apache.kylin.job.hadoop.cube.MetadataCleanupJob "${@:2}"



[2/2] kylin git commit: KYLIN-1363 Fix unary operator expected bug

2016-01-27 Thread mahongbin
KYLIN-1363 Fix unary operator expected bug

Signed-off-by: honma 


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

Branch: refs/heads/1.x-staging
Commit: 4e18dfe2055ca0c23a3fbff4d7e3175a48e743be
Parents: 4a5d059
Author: Hao Chen 
Authored: Sun Jan 24 14:16:58 2016 +0800
Committer: honma 
Committed: Wed Jan 27 21:39:14 2016 +0800

--
 bin/kylin.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/4e18dfe2/bin/kylin.sh
--
diff --git a/bin/kylin.sh b/bin/kylin.sh
index 8ca3c91..5bf3eab 100755
--- a/bin/kylin.sh
+++ b/bin/kylin.sh
@@ -22,7 +22,7 @@ source ${dir}/check-env.sh
 mkdir -p ${KYLIN_HOME}/logs
 
 # start command
-if [ $1 == "start" ]
+if [ "$1" == "start" ]
 then
 
 if [ -f "${KYLIN_HOME}/pid" ]
@@ -93,7 +93,7 @@ then
 exit 0
 
 # stop command
-elif [ $1 == "stop" ]
+elif [ "$1" == "stop" ]
 then
 if [ -f "${KYLIN_HOME}/pid" ]
 then