hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1229029 - in /hadoop/common/branches/branch-1: CHANGES.txt src/core/org/apache/hadoop/HadoopVersionAnnotation.java src/core/org/apache/hadoop/util/VersionInfo.java src/saveVersion.sh
Date Mon, 09 Jan 2012 04:57:01 GMT
Author: mattf
Date: Mon Jan  9 04:57:01 2012
New Revision: 1229029

URL: http://svn.apache.org/viewvc?rev=1229029&view=rev
Log:
HADOOP-7960. Port HADOOP-5203 to branch-1, build version comparison is too restrictive. Contributed
by Matt Foley.

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/core/org/apache/hadoop/HadoopVersionAnnotation.java
    hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/VersionInfo.java
    hadoop/common/branches/branch-1/src/saveVersion.sh

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1229029&r1=1229028&r2=1229029&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Mon Jan  9 04:57:01 2012
@@ -8,6 +8,9 @@ Release 1.1.0 - unreleased
                     branch-0.20-security (Ravi Gummadi via amarrk)
   BUG FIXES
 
+    HADOOP-7960. Port HADOOP-5203 to branch-1, build version comparison is too 
+    restrictive. (mattf)
+
     HDFS-2305. Running multiple 2NNs can result in corrupt file system. (atm)
 
     HADOOP-7634. Docs specify wrong owner for task-controller.cfg (eli)

Modified: hadoop/common/branches/branch-1/src/core/org/apache/hadoop/HadoopVersionAnnotation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/core/org/apache/hadoop/HadoopVersionAnnotation.java?rev=1229029&r1=1229028&r2=1229029&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/core/org/apache/hadoop/HadoopVersionAnnotation.java
(original)
+++ hadoop/common/branches/branch-1/src/core/org/apache/hadoop/HadoopVersionAnnotation.java
Mon Jan  9 04:57:01 2012
@@ -53,4 +53,11 @@ public @interface HadoopVersionAnnotatio
    * @return the revision number as a string (eg. "451451")
    */
   String revision();
+
+  /**
+   * Get a checksum of the source files from which
+   * Hadoop was compiled.
+   * @return a string that uniquely identifies the source
+   **/
+  String srcChecksum();
 }

Modified: hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/VersionInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/VersionInfo.java?rev=1229029&r1=1229028&r2=1229029&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/VersionInfo.java (original)
+++ hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/VersionInfo.java Mon Jan
 9 04:57:01 2012
@@ -79,6 +79,14 @@ public class VersionInfo {
   public static String getUrl() {
     return version != null ? version.url() : "Unknown";
   }
+
+  /**
+   * Get the checksum of the source files from which Hadoop was
+   * built.
+   **/
+  public static String getSrcChecksum() {
+    return version != null ? version.srcChecksum() : "Unknown";
+  }
   
   /**
    * Returns the buildVersion which includes version, 
@@ -88,12 +96,14 @@ public class VersionInfo {
     return VersionInfo.getVersion() + 
     " from " + VersionInfo.getRevision() +
     " by " + VersionInfo.getUser() + 
-    " on " + VersionInfo.getDate();
+    " source checksum " + VersionInfo.getSrcChecksum();
   }
   
   public static void main(String[] args) {
     System.out.println("Hadoop " + getVersion());
     System.out.println("Subversion " + getUrl() + " -r " + getRevision());
     System.out.println("Compiled by " + getUser() + " on " + getDate());
+    System.out.println("From source with checksum " + getSrcChecksum());
+
   }
 }

Modified: hadoop/common/branches/branch-1/src/saveVersion.sh
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/saveVersion.sh?rev=1229029&r1=1229028&r2=1229029&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/saveVersion.sh (original)
+++ hadoop/common/branches/branch-1/src/saveVersion.sh Mon Jan  9 04:57:01 2012
@@ -33,15 +33,18 @@ else
   revision=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
   url=`svn info | sed -n -e 's/URL: \(.*\)/\1/p'`
 fi
+srcChecksum=`find src -name '*.java' | LC_ALL=C sort | xargs md5sum | md5sum | cut -d ' '
-f 1`
+
 mkdir -p $build_dir/src/org/apache/hadoop
 cat << EOF | \
   sed -e "s/VERSION/$version/" -e "s/USER/$user/" -e "s/DATE/$date/" \
-      -e "s|URL|$url|" -e "s/REV/$revision/" \
+      -e "s|URL|$url|" -e "s/REV/$revision/" -e "s/SRCCHECKSUM/$srcChecksum/" \
       > $build_dir/src/org/apache/hadoop/package-info.java
 /*
  * Generated by src/saveVersion.sh
  */
 @HadoopVersionAnnotation(version="VERSION", revision="REV", 
-                         user="USER", date="DATE", url="URL")
+                         user="USER", date="DATE", url="URL",
+                         srcChecksum="SRCCHECKSUM")
 package org.apache.hadoop;
 EOF



Mime
View raw message