hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1069038 - in /hbase/trunk: CHANGES.txt pom.xml src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java src/main/resources/hbase-default.xml src/main/xslt/configuration_to_docbook_section.xsl
Date Wed, 09 Feb 2011 19:12:08 GMT
Author: todd
Date: Wed Feb  9 19:12:08 2011
New Revision: 1069038

URL: http://svn.apache.org/viewvc?rev=1069038&view=rev
Log:
HBASE-3517. Store build version in hbase-default.xml and verify at runtime

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/pom.xml
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
    hbase/trunk/src/main/resources/hbase-default.xml
    hbase/trunk/src/main/xslt/configuration_to_docbook_section.xsl

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1069038&r1=1069037&r2=1069038&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Feb  9 19:12:08 2011
@@ -110,6 +110,7 @@ Release 0.90.1 - Unreleased
                aborts. Instead, should just cancel region open.
    HBASE-3515  [replication] ReplicationSource can miss a log after RS comes
                out of GC
+   HBASE-3517  Store build version in hbase-default.xml and verify at runtime
 
 Release 0.90.0 - January 19th, 2011
   INCOMPATIBLE CHANGES

Modified: hbase/trunk/pom.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/pom.xml?rev=1069038&r1=1069037&r2=1069038&view=diff
==============================================================================
--- hbase/trunk/pom.xml (original)
+++ hbase/trunk/pom.xml Wed Feb  9 19:12:08 2011
@@ -423,6 +423,18 @@
               <goal>run</goal>
             </goals>
           </execution>
+          <execution>
+            <phase>process-resources</phase>
+            <configuration>
+              <tasks>
+                <replace file="${project.build.outputDirectory}/hbase-default.xml"
+                  token="@@@VERSION@@@" value="${project.version}" />
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
         </executions>
       </plugin>
       <plugin>

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java?rev=1069038&r1=1069037&r2=1069038&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java Wed Feb  9 19:12:08
2011
@@ -24,6 +24,7 @@ import java.util.Map.Entry;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.util.VersionInfo;
 
 /**
  * Adds HBase configuration files to a Configuration
@@ -58,9 +59,21 @@ public class HBaseConfiguration extends 
     }
   }
 
+  private static void checkDefaultsVersion(Configuration conf) {
+    String defaultsVersion = conf.get("hbase.defaults.for.version");
+    String thisVersion = VersionInfo.getVersion();
+    if (!thisVersion.equals(defaultsVersion)) {
+      throw new RuntimeException(
+        "hbase-default.xml file seems to be for and old version of HBase (" +
+        defaultsVersion + "), this version is " + thisVersion);
+    }
+  }
+
   public static Configuration addHbaseResources(Configuration conf) {
     conf.addResource("hbase-default.xml");
     conf.addResource("hbase-site.xml");
+
+    checkDefaultsVersion(conf);
     return conf;
   }
 

Modified: hbase/trunk/src/main/resources/hbase-default.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/resources/hbase-default.xml?rev=1069038&r1=1069037&r2=1069038&view=diff
==============================================================================
--- hbase/trunk/src/main/resources/hbase-default.xml (original)
+++ hbase/trunk/src/main/resources/hbase-default.xml Wed Feb  9 19:12:08 2011
@@ -609,4 +609,14 @@
     true: Only the GET method is permitted.
     </description>
   </property>
+
+  <property skipInDoc="true">
+    <name>hbase.defaults.for.version</name>
+    <value>@@@VERSION@@@</value>
+    <description>
+    This defaults file was compiled for version @@@VERSION@@@. This variable is used
+    to make sure that a user doesn't have an old version of hbase-default.xml on the
+    classpath.
+    </description>
+  </property>
 </configuration>

Modified: hbase/trunk/src/main/xslt/configuration_to_docbook_section.xsl
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/xslt/configuration_to_docbook_section.xsl?rev=1069038&r1=1069037&r2=1069038&view=diff
==============================================================================
--- hbase/trunk/src/main/xslt/configuration_to_docbook_section.xsl (original)
+++ hbase/trunk/src/main/xslt/configuration_to_docbook_section.xsl Wed Feb  9 19:12:08 2011
@@ -45,6 +45,7 @@ This documentation is generated using th
 </para>
 
 <xsl:for-each select="property">
+<xsl:if test="not(@skipInDoc)">
 <glossentry>
   <xsl:attribute name="id">
     <xsl:value-of select="name" />
@@ -57,6 +58,7 @@ This documentation is generated using th
   <para>Default: <varname><xsl:value-of select="value"/></varname></para>
   </glossdef>
 </glossentry>
+</xsl:if>
 </xsl:for-each>
 
 </glossary>



Mime
View raw message