tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject tez git commit: TEZ-1818. Problem loading tez-api-version-info.properties in case current context classloader in not pointing to Tez jars. (Johannes Zillmann via hitesh)
Date Thu, 04 Dec 2014 01:29:55 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.5 c726a9ebc -> 5761dfaf2


TEZ-1818. Problem loading tez-api-version-info.properties in case current context classloader
in not pointing to Tez jars. (Johannes Zillmann via hitesh)

(cherry picked from commit 991d3d3849119b4b667636a829dc5125d74623a3)


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

Branch: refs/heads/branch-0.5
Commit: 5761dfaf2e9e7e495462a734ebeef3bd49e9b7c6
Parents: c726a9e
Author: Hitesh Shah <hitesh@apache.org>
Authored: Wed Dec 3 17:28:51 2014 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Wed Dec 3 17:29:45 2014 -0800

----------------------------------------------------------------------
 CHANGES.txt                                             |  2 ++
 .../main/java/org/apache/tez/common/VersionInfo.java    | 12 +++++-------
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/5761dfaf/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 0af5e2e..d813313 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,6 +16,8 @@ ALL CHANGES:
   TEZ-1774. AppLaunched event for Timeline does not have start time set.
   TEZ-1780. tez-api is missing jersey dependencies.
   TEZ-1796. Use of DeprecationDelta broke build against 2.2 Hadoop.
+  TEZ-1818. Problem loading tez-api-version-info.properties in case current context classloader
+    in not pointing to Tez jars.
 
 Release 0.5.2: 2014-11-07
 

http://git-wip-us.apache.org/repos/asf/tez/blob/5761dfaf/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java b/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java
index 0287d0b..b5e44c9 100644
--- a/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java
+++ b/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java
@@ -47,18 +47,16 @@ public class VersionInfo {
   protected VersionInfo(String component) {
     this.component = component;
     info = new Properties();
-    String versionInfoFile = component + "-version-info.properties";
+    String versionInfoFile = "/" + component + "-version-info.properties";
     InputStream is = null;
     try {
-      is = Thread.currentThread().getContextClassLoader()
-          .getResourceAsStream(versionInfoFile);
+      is = this.getClass().getResourceAsStream(versionInfoFile);
       if (is == null) {
-        throw new IOException("Resource not found");
+        throw new IOException("Resource not found: " + versionInfoFile);
       }
       info.load(is);
     } catch (IOException ex) {
-      LogFactory.getLog(getClass()).warn("Could not read '" +
-          versionInfoFile + "', " + ex.toString(), ex);
+      LOG.warn("Could not read '" + versionInfoFile + "', " + ex.toString(), ex);
     } finally {
       IOUtils.closeStream(is);
     }
@@ -86,7 +84,7 @@ public class VersionInfo {
         + ", version=" + getVersion()
         + ", revision=" + getRevision()
         + ", SCM-URL=" + getSCMURL()
-        + ", buildTIme=" + getBuildTime()
+        + ", buildTime=" + getBuildTime()
         + " ]";
   }
 


Mime
View raw message