Repository: kylin
Updated Branches:
  refs/heads/master 5d4982e24 -> 81e3b2cd3


KYLIN-1821 checkstyle enable leftcurly and rightcurly rules


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

Branch: refs/heads/master
Commit: 81e3b2cd3d0ee4632b95d80d54aafd355b541726
Parents: 5d4982e
Author: Hongbin Ma <mahong...@apache.org>
Authored: Sat Jun 25 19:47:48 2016 +0800
Committer: Hongbin Ma <mahong...@apache.org>
Committed: Sat Jun 25 20:18:23 2016 +0800

----------------------------------------------------------------------
 checkstyle.xml                                    |  2 ++
 .../kylin/common/persistence/ResourceTool.java    |  7 +++----
 .../java/org/apache/kylin/cube/CubeManager.java   |  9 ++++-----
 .../kylin/cube/gridtable/CubeCodeSystem.java      |  7 +++----
 .../org/apache/kylin/cube/model/CubeDesc.java     |  9 +++++----
 .../apache/kylin/cube/model/v1_4_0/CubeDesc.java  |  7 +++----
 .../upgrade/common/MetadataVersionRefresher.java  |  9 +++++----
 .../kylin/gridtable/GTAggregateScanner.java       |  9 +++++----
 .../benchmark/SortedGTRecordGenerator.java        |  9 +++++----
 .../apache/kylin/dict/AppendTrieDictionary.java   | 18 ++++++++----------
 .../java/org/apache/kylin/dict/CachedTreeMap.java |  1 -
 .../apache/kylin/dict/TrieDictionaryBuilder.java  | 16 +++++++---------
 .../measure/hllc/HyperLogLogPlusCounter.java      |  5 ++---
 .../storage/gtrecord/CubeTupleConverter.java      |  5 ++---
 .../kylin/query/enumerator/OLAPEnumerator.java    |  7 +++----
 .../storage/hbase/cube/v1/CubeTupleConverter.java |  7 +++----
 .../endpoint/EndpointTupleConverter.java          | 12 +++++-------
 .../apache/kylin/tool/util/ResourceStoreUtil.java |  7 +++----
 18 files changed, 68 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/checkstyle.xml
----------------------------------------------------------------------
diff --git a/checkstyle.xml b/checkstyle.xml
index 10ba67b..682186f 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -49,6 +49,8 @@
         <!--<module name="InterfaceIsType"/>-->
         <!--<module name="VisibilityModifier"/>-->
         <module name="ArrayTypeStyle"/>
