kylin git commit: KYLIN-993 Remove unnecessary logs

2016-01-10 Thread lidong
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging f55fe0d90 -> 53cfead8b


KYLIN-993 Remove unnecessary logs


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

Branch: refs/heads/2.x-staging
Commit: 53cfead8bd664910601f8269800d649b4cd6929c
Parents: f55fe0d
Author: lidongsjtu 
Authored: Mon Jan 11 10:22:10 2016 +0800
Committer: lidongsjtu 
Committed: Mon Jan 11 10:22:10 2016 +0800

--
 .../dict/TupleFilterDictionaryTranslater.java   | 14 ++---
 query/src/test/resources/query/sql/query94.sql  | 22 
 query/src/test/resources/query/sql/query96.sql  | 22 
 3 files changed, 29 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/53cfead8/core-dictionary/src/main/java/org/apache/kylin/dict/TupleFilterDictionaryTranslater.java
--
diff --git 
a/core-dictionary/src/main/java/org/apache/kylin/dict/TupleFilterDictionaryTranslater.java
 
b/core-dictionary/src/main/java/org/apache/kylin/dict/TupleFilterDictionaryTranslater.java
index 1826cd6..9ef360d 100644
--- 
a/core-dictionary/src/main/java/org/apache/kylin/dict/TupleFilterDictionaryTranslater.java
+++ 
b/core-dictionary/src/main/java/org/apache/kylin/dict/TupleFilterDictionaryTranslater.java
@@ -48,24 +48,24 @@ public class TupleFilterDictionaryTranslater implements 
ITupleFilterTranslator {
 
 @Override
 public TupleFilter translate(TupleFilter tupleFilter) {
-TupleFilter translated = tupleFilter;
+TupleFilter translated = null;
 if (tupleFilter instanceof CompareTupleFilter) {
-logger.info("Translation to IN clause: " + tupleFilter);
 translated = translateCompareTupleFilter((CompareTupleFilter) 
tupleFilter);
-logger.info(translated == null ? "Failed, will use Calcite to 
handle computed comparison." : "Succeed: " + translated);
+if (translated != null) {
+logger.info("Translated {" + tupleFilter + "} to IN clause: {" 
+ translated + "}");
+}
 } else if (tupleFilter instanceof FunctionTupleFilter) {
-logger.info("Translation to IN clause: " + tupleFilter);
 translated = translateFunctionTupleFilter((FunctionTupleFilter) 
tupleFilter);
-logger.info(translated == null ? "Failed, will use Calcite to 
handle computed column." : "Succeed: " + translated);
+if (translated != null) {
+logger.info("Translated {" + tupleFilter + "} to IN clause: {" 
+ translated + "}");
+}
 } else if (tupleFilter instanceof LogicalTupleFilter) {
-logger.info("Translation to IN clause: " + tupleFilter);
 ListIterator childIterator = 
(ListIterator) tupleFilter.getChildren().listIterator();
 while (childIterator.hasNext()) {
 TupleFilter tempTranslated = translate(childIterator.next());
 if (tempTranslated != null)
 childIterator.set(tempTranslated);
 }
-logger.info(translated == null ? "Failed, will use Calcite to 
handle computed column." : "Succeed: " + translated);
 }
 return translated == null ? tupleFilter : translated;
 }

http://git-wip-us.apache.org/repos/asf/kylin/blob/53cfead8/query/src/test/resources/query/sql/query94.sql
--
diff --git a/query/src/test/resources/query/sql/query94.sql 
b/query/src/test/resources/query/sql/query94.sql
deleted file mode 100644
index 4e80d59..000
--- a/query/src/test/resources/query/sql/query94.sql
+++ /dev/null
@@ -1,22 +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.
---
-
-select upper(lstg_format_name) as lstg_format_name, count(*) as cnt from 

kylin git commit: KYLIN-1301 fix segment pruning failure in 2.x versions

2016-01-10 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc f91e738a7 -> edab5a433


KYLIN-1301 fix segment pruning failure in 2.x versions


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

Branch: refs/heads/2.0-rc
Commit: edab5a433cb3260065ebddb6869505175db30758
Parents: f91e738
Author: honma 
Authored: Mon Jan 11 11:25:44 2016 +0800
Committer: honma 
Committed: Mon Jan 11 11:25:44 2016 +0800

--
 .../kylin/gridtable/GTScanRangePlanner.java   | 13 +++--
 .../hbase/cube/v2/CubeHBaseEndpointRPC.java   |  4 
 .../kylin/storage/hbase/cube/v2/CubeHBaseRPC.java | 18 +-
 .../storage/hbase/cube/v2/CubeHBaseScanRPC.java   |  5 -
 .../storage/hbase/cube/v2/CubeSegmentScanner.java | 14 ++
 5 files changed, 38 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/edab5a43/core-cube/src/main/java/org/apache/kylin/gridtable/GTScanRangePlanner.java
--
diff --git 
a/core-cube/src/main/java/org/apache/kylin/gridtable/GTScanRangePlanner.java 
b/core-cube/src/main/java/org/apache/kylin/gridtable/GTScanRangePlanner.java
index f0e42a0..dad0f7c 100644
--- a/core-cube/src/main/java/org/apache/kylin/gridtable/GTScanRangePlanner.java
+++ b/core-cube/src/main/java/org/apache/kylin/gridtable/GTScanRangePlanner.java
@@ -43,7 +43,16 @@ public class GTScanRangePlanner {
 final private RecordComparator rangeEndComparator;
 final private RecordComparator rangeStartEndComparator;
 
+/**
+ * @param info
+ * @param segmentStartAndEnd in GT encoding
+ * @param partitionColRef the TblColRef in GT
+ */
 public GTScanRangePlanner(GTInfo info, Pair 
segmentStartAndEnd, TblColRef partitionColRef) {
+if (partitionColRef != null && segmentStartAndEnd == null) {
+throw new IllegalArgumentException("segmentStartAndEnd not 
provided when partitionColRef is set to " + partitionColRef);
+}
+
 this.info = info;
 this.segmentStartAndEnd = segmentStartAndEnd;
 this.partitionColRef = partitionColRef;
@@ -91,9 +100,9 @@ public class GTScanRangePlanner {
 List fuzzyKeys;
 
 for (ColumnRange range : andDimRanges) {
-
 if (partitionColRef != null && 
range.column.equals(partitionColRef)) {
-
+logger.debug("Pre-check partition col filter, partitionColRef 
{}, segmentstartandend {}, range begin {}, range end {}",//
+new Object[] { partitionColRef, segmentStartAndEnd, 
range.begin, range.end });
 if 
(rangeStartEndComparator.comparator.compare(segmentStartAndEnd.getFirst(), 
range.end) <= 0 //
 && 
rangeStartEndComparator.comparator.compare(range.begin, 
segmentStartAndEnd.getSecond()) < 0) {
 //segment range is [Closed,Open)

http://git-wip-us.apache.org/repos/asf/kylin/blob/edab5a43/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 6ff07a4..a193d10 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
@@ -63,9 +63,13 @@ import com.google.common.collect.Iterators;
 import com.google.common.collect.Lists;
 import com.google.protobuf.ByteString;
 import com.google.protobuf.HBaseZeroCopyByteString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class CubeHBaseEndpointRPC extends CubeHBaseRPC {
 
+public static final Logger logger = 
LoggerFactory.getLogger(CubeHBaseEndpointRPC.class);
+
 private static ExecutorService executorService = 
Executors.newCachedThreadPool();
 
 static class EndpointResultsAsGTScanner implements IGTScanner {

http://git-wip-us.apache.org/repos/asf/kylin/blob/edab5a43/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseRPC.java
--
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseRPC.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseRPC.java
index 1335af0..d319c2d 100644
--- 

kylin git commit: KYLIN-1296 Refine restful API document

2016-01-10 Thread lidong
Repository: kylin
Updated Branches:
  refs/heads/1.x-staging e9afc45d3 -> 76397b67b


KYLIN-1296 Refine restful API document


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

Branch: refs/heads/1.x-staging
Commit: 76397b67b8131f1f7cb6de45578a5d79d9cc27d0
Parents: e9afc45
Author: lidongsjtu 
Authored: Mon Jan 11 14:10:15 2016 +0800
Committer: lidongsjtu 
Committed: Mon Jan 11 14:23:44 2016 +0800

--
 website/_dev/dev_env.md |   1 +
 .../howto/howto_build_cube_with_restapi.md  |  39 +++---
 website/_docs/howto/howto_jdbc.md   |  80 ++--
 website/_docs/howto/howto_use_restapi.md| 126 ++-
 website/_docs/howto/howto_use_restapi_in_js.md  |  19 ++-
 website/_docs/index.md  |   2 +-
 website/_docs/install/hadoop_evn.md |   4 +-
 7 files changed, 140 insertions(+), 131 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/76397b67/website/_dev/dev_env.md
--
diff --git a/website/_dev/dev_env.md b/website/_dev/dev_env.md
index ec0d3fa..9eea9aa 100644
--- a/website/_dev/dev_env.md
+++ b/website/_dev/dev_env.md
@@ -23,6 +23,7 @@ ambari-server start
 {% endhighlight %}

 With both command successfully run you can go to ambari home page at 
 (user:admin,password:admin) to check everything's 
status. By default ambari disables Hbase, you'll need manually start the 
`Hbase` service.
+![start hbase in 
ambari](https://raw.githubusercontent.com/KylinOLAP/kylinolap.github.io/master/docs/installation/starthbase.png)
 
 For other hadoop distribution, basically start the hadoop cluster, make sure 
HDFS, YARN, Hive, HBase are running.
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/76397b67/website/_docs/howto/howto_build_cube_with_restapi.md
--
diff --git a/website/_docs/howto/howto_build_cube_with_restapi.md 
b/website/_docs/howto/howto_build_cube_with_restapi.md
index ee4759c..4113700 100644
--- a/website/_docs/howto/howto_build_cube_with_restapi.md
+++ b/website/_docs/howto/howto_build_cube_with_restapi.md
@@ -3,7 +3,7 @@ layout: docs
 title:  How to Build Cube with Restful API
 categories: howto
 permalink: /docs/howto/howto_build_cube_with_restapi.html
-version: v1.0
+version: v1.2
 since: v0.7.1
 ---
 
@@ -12,47 +12,44 @@ since: v0.7.1
 *   Add `Authorization` header to first request for authentication
 *   Or you can do a specific request by `POST 
http://localhost:7070/kylin/api/user/authentication`
 *   Once authenticated, client can go subsequent requests with cookies.
-*   Example
 {% highlight Groff markup %}
-POST http://localhost:7070/kylin/api/user/authentication
+POST http://localhost:7070/kylin/api/user/authentication
 
-Authorization:Basic JD124xxxGFxxxSDF
-Content-Type: application/json;charset=UTF-8
+Authorization:Basic JD124xxxGFxxxSDF
+Content-Type: application/json;charset=UTF-8
 {% endhighlight %}
 
 ### 2. Get details of cube. 
 *   `GET 
http://localhost:7070/kylin/api/cubes?cubeName={cube_name}=15=0`
 *   Client can find cube segment date ranges in returned cube detail.
-*   Example
 {% highlight Groff markup %}
-GET 
http://localhost:7070/kylin/api/cubes?cubeName=test_kylin_cube_with_slr=15=0
+GET 
http://localhost:7070/kylin/api/cubes?cubeName=test_kylin_cube_with_slr=15=0
 
-Authorization:Basic JD124xxxGFxxxSDF
-Content-Type: application/json;charset=UTF-8
+Authorization:Basic JD124xxxGFxxxSDF
+Content-Type: application/json;charset=UTF-8
 {% endhighlight %}
 ### 3. Then submit a build job of the cube. 
 *   `PUT http://localhost:7070/kylin/api/cubes/{cube_name}/rebuild`
-*   For put request body detail please refer to [service doc](rest_api.html). 
+*   For put request body detail please refer to [Build Cube 
API](howto_use_restapi.html#build-cube). 
 *   `startTime` and `endTime` should be utc timestamp.
 *   `buildType` can be `BUILD` ,`MERGE` or `REFRESH`. `BUILD` is for 
building a new segment, `REFRESH` for refreshing an existing segment. `MERGE` 
is for merging multiple existing segments into one bigger segment.
-*   This method will return a newly created job instance, in which the uuid is 
the identity of job to track job status.
-*   Example
+*   This method will return a new created job instance,  whose uuid is the 
unique id of job to track job status.
 {% highlight Groff markup %}
-PUT http://localhost:7070/kylin/api/cubes/test_kylin_cube_with_slr/rebuild
+PUT