You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/05/12 07:12:45 UTC

[04/28] kylin git commit: KYLIN-1650 Filesystem closed - in Cube Build Step 2

KYLIN-1650 Filesystem closed - in Cube Build Step 2

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

Branch: refs/heads/1.5.x-HBase1.x
Commit: 0c0bb078f3de11b0b2a0e4644b9134836727e59b
Parents: ecbff22
Author: shaofengshi <sh...@apache.org>
Authored: Mon May 9 14:20:14 2016 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Mon May 9 15:32:01 2016 +0800

----------------------------------------------------------------------
 .../kylin/engine/mr/steps/FactDistinctColumnsReducer.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/0c0bb078/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java
----------------------------------------------------------------------
diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java
index c07738d..2649492 100644
--- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java
+++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java
@@ -44,6 +44,8 @@ import org.apache.kylin.metadata.model.TblColRef;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  */
@@ -62,6 +64,7 @@ public class FactDistinctColumnsReducer extends KylinReducer<Text, Text, NullWri
     private boolean isStatistics = false;
     private boolean outputTouched = false;
     private KylinConfig cubeConfig;
+    protected static final Logger logger = LoggerFactory.getLogger(FactDistinctColumnsReducer.class);
 
     @Override
     protected void setup(Context context) throws IOException {
@@ -100,7 +103,7 @@ public class FactDistinctColumnsReducer extends KylinReducer<Text, Text, NullWri
         if (isStatistics == false) {
             colValues.add(new ByteArray(Bytes.copy(key.getBytes(), 1, key.getLength() - 1)));
             if (colValues.size() == 1000000) { //spill every 1 million
-                System.out.println("spill values to disk...");
+                logger.info("spill values to disk...");
                 outputDistinctValues(col, colValues, context);
                 colValues.clear();
             }
@@ -138,10 +141,10 @@ public class FactDistinctColumnsReducer extends KylinReducer<Text, Text, NullWri
         try {
             if (fs.exists(outputFile)) {
                 out = fs.append(outputFile);
-                System.out.println("append file " + outputFile);
+                logger.info("append file " + outputFile);
             } else {
                 out = fs.create(outputFile);
-                System.out.println("create file " + outputFile);
+                logger.info("create file " + outputFile);
             }
 
             for (ByteArray value: values) {
@@ -150,7 +153,6 @@ public class FactDistinctColumnsReducer extends KylinReducer<Text, Text, NullWri
             }
         } finally {
             IOUtils.closeQuietly(out);
-            IOUtils.closeQuietly(fs);
             outputTouched = true;
         }
     }