瀏覽代碼

HADOOP-2077. Added version and build information to STARTUP_MSG for all hadoop daemons to aid error-reporting, debugging etc.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@611874 13f79535-47bb-0310-9956-ffa450edef68
Arun Murthy 17 年之前
父節點
當前提交
a36b4f481b
共有 2 個文件被更改,包括 15 次插入4 次删除
  1. 3 0
      CHANGES.txt
  2. 12 4
      src/java/org/apache/hadoop/util/StringUtils.java

+ 3 - 0
CHANGES.txt

@@ -227,6 +227,9 @@ Trunk (unreleased changes)
                                                     /jobtracker/jobsInfo)
     (Alejandro Abdelnur via acmurthy) 
 
+    HADOOP-2077. Added version and build information to STARTUP_MSG for all
+    hadoop daemons to aid error-reporting, debugging etc. (acmurthy) 
+
   OPTIMIZATIONS
 
     HADOOP-1898.  Release the lock protecting the last time of the last stack

+ 12 - 4
src/java/org/apache/hadoop/util/StringUtils.java

@@ -310,10 +310,18 @@ public class StringUtils {
                                      final org.apache.commons.logging.Log LOG) {
     final String hostname = getHostname();
     final String classname = clazz.getSimpleName();
-    LOG.info(toStartupShutdownString("STARTUP_MSG: ", new String[]{
-      "Starting " + classname,
-      "  host = " + hostname,
-      "  args = " + Arrays.asList(args)}));
+    LOG.info(
+        toStartupShutdownString("STARTUP_MSG: ", new String[] {
+            "Starting " + classname,
+            "  host = " + hostname,
+            "  args = " + Arrays.asList(args),
+            "  version = " + VersionInfo.getVersion(),
+            "  build = " + VersionInfo.getUrl() + " -r "
+                         + VersionInfo.getRevision()  
+                         + "; compiled by '" + VersionInfo.getUser()
+                         + "' on " + VersionInfo.getDate()}
+        )
+      );
 
     Runtime.getRuntime().addShutdownHook(new Thread() {
       public void run() {