hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1436568 - in /hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src: main/java/org/apache/hadoop/conf/ main/java/org/apache/hadoop/net/unix/ test/java/org/apache/hadoop/net/unix/
Date Mon, 21 Jan 2013 19:29:07 GMT
Author: todd
Date: Mon Jan 21 19:29:06 2013
New Revision: 1436568

URL: http://svn.apache.org/viewvc?rev=1436568&view=rev
Log:
HDFS-4416. Rename dfs.datanode.domain.socket.path to dfs.domain.socket.path. Contributed by
Colin Patrick McCabe.

Modified:
    hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
    hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocket.java
    hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/unix/TestDomainSocket.java

Modified: hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java?rev=1436568&r1=1436567&r2=1436568&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
(original)
+++ hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
Mon Jan 21 19:29:06 2013
@@ -743,6 +743,21 @@ public class Configuration implements It
       return value.trim();
     }
   }
+  
+  /**
+   * Get the value of the <code>name</code> property as a trimmed <code>String</code>,

+   * <code>defaultVal</code> if no such property exists. 
+   * See @{Configuration#getTrimmed} for more details.
+   * 
+   * @param name          the property name.
+   * @param defaultVal    the property default value.
+   * @return              the value of the <code>name</code> or defaultVal 
+   *                      if it is not set.
+   */
+  public String getTrimmed(String name, String defaultValue) {
+    String ret = getTrimmed(name);
+    return ret == null ? defaultValue : ret;
+  }
 
   /**
    * Get the value of the <code>name</code> property, without doing
@@ -877,7 +892,7 @@ public class Configuration implements It
     }
     return result;
   }
-    
+
   /** 
    * Get the value of the <code>name</code> property as an <code>int</code>.
    *   

Modified: hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocket.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocket.java?rev=1436568&r1=1436567&r2=1436568&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocket.java
(original)
+++ hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocket.java
Mon Jan 21 19:29:06 2013
@@ -119,7 +119,7 @@ public class DomainSocket implements Clo
 
   /**
    * Given a path and a port, compute the effective path by replacing
-   * occurrences of __PORT__ with the port.  This is mainly to make it 
+   * occurrences of _PORT with the port.  This is mainly to make it 
    * possible to run multiple DataNodes locally for testing purposes.
    *
    * @param path            The source path
@@ -128,7 +128,7 @@ public class DomainSocket implements Clo
    * @return                The effective path
    */
   public static String getEffectivePath(String path, int port) {
-    return path.replace("__PORT__", String.valueOf(port));
+    return path.replace("_PORT", String.valueOf(port));
   }
 
   /**

Modified: hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/unix/TestDomainSocket.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/unix/TestDomainSocket.java?rev=1436568&r1=1436567&r2=1436568&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/unix/TestDomainSocket.java
(original)
+++ hadoop/common/branches/HDFS-347/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/unix/TestDomainSocket.java
Mon Jan 21 19:29:06 2013
@@ -91,7 +91,7 @@ public class TestDomainSocket {
   @Test(timeout=180000)
   public void testSocketPathSetGet() throws IOException {
     Assert.assertEquals("/var/run/hdfs/sock.100",
-        DomainSocket.getEffectivePath("/var/run/hdfs/sock.__PORT__", 100));
+        DomainSocket.getEffectivePath("/var/run/hdfs/sock._PORT", 100));
   }
 
   /**



Mime
View raw message