+        <module name="LeftCurly"/>
+        <module name="RightCurly"/>
         <module name="UpperEll"/>
         <!--<module name="NoFinalizer"/>-->
         <!--<module name="MissingDeprecated"/>-->

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/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 b10856f..2f16eb7 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
@@ -131,8 +131,8 @@ public class ResourceTool {
     public static void copyR(ResourceStore src, ResourceStore dst, String 
path) throws IOException {
         NavigableSet<String> children = src.listResources(path);
 
-        // case of resource (not a folder)
         if (children == null) {
+            // case of resource (not a folder)
             if (matchFilter(path)) {
                 try {
                     RawResource res = src.getResource(path);
@@ -147,9 +147,8 @@ public class ResourceTool {
                     ex.printStackTrace();
                 }
             }
-        }
-        // case of folder
-        else {
+        } else {
+            // case of folder
             for (String child : children)
                 copyR(src, dst, child);
         }

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java 
b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
index b62bc05..a200f5d 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
@@ -766,18 +766,17 @@ public class CubeManager implements IRealizationProvider {
                 continue;
             }
 
-            // if i, j competes
             if (is.getSourceOffsetStart() == js.getSourceOffsetStart()) {
-                // if both new or ready, favor the bigger segment
+                // if i, j competes
                 if (isReady(is) && isReady(js) || isNew(is) && isNew(js)) {
+                    // if both new or ready, favor the bigger segment
                     if (is.getSourceOffsetEnd() <= js.getSourceOffsetEnd()) {
                         tobe.remove(i);
                     } else {
                         tobe.remove(j);
                     }
-                }
-                // otherwise, favor the new segment
-                else if (isNew(is)) {
+                } else if (isNew(is)) {
+                    // otherwise, favor the new segment
                     tobe.remove(j);
                 } else {
                     tobe.remove(i);

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
----------------------------------------------------------------------
diff --git 
a/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java 
b/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
index b2a84f9..f95cc21 100644
--- 
a/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
+++ 
b/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
@@ -71,12 +71,11 @@ public class CubeCodeSystem implements IGTCodeSystem {
         for (int i = 0; i < serializers.length; i++) {
             DimensionEncoding dimEnc = i < dimEncs.length ? dimEncs[i] : null;
 
-            // for dimensions
             if (dimEnc != null) {
+                // for dimensions
                 serializers[i] = dimEnc.asDataTypeSerializer();
-            }
-            // for measures
-            else {
+            } else {
+                // for measures
                 serializers[i] = 
DataTypeSerializer.create(info.getColumnType(i));
             }
         }

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java 
b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index da92e0f..7d9c058 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -708,14 +708,15 @@ public class CubeDesc extends RootPersistentEntity {
             ArrayList<TblColRef> dimCols = Lists.newArrayList();
             String colStrs = dim.getColumn();
 
-            // when column is omitted, special case
             if ((colStrs == null && dim.isDerived()) || 
("{FK}".equalsIgnoreCase(colStrs))) {
+                // when column is omitted, special case
+                
                 for (TblColRef col : join.getForeignKeyColumns()) {
                     dimCols.add(initDimensionColRef(col));
                 }
-            }
-            // normal case
-            else {
+            } else {
+                // normal case
+                
                 if (StringUtils.isEmpty(colStrs))
                     throw new IllegalStateException("Dimension column must not 
be blank " + dim);
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-cube/src/main/java/org/apache/kylin/cube/model/v1_4_0/CubeDesc.java
----------------------------------------------------------------------
diff --git 
a/core-cube/src/main/java/org/apache/kylin/cube/model/v1_4_0/CubeDesc.java 
b/core-cube/src/main/java/org/apache/kylin/cube/model/v1_4_0/CubeDesc.java
index 77019b0..e74c514 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/v1_4_0/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/v1_4_0/CubeDesc.java
@@ -492,14 +492,13 @@ public class CubeDesc extends RootPersistentEntity {
             ArrayList<TblColRef> dimCols = Lists.newArrayList();
             String[] colStrs = dim.getColumn();
 
-            // when column is omitted, special case
             if (colStrs == null && dim.isDerived() || 
ArrayUtils.contains(colStrs, "{FK}")) {
+                // when column is omitted, special case
                 for (TblColRef col : join.getForeignKeyColumns()) {
                     dimCols.add(initDimensionColRef(col));
                 }
-            }
-            // normal case
-            else {
+            } else {
+                // normal case
                 if (colStrs == null || colStrs.length == 0)
                     throw new IllegalStateException("Dimension column must not 
be blank " + dim);
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-cube/src/main/java/org/apache/kylin/cube/upgrade/common/MetadataVersionRefresher.java
----------------------------------------------------------------------
diff --git 
a/core-cube/src/main/java/org/apache/kylin/cube/upgrade/common/MetadataVersionRefresher.java
 
b/core-cube/src/main/java/org/apache/kylin/cube/upgrade/common/MetadataVersionRefresher.java
index 4cf0584..45d4353 100644
--- 
a/core-cube/src/main/java/org/apache/kylin/cube/upgrade/common/MetadataVersionRefresher.java
+++ 
b/core-cube/src/main/java/org/apache/kylin/cube/upgrade/common/MetadataVersionRefresher.java
@@ -75,12 +75,13 @@ public class MetadataVersionRefresher {
     public static void collectFiles(ResourceStore src, String path, 
List<String> ret) throws IOException {
         NavigableSet<String> children = src.listResources(path);
 
-        // case of resource (not a folder)
         if (children == null) {
+            // case of resource (not a folder)
+
             ret.add(path);
-        }
-        // case of folder
-        else {
+        } else {
+            // case of folder
+
             for (String child : children) {
                 collectFiles(src, child, ret);
             }

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java
----------------------------------------------------------------------
diff --git 
a/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java 
b/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java
index 863b958..f27c6fa 100644
--- a/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java
+++ b/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java
@@ -305,8 +305,9 @@ public class GTAggregateScanner implements IGTScanner {
         }
 
         public Iterator<GTRecord> iterator() {
-            // the all-in-mem case
             if (dumps.isEmpty()) {
+                // the all-in-mem case
+
                 return new Iterator<GTRecord>() {
 
                     final Iterator<Entry<byte[], MeasureAggregator[]>> it = 
aggBufMap.entrySet().iterator();
@@ -329,9 +330,9 @@ public class GTAggregateScanner implements IGTScanner {
                         throw new UnsupportedOperationException();
                     }
                 };
-            }
-            // the spill case
-            else {
+            } else {
+                // the spill case
+
                 logger.info("Last spill, current AggregationCache memory 
estimated size is: " + getEstimateSizeOfAggrCache());
                 this.spillBuffMap();
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-cube/src/main/java/org/apache/kylin/gridtable/benchmark/SortedGTRecordGenerator.java
----------------------------------------------------------------------
diff --git 
a/core-cube/src/main/java/org/apache/kylin/gridtable/benchmark/SortedGTRecordGenerator.java
 
b/core-cube/src/main/java/org/apache/kylin/gridtable/benchmark/SortedGTRecordGenerator.java
index fd87410..094acec 100644
--- 
a/core-cube/src/main/java/org/apache/kylin/gridtable/benchmark/SortedGTRecordGenerator.java
+++ 
b/core-cube/src/main/java/org/apache/kylin/gridtable/benchmark/SortedGTRecordGenerator.java
@@ -140,8 +140,9 @@ public class SortedGTRecordGenerator {
                 public GTRecord next() {
                     for (int i = 0; i < colSpecs.size(); i++) {
                         ColSpec spec = colSpecs.get(i);
-                        // dimension case
                         if (spec.cardinality > 0) {
+                            // dimension case
+
                             long v = dist[i].next();
                             if (v < 0) {
                                 dist[i] = new Distribution(spec, 
parentLevelCount(i));
@@ -150,9 +151,9 @@ public class SortedGTRecordGenerator {
                             ByteArray bytes = rec.get(i);
                             assert bytes.length() == spec.length;
                             BytesUtil.writeLong(v, bytes.array(), 
bytes.offset(), bytes.length());
-                        }
-                        // measure case
-                        else {
+                        } else {
+                            // measure case
+
                             int len = spec.measureRandomizer.fillRandom(rand, 
rec.get(i).array(), 0);
                             rec.get(i).setLength(len);
                         }

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-dictionary/src/main/java/org/apache/kylin/dict/AppendTrieDictionary.java
----------------------------------------------------------------------
diff --git 
a/core-dictionary/src/main/java/org/apache/kylin/dict/AppendTrieDictionary.java 
b/core-dictionary/src/main/java/org/apache/kylin/dict/AppendTrieDictionary.java
index f49258d..32038bf 100644
--- 
a/core-dictionary/src/main/java/org/apache/kylin/dict/AppendTrieDictionary.java
+++ 
b/core-dictionary/src/main/java/org/apache/kylin/dict/AppendTrieDictionary.java
@@ -887,18 +887,17 @@ public class AppendTrieDictionary<T> extends 
Dictionary<T> {
                     break;
             }
 
-            // if value fully matched within the current node
             if (j == nn) {
-                // if equals to current node, just mark end of value
+                // if value fully matched within the current node
                 if (i == n) {
-                    // if the first match, assign an Id to nodt
+                    // if equals to current node, just mark end of value
                     if (!node.isEndOfValue) {
+                        // if the first match, assign an Id to nodt
                         node.id = createNextId();
                     }
                     node.isEndOfValue = true;
-                }
-                // otherwise, split the current node into two
-                else {
+                } else {
+                    // otherwise, split the current node into two
                     DictNode c = new DictNode(BytesUtil.subarray(node.part, i, 
n), node.isEndOfValue, node.children);
                     c.id = node.id;
                     node.reset(BytesUtil.subarray(node.part, 0, i), true);
@@ -945,12 +944,11 @@ public class AppendTrieDictionary<T> extends 
Dictionary<T> {
                 else
                     found = true;
             }
-            // found a child node matching the first byte, continue in that 
child
             if (found) {
+                // found a child node matching the first byte, continue in 
that child
                 addValueR(node.children.get(mid), value, j);
-            }
-            // otherwise, make the value a new child
-            else {
+            } else {
+                // otherwise, make the value a new child
                 DictNode c = new DictNode(BytesUtil.subarray(value, j, nn), 
true);
                 c.id = createNextId();
                 node.addChild(comp <= 0 ? mid : mid + 1, c);

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-dictionary/src/main/java/org/apache/kylin/dict/CachedTreeMap.java
----------------------------------------------------------------------
diff --git 
a/core-dictionary/src/main/java/org/apache/kylin/dict/CachedTreeMap.java 
b/core-dictionary/src/main/java/org/apache/kylin/dict/CachedTreeMap.java
index 9e9e7d6..ec29bb5 100644
--- a/core-dictionary/src/main/java/org/apache/kylin/dict/CachedTreeMap.java
+++ b/core-dictionary/src/main/java/org/apache/kylin/dict/CachedTreeMap.java
@@ -334,7 +334,6 @@ public class CachedTreeMap<K extends WritableComparable, V 
extends Writable> ext
     }
 
     // clean up all tmp files
-    @SuppressWarnings("checkstyle:nofinalizer")
     @Override
     public void finalize() throws Throwable {
         if (persistent) {

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
----------------------------------------------------------------------
diff --git 
a/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
 
b/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
index 330d64c..02da741 100644
--- 
a/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
+++ 
b/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
@@ -98,14 +98,13 @@ public class TrieDictionaryBuilder<T> {
                 break;
         }
 
-        // if value fully matched within the current node
         if (j == nn) {
-            // if equals to current node, just mark end of value
+            // if value fully matched within the current node
             if (i == n) {
+                // if equals to current node, just mark end of value
                 node.isEndOfValue = true;
-            }
-            // otherwise, split the current node into two
-            else {
+            } else {
+                // otherwise, split the current node into two
                 Node c = new Node(BytesUtil.subarray(node.part, i, n), 
node.isEndOfValue, node.children);
                 node.reset(BytesUtil.subarray(node.part, 0, i), true);
                 node.children.add(c);
@@ -147,12 +146,11 @@ public class TrieDictionaryBuilder<T> {
             else
                 found = true;
         }
-        // found a child node matching the first byte, continue in that child
         if (found) {
+            // found a child node matching the first byte, continue in that 
child
             addValueR(node.children.get(mid), value, j);
-        }
-        // otherwise, make the value a new child
-        else {
+        } else {
+            // otherwise, make the value a new child
             Node c = new Node(BytesUtil.subarray(value, j, nn), true);
             node.children.add(comp <= 0 ? mid : mid + 1, c);
         }

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HyperLogLogPlusCounter.java
----------------------------------------------------------------------
diff --git 
a/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HyperLogLogPlusCounter.java
 
b/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HyperLogLogPlusCounter.java
index 11fda52..00407f9 100644
--- 
a/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HyperLogLogPlusCounter.java
+++ 
b/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HyperLogLogPlusCounter.java
@@ -121,9 +121,8 @@ public class HyperLogLogPlusCounter implements 
Serializable, Comparable<HyperLog
             int b = another.singleBucket;
             if (registers[b] < another.registers[b])
                 registers[b] = another.registers[b];
-        }
-        // normal path
-        else {
+        } else {
+            // normal path
             for (int i = 0; i < m; i++) {
                 if (registers[i] < another.registers[i])
                     registers[i] = another.registers[i];

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
----------------------------------------------------------------------
diff --git 
a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
 
b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
index 7b442b4..68556d6 100644
--- 
a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
+++ 
b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
@@ -100,9 +100,8 @@ public class CubeTupleConverter {
             if (metric.needRewrite()) {
                 String rewriteFieldName = metric.getRewriteFieldName();
                 tupleIdx[iii] = tupleInfo.hasField(rewriteFieldName) ? 
tupleInfo.getFieldIndex(rewriteFieldName) : -1;
-            }
-            // a non-rewrite metrics (like sum, or dimension playing as 
metrics) is like a dimension column
-            else {
+            } else {
+                // a non-rewrite metrics (like sum, or dimension playing as 
metrics) is like a dimension column
                 TblColRef col = metric.getParameter().getColRefs().get(0);
                 tupleIdx[iii] = tupleInfo.hasColumn(col) ? 
tupleInfo.getColumnIndex(col) : -1;
             }

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
----------------------------------------------------------------------
diff --git 
a/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java 
b/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
index 48feec4..bf93300 100644
--- a/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
+++ b/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
@@ -180,12 +180,11 @@ public class OLAPEnumerator implements 
Enumerator<Object[]> {
         }
 
         for (TblColRef col : sqlDigest.allColumns) {
-            // For dimension columns, take them as group by columns.
             if (cube.getAllDimensions().contains(col)) {
+                // For dimension columns, take them as group by columns.
                 sqlDigest.groupbyColumns.add(col);
-            }
-            // For measure columns, take them as metric columns with 
aggregation function SUM().
-            else {
+            } else {
+                // For measure columns, take them as metric columns with 
aggregation function SUM().
                 ParameterDesc colParameter = new ParameterDesc();
                 colParameter.setType("column");
                 colParameter.setValue(col.getName());

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
----------------------------------------------------------------------
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
index dbd6a45..d2378b9 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
@@ -96,13 +96,12 @@ public class CubeTupleConverter {
                 FunctionDesc aggrFunc = measures[mi].getFunction();
 
                 int tupleIdx;
-                // a rewrite metrics is identified by its rewrite field name
                 if (aggrFunc.needRewrite()) {
+                    // a rewrite metrics is identified by its rewrite field 
name
                     String rewriteFieldName = aggrFunc.getRewriteFieldName();
                     tupleIdx = tupleInfo.hasField(rewriteFieldName) ? 
tupleInfo.getFieldIndex(rewriteFieldName) : -1;
-                }
-                // a non-rewrite metrics (like sum, or dimension playing as 
metrics) is like a dimension column
-                else {
+                } else {
+                    // a non-rewrite metrics (like sum, or dimension playing 
as metrics) is like a dimension column
                     TblColRef col = 
aggrFunc.getParameter().getColRefs().get(0);
                     tupleIdx = tupleInfo.hasColumn(col) ? 
tupleInfo.getColumnIndex(col) : -1;
                 }

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/EndpointTupleConverter.java
----------------------------------------------------------------------
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/EndpointTupleConverter.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/EndpointTupleConverter.java
index c60ce0b..3fdd5b0 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/EndpointTupleConverter.java
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/coprocessor/endpoint/EndpointTupleConverter.java
@@ -48,17 +48,15 @@ public class EndpointTupleConverter {
         for (int i = 0; i < aggrMeasures.size(); i++) {
             FunctionDesc measure = aggrMeasures.get(i);
             int tupleIdx;
-            // for dimension playing as metrics, the measure is just a 
placeholder, the real value comes from columns
             if (measure.isDimensionAsMetric()) {
+                // for dimension playing as metrics, the measure is just a 
placeholder, the real value comes from columns
                 tupleIdx = -1;
-            }
-            // a rewrite metrics is identified by its rewrite field name
-            else if (measure.needRewrite()) {
+            } else if (measure.needRewrite()) {
+                // a rewrite metrics is identified by its rewrite field name
                 String rewriteFieldName = measure.getRewriteFieldName();
                 tupleIdx = tupleInfo.hasField(rewriteFieldName) ? 
tupleInfo.getFieldIndex(rewriteFieldName) : -1;
-            }
-            // a non-rewrite metrics (i.e. sum) is like a dimension column
-            else {
+            } else {
+                // a non-rewrite metrics (i.e. sum) is like a dimension column
                 TblColRef col = measure.getParameter().getColRefs().get(0);
                 tupleIdx = tupleInfo.hasColumn(col) ? 
tupleInfo.getColumnIndex(col) : -1;
             }

http://git-wip-us.apache.org/repos/asf/kylin/blob/81e3b2cd/tool/src/main/java/org/apache/kylin/tool/util/ResourceStoreUtil.java
----------------------------------------------------------------------
diff --git 
a/tool/src/main/java/org/apache/kylin/tool/util/ResourceStoreUtil.java 
b/tool/src/main/java/org/apache/kylin/tool/util/ResourceStoreUtil.java
index 4fb60e6..104c534 100644
--- a/tool/src/main/java/org/apache/kylin/tool/util/ResourceStoreUtil.java
+++ b/tool/src/main/java/org/apache/kylin/tool/util/ResourceStoreUtil.java
@@ -43,8 +43,8 @@ public class ResourceStoreUtil {
         Method listResourceMethod = 
ResourceStore.class.getMethod("listResources", String.class);
         Iterable<String> children = (Iterable<String>) 
listResourceMethod.invoke(src, path);
 
-        // case of resource (not a folder)
         if (children == null) {
+            // case of resource (not a folder)
             try {
                 RawResource res = src.getResource(path);
                 if (res != null) {
@@ -57,9 +57,8 @@ public class ResourceStoreUtil {
                 System.err.println("Failed to open " + path);
                 ex.printStackTrace();
             }
-        }
-        // case of folder
-        else {
+        } else {
+            // case of folder
             for (String child : children)
                 rCopy(src, dst, child);
         }

Reply via email to