You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by nj...@apache.org on 2017/10/17 01:13:15 UTC

kylin git commit: KYLIN-2722: fix version issue

Repository: kylin
Updated Branches:
  refs/heads/pr77 75bd5b616 -> e5f184c91


KYLIN-2722: fix version issue


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

Branch: refs/heads/pr77
Commit: e5f184c91981f8b8e530596232aa1924a981616d
Parents: 75bd5b6
Author: Zhong <nj...@apache.org>
Authored: Tue Oct 17 08:41:44 2017 +0800
Committer: Zhong <nj...@apache.org>
Committed: Tue Oct 17 09:12:30 2017 +0800

----------------------------------------------------------------------
 core-metrics/pom.xml                               |  2 +-
 metrics-reporter-hive/pom.xml                      |  2 +-
 .../kylin/metrics/lib/impl/hive/HiveProducer.java  | 17 +++++++++--------
 metrics-reporter-kafka/pom.xml                     |  2 +-
 pom.xml                                            | 10 ++++++++++
 5 files changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/e5f184c9/core-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/core-metrics/pom.xml b/core-metrics/pom.xml
index 454a1ff..e436c97 100644
--- a/core-metrics/pom.xml
+++ b/core-metrics/pom.xml
@@ -29,7 +29,7 @@
     <parent>
         <artifactId>kylin</artifactId>
         <groupId>org.apache.kylin</groupId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>2.3.0-SNAPSHOT</version>
     </parent>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/kylin/blob/e5f184c9/metrics-reporter-hive/pom.xml
----------------------------------------------------------------------
diff --git a/metrics-reporter-hive/pom.xml b/metrics-reporter-hive/pom.xml
index 25ca08d..e25636e 100644
--- a/metrics-reporter-hive/pom.xml
+++ b/metrics-reporter-hive/pom.xml
@@ -29,7 +29,7 @@
     <parent>
         <artifactId>kylin</artifactId>
         <groupId>org.apache.kylin</groupId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>2.3.0-SNAPSHOT</version>
     </parent>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/kylin/blob/e5f184c9/metrics-reporter-hive/src/main/java/org/apache/kylin/metrics/lib/impl/hive/HiveProducer.java
----------------------------------------------------------------------
diff --git a/metrics-reporter-hive/src/main/java/org/apache/kylin/metrics/lib/impl/hive/HiveProducer.java b/metrics-reporter-hive/src/main/java/org/apache/kylin/metrics/lib/impl/hive/HiveProducer.java
index 2ab0090..8ba5287 100644
--- a/metrics-reporter-hive/src/main/java/org/apache/kylin/metrics/lib/impl/hive/HiveProducer.java
+++ b/metrics-reporter-hive/src/main/java/org/apache/kylin/metrics/lib/impl/hive/HiveProducer.java
@@ -25,7 +25,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -63,13 +62,17 @@ public class HiveProducer {
     private final String CONTENT_FILE_NAME;
 
     public HiveProducer(Properties props) throws Exception {
-        hiveConf = new HiveConf();
-        hdfs = FileSystem.get(hiveConf);
+        this(props, new HiveConf());
+    }
 
+    HiveProducer(Properties props, HiveConf hiveConfig) throws Exception {
+        hiveConf = hiveConfig;
         for (Map.Entry<Object, Object> e : props.entrySet()) {
             hiveConf.set(e.getKey().toString(), e.getValue().toString());
         }
 
+        hdfs = FileSystem.get(hiveConf);
+
         tableFieldSchemaCache = CacheBuilder.newBuilder().removalListener(new RemovalListener<Pair<String, String>, Pair<String, List<FieldSchema>>>() {
             @Override
             public void onRemoval(RemovalNotification<Pair<String, String>, Pair<String, List<FieldSchema>>> notification) {
@@ -164,15 +167,13 @@ public class HiveProducer {
                 throw new RuntimeException("Fail to create HDFS file: " + partitionContentPath + " after " + nRetry + " retries");
             }
         }
-        FSDataOutputStream fout = hdfs.append(partitionContentPath);
-        try {
+        try (FSDataOutputStream fout = hdfs.append(partitionContentPath)) {
             for (HiveProducerRecord elem : recordItr) {
                 fout.writeBytes(elem.valueToString() + "\n");
             }
         } catch (IOException e) {
-            logger.error("Fails to write metrics to file " + partitionContentPath.toString());
-        } finally {
-            IOUtils.closeQuietly(fout);
+            System.out.println("Fails to write metrics to file " + partitionContentPath.toString() + " due to " + e);
+            logger.error("Fails to write metrics to file " + partitionContentPath.toString() + " due to " + e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/e5f184c9/metrics-reporter-kafka/pom.xml
----------------------------------------------------------------------
diff --git a/metrics-reporter-kafka/pom.xml b/metrics-reporter-kafka/pom.xml
index 77edf63..ae9fb88 100644
--- a/metrics-reporter-kafka/pom.xml
+++ b/metrics-reporter-kafka/pom.xml
@@ -28,7 +28,7 @@
     <parent>
         <artifactId>kylin</artifactId>
         <groupId>org.apache.kylin</groupId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>2.3.0-SNAPSHOT</version>
     </parent>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/kylin/blob/e5f184c9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a7a7914..ffbdf03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -214,6 +214,16 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.kylin</groupId>
+                <artifactId>kylin-metrics-reporter-hive</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.kylin</groupId>
+                <artifactId>kylin-metrics-reporter-kafka</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.kylin</groupId>
                 <artifactId>kylin-core-metadata</artifactId>
                 <version>${project.version}</version>
             </dependency>