You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2011/06/11 01:48:30 UTC

svn commit: r1134485 - in /incubator/hama/trunk: conf/hama-default.xml src/java/org/apache/hama/Constants.java src/java/org/apache/hama/zookeeper/QuorumPeer.java

Author: edwardyoon
Date: Fri Jun 10 23:48:29 2011
New Revision: 1134485

URL: http://svn.apache.org/viewvc?rev=1134485&view=rev
Log:
Refactor constants for better centralization

Modified:
    incubator/hama/trunk/conf/hama-default.xml
    incubator/hama/trunk/src/java/org/apache/hama/Constants.java
    incubator/hama/trunk/src/java/org/apache/hama/zookeeper/QuorumPeer.java

Modified: incubator/hama/trunk/conf/hama-default.xml
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/conf/hama-default.xml?rev=1134485&r1=1134484&r2=1134485&view=diff
==============================================================================
--- incubator/hama/trunk/conf/hama-default.xml (original)
+++ incubator/hama/trunk/conf/hama-default.xml Fri Jun 10 23:48:29 2011
@@ -57,13 +57,13 @@
     </description>
   </property>
   <property>
-  <name>bsp.groom.report.address</name>
-  <value>127.0.0.1:0</value>
-  <description>The interface and port that groom server listens on. 
-  Since it is only connected to by the tasks, it uses the local interface.
-  EXPERT ONLY. Should only be changed if your host does not have the loopback 
-  interface.</description>
-</property>
+    <name>bsp.groom.report.address</name>
+    <value>127.0.0.1:0</value>
+    <description>The interface and port that groom server listens on. 
+    Since it is only connected to by the tasks, it uses the local interface.
+    EXPERT ONLY. Should only be changed if your host does not have the loopback 
+    interface.</description>
+  </property>
   <property>
     <name>bsp.system.dir</name>
     <value>${hadoop.tmp.dir}/bsp/system</value>
@@ -84,7 +84,6 @@
     For example, to enable verbose gc logging to a file named for the taskid in
     /tmp and to set the heap maximum to be a gigabyte, pass a 'value' of:
           -Xmx1024m -verbose:gc -Xloggc:/tmp/@taskid@.gc
-  
     The configuration variable bsp.child.ulimit can be used to control the
     maximum virtual memory of the child processes. 
     </description>
@@ -128,7 +127,7 @@
     </description>
   </property>
   <property>
-    <name>zookeeper.client.port</name>
+    <name>hama.zookeeper.property.clientPort</name>
     <value>21810</value>
     <description>Property from ZooKeeper's config zoo.cfg.
     The port at which the clients will connect.

Modified: incubator/hama/trunk/src/java/org/apache/hama/Constants.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/Constants.java?rev=1134485&r1=1134484&r2=1134485&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/Constants.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/Constants.java Fri Jun 10 23:48:29 2011
@@ -76,7 +76,7 @@ public interface Constants {
   public static final int DEFAULT_ZOOKEEPER_PAUSE = 2 * 1000;
   
   static final String ZOOKEEPER_CONFIG_NAME = "zoo.cfg";
-  static final String ZOOKEPER_CLIENT_PORT = "zookeeper.client.port";
+  static final String ZOOKEPER_CLIENT_PORT = "hama.zookeeper.property.clientPort";
   static final int DEFAULT_ZOOKEPER_CLIENT_PORT = 21810;
   static final String ZOOKEEPER_QUORUM = "hama.zookeeper.quorum";
   /** Cluster is in distributed mode or not */

Modified: incubator/hama/trunk/src/java/org/apache/hama/zookeeper/QuorumPeer.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/zookeeper/QuorumPeer.java?rev=1134485&r1=1134484&r2=1134485&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/zookeeper/QuorumPeer.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/zookeeper/QuorumPeer.java Fri Jun 10 23:48:29 2011
@@ -55,8 +55,6 @@ public class QuorumPeer implements Const
 
   private static final String ZK_CFG_PROPERTY = "hama.zookeeper.property.";
   private static final int ZK_CFG_PROPERTY_SIZE = ZK_CFG_PROPERTY.length();
-  private static final String ZK_CLIENT_PORT_KEY = ZK_CFG_PROPERTY
-      + "clientPort";
 
   /**
    * Parse ZooKeeper configuration from Hama XML config and run a QuorumPeer.
@@ -197,8 +195,8 @@ public class QuorumPeer implements Const
     }
 
     // If clientPort is not set, assign the default
-    if (zkProperties.getProperty(ZK_CLIENT_PORT_KEY) == null) {
-      zkProperties.put(ZK_CLIENT_PORT_KEY, DEFAULT_ZOOKEPER_CLIENT_PORT);
+    if (zkProperties.getProperty(ZOOKEPER_CLIENT_PORT) == null) {
+      zkProperties.put(ZOOKEPER_CLIENT_PORT, DEFAULT_ZOOKEPER_CLIENT_PORT);
     }
 
     // Create the server.X properties.