hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1213264 - in /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common: CHANGES.txt src/test/java/org/apache/hadoop/net/StaticMapping.java src/test/java/org/apache/hadoop/net/TestStaticMapping.java
Date Mon, 12 Dec 2011 15:05:33 GMT
Author: stevel
Date: Mon Dec 12 15:05:32 2011
New Revision: 1213264

URL: http://svn.apache.org/viewvc?rev=1213264&view=rev
Log:
HADOOP-7878  Regression: HADOOP-7777 switch changes break HDFS tests when the isSingleSwitch()
predicate is used

Modified:
    hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java
    hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestStaticMapping.java

Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1213264&r1=1213263&r2=1213264&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt Mon
Dec 12 15:05:32 2011
@@ -80,6 +80,9 @@ Release 0.23.1 - Unreleased
 
     HADOOP-7898. Fix javadoc warnings in AuthenticationToken.java. (suresh)
 
+    HADOOP-7878  Regression: HADOOP-7777 switch changes break HDFS tests when the
+    isSingleSwitch() predicate is used. (stevel)
+
 Release 0.23.0 - 2011-11-01 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java?rev=1213264&r1=1213263&r2=1213264&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/StaticMapping.java
Mon Dec 12 15:05:32 2011
@@ -38,9 +38,11 @@ import java.util.Map;
 public class StaticMapping extends AbstractDNSToSwitchMapping  {
 
   /**
-   * key to define the node mapping as a comma-delimited list of host=rack
+   * Key to define the node mapping as a comma-delimited list of host=rack
    * mappings, e.g. <code>host1=r1,host2=r1,host3=r2</code>.
-   * </p>
+   * <p/>
+   * Value: {@value}
+   * <p/>
    * <b>Important: </b>spaces not trimmed and are considered significant.
    */
   public static final String KEY_HADOOP_CONFIGURED_NODE_MAPPING =
@@ -107,18 +109,16 @@ public class StaticMapping extends Abstr
   }
 
   /**
-   * This mapping is only single switch if the map is empty
-   * @return the current switching status
+   * Declare that this mapping is always multi-switch
+   * @return false, always
    */
   @Override
   public boolean isSingleSwitch() {
-    synchronized (nameToRackMap) {
-      return nameToRackMap.isEmpty();
-    }
+    return false;
   }
 
   /**
-   * Clear the map and revert to being a single switch
+   * Clear the map
    */
   public static void resetMap() {
     synchronized (nameToRackMap) {

Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestStaticMapping.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestStaticMapping.java?rev=1213264&r1=1213263&r2=1213264&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestStaticMapping.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestStaticMapping.java
Mon Dec 12 15:05:32 2011
@@ -44,7 +44,8 @@ public class TestStaticMapping extends A
   @Test
   public void testStaticIsSingleSwitch() throws Throwable {
     StaticMapping mapping = newInstance();
-    assertTrue("Empty maps are not single switch", mapping.isSingleSwitch());
+    assertFalse("Empty maps should not be not single switch",
+                mapping.isSingleSwitch());
   }
 
 
@@ -53,10 +54,8 @@ public class TestStaticMapping extends A
     StaticMapping staticMapping = newInstance();
     CachedDNSToSwitchMapping mapping =
         new CachedDNSToSwitchMapping(staticMapping);
-    assertTrue("Expected single switch", mapping.isSingleSwitch());
     StaticMapping.addNodeToRack("n1", "r1");
-    assertFalse("Expected to be multi switch",
-                mapping.isSingleSwitch());
+    assertFalse("Expected multi switch", mapping.isSingleSwitch());
   }
 
   @Test
@@ -96,8 +95,9 @@ public class TestStaticMapping extends A
   public void testNullConfiguration() throws Throwable {
     StaticMapping mapping = newInstance();
     mapping.setConf(null);
-    assertTrue("Null maps is not single switch", mapping.isSingleSwitch());
-    assertTrue("Expected to be single switch",
+    assertFalse("Null maps are expected to be multi switch",
+                mapping.isSingleSwitch());
+    assertFalse("Expected to be multi switch",
                AbstractDNSToSwitchMapping.isMappingSingleSwitch(mapping));
   }
 }



Mime
View raw message