You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ae...@apache.org on 2018/01/24 22:36:15 UTC

[46/50] [abbrv] hadoop git commit: Revert "YARN-7537 [Atsv2] load hbase configuration from filesystem rather than URL. Contributed by Rohith Sharma"

Revert "YARN-7537 [Atsv2] load hbase configuration from filesystem rather than URL. Contributed by Rohith Sharma"

This reverts commit ec8f47e7fadbe62c0c39390d0a46cefd50e98492.


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

Branch: refs/heads/HDFS-7240
Commit: f3e33aeb80dca88d452ebe70028f95f0efede4dd
Parents: e7642a3
Author: Rohith Sharma K S <ro...@apache.org>
Authored: Wed Jan 24 15:04:15 2018 +0530
Committer: Rohith Sharma K S <ro...@apache.org>
Committed: Wed Jan 24 15:04:15 2018 +0530

----------------------------------------------------------------------
 .../src/main/resources/yarn-default.xml         |  2 +-
 .../common/HBaseTimelineStorageUtils.java       | 40 ++++++--------------
 2 files changed, 13 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f3e33aeb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
index 45aa635..1348d6d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
@@ -2463,7 +2463,7 @@
   </property>
 
   <property>
-    <description> Optional FS path to an hbase-site.xml configuration file to be
+    <description> Optional URL to an hbase-site.xml configuration file to be
     used to connect to the timeline-service hbase cluster. If empty or not
     specified, then the HBase configuration will be loaded from the classpath.
     When specified the values in the specified configuration file will override

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f3e33aeb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineStorageUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineStorageUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineStorageUtils.java
index c25a0d2..c115b18 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineStorageUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineStorageUtils.java
@@ -18,14 +18,13 @@
 package org.apache.hadoop.yarn.server.timelineservice.storage.common;
 
 import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataInputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseConfiguration;
@@ -270,43 +269,28 @@ public final class HBaseTimelineStorageUtils {
    * @return a configuration with the HBase configuration from the classpath,
    *         optionally overwritten by the timeline service configuration URL if
    *         specified.
-   * @throws IOException if a timeline service HBase configuration path
-   *           is specified but unable to read it.
+   * @throws MalformedURLException if a timeline service HBase configuration URL
+   *           is specified but is a malformed URL.
    */
   public static Configuration getTimelineServiceHBaseConf(Configuration conf)
-      throws IOException {
+      throws MalformedURLException {
     if (conf == null) {
       throw new NullPointerException();
     }
 
     Configuration hbaseConf;
-    String timelineServiceHBaseConfFilePath =
+    String timelineServiceHBaseConfFileURL =
         conf.get(YarnConfiguration.TIMELINE_SERVICE_HBASE_CONFIGURATION_FILE);
-    if (timelineServiceHBaseConfFilePath != null
-        && timelineServiceHBaseConfFilePath.length() > 0) {
+    if (timelineServiceHBaseConfFileURL != null
+        && timelineServiceHBaseConfFileURL.length() > 0) {
       LOG.info("Using hbase configuration at " +
-          timelineServiceHBaseConfFilePath);
+          timelineServiceHBaseConfFileURL);
       // create a clone so that we don't mess with out input one
       hbaseConf = new Configuration(conf);
       Configuration plainHBaseConf = new Configuration(false);
-      FileSystem fs = null;
-      FSDataInputStream in = null;
-      try {
-        Path hbaseConfigPath = new Path(timelineServiceHBaseConfFilePath);
-        fs = FileSystem.newInstance(conf);
-        in = fs.open(hbaseConfigPath);
-        plainHBaseConf.addResource(in);
-        HBaseConfiguration.merge(hbaseConf, plainHBaseConf);
-      } catch (IOException e) {
-        throw e;
-      } finally {
-        if (in != null) {
-          in.close();
-        }
-        if (fs != null) {
-          fs.close();
-        }
-      }
+      URL hbaseSiteXML = new URL(timelineServiceHBaseConfFileURL);
+      plainHBaseConf.addResource(hbaseSiteXML);
+      HBaseConfiguration.merge(hbaseConf, plainHBaseConf);
     } else {
       // default to what is on the classpath
       hbaseConf = HBaseConfiguration.create(conf);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org