[2/3] kylin git commit: minor, rename in Hybrid tool

2016-01-25 Thread lidong
minor, rename in Hybrid tool


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

Branch: refs/heads/2.x-staging
Commit: 74116bce6946d7399bfa7968985a2b7e55b5b4a0
Parents: 3825a83
Author: lidongsjtu 
Authored: Mon Jan 25 09:49:14 2016 +0800
Committer: lidongsjtu 
Committed: Tue Jan 26 12:10:34 2016 +0800

--
 .../hbase/util/ExtendCubeToHybridCLI.java   | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/74116bce/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
--
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
index 21d02ed..e5f1f1a 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
@@ -62,6 +62,8 @@ import com.google.common.collect.Lists;
  */
 public class ExtendCubeToHybridCLI {
 public static final String ACL_INFO_FAMILY = "i";
+private static final String CUBE_POSTFIX = "_old";
+private static final String HYBRID_POSTFIX = "_hybrid";
 private static final Logger logger = 
LoggerFactory.getLogger(ExtendCubeToHybridCLI.class);
 private static final String ACL_INFO_FAMILY_PARENT_COLUMN = "p";
 
@@ -133,12 +135,12 @@ public class ExtendCubeToHybridCLI {
 long partitionDate = partitionDateStr != null ? 
DateFormat.stringToMillis(partitionDateStr, dateFormat) : 0;
 
 // get new name for old cube and cube_desc
-String newCubeDescName = rename(cubeDesc.getName());
-String newCubeInstanceName = rename(cubeInstance.getName());
+String newCubeDescName = renameCube(cubeDesc.getName());
+String newCubeInstanceName = renameCube(cubeInstance.getName());
 while (cubeDescManager.getCubeDesc(newCubeDescName) != null)
-newCubeDescName = rename(newCubeDescName);
+newCubeDescName = renameCube(newCubeDescName);
 while (cubeManager.getCube(newCubeInstanceName) != null)
-newCubeInstanceName = rename(newCubeInstanceName);
+newCubeInstanceName = renameCube(newCubeInstanceName);
 
 // create new cube_instance for old segments
 CubeInstance newCubeInstance = CubeInstance.getCopyOf(cubeInstance);
@@ -191,7 +193,7 @@ public class ExtendCubeToHybridCLI {
 List realizationEntries = 
Lists.newArrayListWithCapacity(2);
 realizationEntries.add(RealizationEntry.create(RealizationType.CUBE, 
cubeInstance.getName()));
 realizationEntries.add(RealizationEntry.create(RealizationType.CUBE, 
newCubeInstance.getName()));
-HybridInstance hybridInstance = HybridInstance.create(kylinConfig, 
cubeInstance.getName(), realizationEntries);
+HybridInstance hybridInstance = HybridInstance.create(kylinConfig, 
renameHybrid(cubeInstance.getName()), realizationEntries);
 store.putResource(hybridInstance.getResourcePath(), hybridInstance, 
HybridManager.HYBRID_SERIALIZER);
 
ProjectManager.getInstance(kylinConfig).moveRealizationToProject(RealizationType.HYBRID,
 hybridInstance.getName(), projectName, owner);
 logger.info("HybridInstance was saved at: " + 
hybridInstance.getResourcePath());
@@ -215,8 +217,12 @@ public class ExtendCubeToHybridCLI {
 HybridManager.getInstance(kylinConfig);
 }
 
-private String rename(String origName) {
-return origName + "_legacy";
+private String renameCube(String origName) {
+return origName + CUBE_POSTFIX;
+}
+
+private String renameHybrid(String origName) {
+return origName + HYBRID_POSTFIX;
 }
 
 private void copyAcl(String origCubeId, String newCubeId, String 
projectName) throws Exception {



kylin git commit: KYLIN-1368 Make JDBC Driver more generic to restAPI json result

2016-01-25 Thread lidong
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc ee3f31d19 -> fcb1de4b2


KYLIN-1368 Make JDBC Driver more generic to restAPI json result


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

Branch: refs/heads/2.0-rc
Commit: fcb1de4b27b519b6791eaab72d53389f538274ff
Parents: ee3f31d
Author: lidongsjtu 
Authored: Mon Jan 25 22:11:22 2016 +0800
Committer: lidongsjtu 
Committed: Mon Jan 25 22:11:22 2016 +0800

--
 .../apache/kylin/jdbc/json/SQLResponseStub.java | 13 ++--
 .../apache/kylin/jdbc/SQLResonseStubTest.java   | 62 
 2 files changed, 70 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/fcb1de4b/jdbc/src/main/java/org/apache/kylin/jdbc/json/SQLResponseStub.java
--
diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/json/SQLResponseStub.java 
b/jdbc/src/main/java/org/apache/kylin/jdbc/json/SQLResponseStub.java
index 365b848..dd90c21 100644
--- a/jdbc/src/main/java/org/apache/kylin/jdbc/json/SQLResponseStub.java
+++ b/jdbc/src/main/java/org/apache/kylin/jdbc/json/SQLResponseStub.java
@@ -18,11 +18,14 @@
 
 package org.apache.kylin.jdbc.json;
 
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
 import java.io.Serializable;
 import java.util.List;
 
 /**
  */
+@JsonIgnoreProperties(ignoreUnknown = true)
 public class SQLResponseStub implements Serializable {
 private static final long serialVersionUID = 1L;
 
@@ -51,7 +54,6 @@ public class SQLResponseStub implements Serializable {
 
 private long totalScanCount;
 
-
 private boolean hitExceptionCache = false;
 
 private boolean storageCacheUsed = false;
@@ -59,6 +61,10 @@ public class SQLResponseStub implements Serializable {
 public SQLResponseStub() {
 }
 
+public static long getSerialversionuid() {
+return serialVersionUID;
+}
+
 public List getColumnMetas() {
 return columnMetas;
 }
@@ -147,10 +153,7 @@ public class SQLResponseStub implements Serializable {
 this.storageCacheUsed = storageCacheUsed;
 }
 
-public static long getSerialversionuid() {
-return serialVersionUID;
-}
-
+@JsonIgnoreProperties(ignoreUnknown = true)
 public static class ColumnMetaStub {
 
 private boolean isAutoIncrement;

http://git-wip-us.apache.org/repos/asf/kylin/blob/fcb1de4b/jdbc/src/test/java/org/apache/kylin/jdbc/SQLResonseStubTest.java
--
diff --git a/jdbc/src/test/java/org/apache/kylin/jdbc/SQLResonseStubTest.java 
b/jdbc/src/test/java/org/apache/kylin/jdbc/SQLResonseStubTest.java
new file mode 100644
index 000..9e4b3f6
--- /dev/null
+++ b/jdbc/src/test/java/org/apache/kylin/jdbc/SQLResonseStubTest.java
@@ -0,0 +1,62 @@
+/*
+ * 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.jdbc;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+
+import java.io.IOException;
+
+import org.apache.kylin.jdbc.json.SQLResponseStub;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * Created by dongli on 1/25/16.
+ */
+public class SQLResonseStubTest {
+
+@Test
+public void testReadValuePartRecognizedField() throws IOException {
+final String payload = "{ \"columnMetas\":[ { \"isNullable\":1, 
\"displaySize\":0, \"schemaName\":null, \"catelogName\":null, 
\"tableName\":null, \"precision\":0, \"scale\":0, \"columnType\":91, 
\"columnTypeName\":\"DATE\", \"readOnly\":true, \"writable\":false, 
\"caseSensitive\":true, \"searchable\":false, \"currency\":false, 
\"signed\":true, \"autoIncrement\":false, \"definitelyWritable\":false }, { 
\"isNullable\":1, \"displaySize\":10, 

kylin git commit: Fix a bug in TopNMeasureType

2016-01-25 Thread shaofengshi
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 6671a0db9 -> 1e57e4973


Fix a bug in TopNMeasureType

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

Branch: refs/heads/2.x-staging
Commit: 1e57e4973857e00f6746d06070aa1ea48a27157d
Parents: 6671a0d
Author: shaofengshi 
Authored: Mon Jan 25 21:37:50 2016 +0800
Committer: shaofengshi 
Committed: Mon Jan 25 21:37:50 2016 +0800

--
 .../main/java/org/apache/kylin/measure/topn/TopNMeasureType.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/1e57e497/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
--
diff --git 
a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
 
b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
index 55b7c5c..06493f7 100644
--- 
a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
+++ 
b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
@@ -294,7 +294,7 @@ public class TopNMeasureType extends 
MeasureType {
 throw new IllegalStateException();
 
 Counter counter = topNCounterIterator.next();
-int key = BytesUtil.readUnsigned(counter.getItem().array(), 0, 
counter.getItem().array().length);
+int key = BytesUtil.readUnsigned(counter.getItem().array(), 
counter.getItem().offset(), counter.getItem().length());
 String colValue = topNColDict.getValueFromId(key);
 tuple.setDimensionValue(literalTupleIdx, colValue);
 tuple.setMeasureValue(numericTupleIdx, counter.getCount());



kylin git commit: minor, update version in pom

2016-01-25 Thread mahongbin
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 5d10249f1 -> 3c3615bbf


minor, update version in pom


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

Branch: refs/heads/2.0-rc
Commit: 3c3615bbf0d2512b6f3ff815789efdc4a8169785
Parents: 5d10249
Author: honma 
Authored: Mon Jan 25 17:38:25 2016 +0800
Committer: honma 
Committed: Mon Jan 25 17:38:25 2016 +0800

--
 assembly/pom.xml | 2 +-
 atopcalcite/pom.xml  | 2 +-
 build/bin/upgrade_v2.sh  | 2 +-
 core-common/pom.xml  | 2 +-
 core-cube/pom.xml| 2 +-
 core-dictionary/pom.xml  | 2 +-
 core-job/pom.xml | 2 +-
 core-metadata/pom.xml| 2 +-
 core-storage/pom.xml | 2 +-
 engine-mr/pom.xml| 2 +-
 engine-spark/pom.xml | 3 ++-
 engine-streaming/pom.xml | 2 +-
 invertedindex/pom.xml| 3 ++-
 jdbc/pom.xml | 3 ++-
 kylin-it/pom.xml | 2 +-
 pom.xml  | 2 +-
 query/pom.xml| 3 ++-
 server/pom.xml   | 3 ++-
 source-hive/pom.xml  | 3 ++-
 source-kafka/pom.xml | 3 ++-
 storage-hbase/pom.xml| 3 ++-
 21 files changed, 29 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/3c3615bb/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index f7ad8fa..2dfa566 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -5,7 +5,7 @@
 
 kylin
 org.apache.kylin
-2.0-incubating-SNAPSHOT
+2.0-SNAPSHOT
 
 4.0.0
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/3c3615bb/atopcalcite/pom.xml
--
diff --git a/atopcalcite/pom.xml b/atopcalcite/pom.xml
index 45cca31..de2ae2d 100644
--- a/atopcalcite/pom.xml
+++ b/atopcalcite/pom.xml
@@ -27,7 +27,7 @@
 
 org.apache.kylin
 kylin
-2.0-incubating-SNAPSHOT
+2.0-SNAPSHOT
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/3c3615bb/build/bin/upgrade_v2.sh
--
diff --git a/build/bin/upgrade_v2.sh b/build/bin/upgrade_v2.sh
index 605479f..28761d1 100755
--- a/build/bin/upgrade_v2.sh
+++ b/build/bin/upgrade_v2.sh
@@ -21,7 +21,7 @@ dir=$(dirname ${0})
 source ${dir}/check-env.sh
 
 echo "==Deploy coprocessor==="
-$KYLIN_HOME/bin/kylin.sh 
org.apache.kylin.storage.hbase.util.DeployCoprocessorCLI 
$KYLIN_HOME/lib/kylin-coprocessor-2.0-incubating-SNAPSHOT.jar all
+$KYLIN_HOME/bin/kylin.sh 
org.apache.kylin.storage.hbase.util.DeployCoprocessorCLI 
$KYLIN_HOME/lib/kylin-coprocessor-2.0-SNAPSHOT.jar all
 
 echo "=Upgrade Cube metadata="
 $KYLIN_HOME/bin/kylin.sh org.apache.kylin.cube.upgrade.v2.CubeMetadataUpgradeV2

http://git-wip-us.apache.org/repos/asf/kylin/blob/3c3615bb/core-common/pom.xml
--
diff --git a/core-common/pom.xml b/core-common/pom.xml
index 8c7edb1..6e5553e 100644
--- a/core-common/pom.xml
+++ b/core-common/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.kylin
 kylin
-2.0-incubating-SNAPSHOT
+2.0-SNAPSHOT
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/3c3615bb/core-cube/pom.xml
--
diff --git a/core-cube/pom.xml b/core-cube/pom.xml
index 58c1a14..ecac276 100644
--- a/core-cube/pom.xml
+++ b/core-cube/pom.xml
@@ -27,7 +27,7 @@
 
 org.apache.kylin
 kylin
-2.0-incubating-SNAPSHOT
+2.0-SNAPSHOT
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/3c3615bb/core-dictionary/pom.xml
--
diff --git a/core-dictionary/pom.xml b/core-dictionary/pom.xml
index 2ea09fb..e54f5f3 100644
--- a/core-dictionary/pom.xml
+++ b/core-dictionary/pom.xml
@@ -27,7 +27,7 @@
 
 org.apache.kylin
 kylin
-2.0-incubating-SNAPSHOT
+2.0-SNAPSHOT
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/3c3615bb/core-job/pom.xml
--
diff --git a/core-job/pom.xml b/core-job/pom.xml
index 97c8f2e..9d70939 100644
--- a/core-job/pom.xml
+++ b/core-job/pom.xml
@@ -27,7 +27,7 @@
 
 org.apache.kylin
 kylin
-2.0-incubating-SNAPSHOT
+2.0-SNAPSHOT
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/3c3615bb/core-metadata/pom.xml

[1/2] kylin git commit: KYLIN-1186 remove the dependency on hadoop-common

2016-01-25 Thread shaofengshi
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging b89b7a4d2 -> 6671a0db9


KYLIN-1186 remove the dependency on hadoop-common

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

Branch: refs/heads/2.x-staging
Commit: d10fb6ac12cfcae377ecd90d7211878d3480a3b5
Parents: b89b7a4
Author: shaofengshi 
Authored: Mon Jan 25 17:13:41 2016 +0800
Committer: shaofengshi 
Committed: Mon Jan 25 17:13:41 2016 +0800

--
 core-metadata/pom.xml   |   6 +-
 .../kylin/measure/bitmap/BitmapCounter.java | 124 ++-
 .../kylin/measure/bitmap/BitmapSerializer.java  |   4 +
 3 files changed, 101 insertions(+), 33 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/d10fb6ac/core-metadata/pom.xml
--
diff --git a/core-metadata/pom.xml b/core-metadata/pom.xml
index 645a739..8abf02e 100644
--- a/core-metadata/pom.xml
+++ b/core-metadata/pom.xml
@@ -50,11 +50,7 @@
 
 org.roaringbitmap
 RoaringBitmap
-
-
-
-org.apache.hadoop
-hadoop-common
+${roaring.version}
 
 
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/d10fb6ac/core-metadata/src/main/java/org/apache/kylin/measure/bitmap/BitmapCounter.java
--
diff --git 
a/core-metadata/src/main/java/org/apache/kylin/measure/bitmap/BitmapCounter.java
 
b/core-metadata/src/main/java/org/apache/kylin/measure/bitmap/BitmapCounter.java
index 910b931..160042c 100644
--- 
a/core-metadata/src/main/java/org/apache/kylin/measure/bitmap/BitmapCounter.java
+++ 
b/core-metadata/src/main/java/org/apache/kylin/measure/bitmap/BitmapCounter.java
@@ -18,13 +18,9 @@
 
 package org.apache.kylin.measure.bitmap;
 
-import org.apache.hadoop.io.DataInputByteBuffer;
-import org.roaringbitmap.RoaringBitmap;
 import org.roaringbitmap.buffer.MutableRoaringBitmap;
 
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.nio.ByteBuffer;
 
 /**
@@ -49,40 +45,22 @@ public class BitmapCounter implements 
Comparable {
 bitmap.add(value);
 }
 
-public void add(byte[] value) {
-if (value == null || value.length == 0) {
-return;
-}
-try {
-int l = Integer.parseInt(new String(value));
-add(l);
-} catch (NumberFormatException e) {
-throw e;
-}
+public void add(byte[] value) {add(value, 0, value.length);
 }
 
 public void add(byte[] value, int offset, int length) {
 if (value == null || length == 0) {
 return;
 }
-try {
-int l = Integer.parseInt(new String(value, offset, length));
-add(l);
-} catch (NumberFormatException e) {
-throw e;
-}
+
+add(new String(value, offset, length));
 }
 
 public void add(String value) {
 if (value == null || value.isEmpty()) {
 return;
 }
-try {
-int l = Integer.parseInt(value);
-add(l);
-} catch (NumberFormatException e) {
-throw e;
-}
+add(Integer.parseInt(value));
 }
 
 public void add(long value) {
@@ -160,7 +138,7 @@ public class BitmapCounter implements 
Comparable {
 
 DataInputByteBuffer input = new DataInputByteBuffer();
 input.reset(new ByteBuffer[]{in});
-RoaringBitmap bitmap = new RoaringBitmap();
+MutableRoaringBitmap bitmap = new MutableRoaringBitmap();
 try {
 bitmap.deserialize(input);
 } catch (IOException e) {
@@ -170,4 +148,94 @@ public class BitmapCounter implements 
Comparable {
 in.position(mark);
 return len;
 }
+
+static class DataInputByteBuffer extends DataInputStream {
+private DataInputByteBuffer.Buffer buffers;
+
+public DataInputByteBuffer() {
+this(new DataInputByteBuffer.Buffer());
+}
+
+private DataInputByteBuffer(DataInputByteBuffer.Buffer buffers) {
+super(buffers);
+this.buffers = buffers;
+}
+
+public void reset(ByteBuffer... input) {
+this.buffers.reset(input);
+}
+
+public ByteBuffer[] getData() {
+return this.buffers.getData();
+}
+
+public int getPosition() {
+return this.buffers.getPosition();
+}
+
+public int getLength() {
+ 

[2/2] kylin git commit: KYLIN-1367 Use by-layer cubing algorithm if there is memory hungry measure

2016-01-25 Thread shaofengshi
KYLIN-1367 Use by-layer cubing algorithm if there is memory hungry measure

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

Branch: refs/heads/2.x-staging
Commit: 6671a0db9103826fc74b577efa5e5e64728b2934
Parents: d10fb6a
Author: shaofengshi 
Authored: Mon Jan 25 17:20:55 2016 +0800
Committer: shaofengshi 
Committed: Mon Jan 25 17:20:55 2016 +0800

--
 .../engine/mr/steps/SaveStatisticsStep.java | 30 ++--
 1 file changed, 22 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/6671a0db/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/SaveStatisticsStep.java
--
diff --git 
a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/SaveStatisticsStep.java
 
b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/SaveStatisticsStep.java
index 396955b..9314b88 100644
--- 
a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/SaveStatisticsStep.java
+++ 
b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/SaveStatisticsStep.java
@@ -39,6 +39,7 @@ import org.apache.kylin.job.exception.ExecuteException;
 import org.apache.kylin.job.execution.AbstractExecutable;
 import org.apache.kylin.job.execution.ExecutableContext;
 import org.apache.kylin.job.execution.ExecuteResult;
+import org.apache.kylin.metadata.model.MeasureDesc;
 
 /**
  * Save the cube segment statistic to Kylin metadata store
@@ -95,15 +96,28 @@ public class SaveStatisticsStep extends AbstractExecutable {
 alg = AlgorithmEnum.INMEM;
 } else if (AlgorithmEnum.LAYER.name().equalsIgnoreCase(algPref)) {
 alg = AlgorithmEnum.LAYER;
-} else if ("random".equalsIgnoreCase(algPref)) { // for testing
-alg = new Random().nextBoolean() ? AlgorithmEnum.INMEM : 
AlgorithmEnum.LAYER;
-} else { // the default
-double threshold = kylinConf.getCubeAlgorithmAutoThreshold();
-double mapperOverlapRatio = new CubeStatsReader(seg, 
kylinConf).getMapperOverlapRatioOfFirstBuild();
-logger.info("mapperOverlapRatio for " + seg + " is " + 
mapperOverlapRatio + " and threshold is " + threshold);
-alg = mapperOverlapRatio < threshold ? AlgorithmEnum.INMEM : 
AlgorithmEnum.LAYER;
-}
+} else {
+boolean memoryHungry = false;
+for (MeasureDesc measure : seg.getCubeDesc().getMeasures()) {
+if (measure.getFunction().getMeasureType().isMemoryHungry()) {
+logger.info("This cube has memory-hungry measure " + 
measure.getFunction().getExpression());
+memoryHungry = true;
+break;
+}
+}
+
+if (memoryHungry == true) {
+alg = AlgorithmEnum.LAYER;
+} else if ("random".equalsIgnoreCase(algPref)) { // for testing
+alg = new Random().nextBoolean() ? AlgorithmEnum.INMEM : 
AlgorithmEnum.LAYER;
+} else { // the default
+double threshold = kylinConf.getCubeAlgorithmAutoThreshold();
+double mapperOverlapRatio = new CubeStatsReader(seg, 
kylinConf).getMapperOverlapRatioOfFirstBuild();
+logger.info("mapperOverlapRatio for " + seg + " is " + 
mapperOverlapRatio + " and threshold is " + threshold);
+alg = mapperOverlapRatio < threshold ? AlgorithmEnum.INMEM : 
AlgorithmEnum.LAYER;
+}
 
+}
 logger.info("The cube algorithm for " + seg + " is " + alg);
 
 CubingJob cubingJob = (CubingJob) 
executableManager.getJob(getCubingJobId());



kylin git commit: minor,fix authority issue

2016-01-25 Thread zhongjian
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc fcb1de4b2 -> edc1a8e32


minor,fix authority issue


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

Branch: refs/heads/2.0-rc
Commit: edc1a8e3216738bf317862db07ed325a996596de
Parents: fcb1de4
Author: janzhongi 
Authored: Tue Jan 26 11:06:23 2016 +0800
Committer: janzhongi 
Committed: Tue Jan 26 11:08:21 2016 +0800

--
 .../java/org/apache/kylin/rest/controller/UserController.java | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/kylin/blob/edc1a8e3/server/src/main/java/org/apache/kylin/rest/controller/UserController.java
--
diff --git 
a/server/src/main/java/org/apache/kylin/rest/controller/UserController.java 
b/server/src/main/java/org/apache/kylin/rest/controller/UserController.java
index f291841..e6a9b96 100644
--- a/server/src/main/java/org/apache/kylin/rest/controller/UserController.java
+++ b/server/src/main/java/org/apache/kylin/rest/controller/UserController.java
@@ -77,12 +77,7 @@ public class UserController {
 
 @RequestMapping(value = "/authentication/authorities", method = 
RequestMethod.GET, produces = "application/json")
 public List getAuthorities() {
-//return userService.getUserAuthorities();
-ArrayList lists = new ArrayList<>();
-lists.add("ROLE_ADMIN");
-lists.add("ROLE_MODELER");
-lists.add("ROLE_ANALYST");
-return lists;
+return userService.getUserAuthorities();
 }
 
 }