svn commit: r1476489 - in /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java

2013-04-26 Thread jlowe
Author: jlowe
Date: Sat Apr 27 04:19:47 2013
New Revision: 1476489

URL: http://svn.apache.org/r1476489
Log:
svn merge -c 1476487 FIXES: HADOOP-9504. MetricsDynamicMBeanBase has 
concurrency issues in createMBeanInfo. Contributed by Liang Xie

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/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.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=1476489&r1=1476488&r2=1476489&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
 Sat Apr 27 04:19:47 2013
@@ -21,6 +21,9 @@ Release 0.23.8 - UNRELEASED
 HADOOP-9469. mapreduce/yarn source jars not included in dist tarball
 (Robert Parker via tgraves)
 
+HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in
+createMBeanInfo (Liang Xie via jlowe)
+
 Release 0.23.7 - 2013-04-18
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java?rev=1476489&r1=1476488&r2=1476489&view=diff
==
--- 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
 (original)
+++ 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
 Sat Apr 27 04:19:47 2013
@@ -18,9 +18,9 @@
 package org.apache.hadoop.metrics.util;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -69,6 +69,7 @@ public abstract class MetricsDynamicMBea
   protected MetricsDynamicMBeanBase(final MetricsRegistry mr, final String 
aMBeanDescription) {
 metricsRegistry = mr;
 mbeanDescription = aMBeanDescription;
+metricsRateAttributeMod = new ConcurrentHashMap();
 createMBeanInfo();
   }
   
@@ -78,7 +79,6 @@ public abstract class MetricsDynamicMBea
   }
   
   private void createMBeanInfo() {
-metricsRateAttributeMod = new HashMap();
 boolean needsMinMaxResetOperation = false;
 List attributesInfo = new 
ArrayList();
 MBeanOperationInfo[] operationsInfo = null;




svn commit: r1476488 - in /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java

2013-04-26 Thread jlowe
Author: jlowe
Date: Sat Apr 27 04:13:04 2013
New Revision: 1476488

URL: http://svn.apache.org/r1476488
Log:
svn merge -c 1476487 FIXES: HADOOP-9504. MetricsDynamicMBeanBase has 
concurrency issues in createMBeanInfo. Contributed by Liang Xie

Modified:

hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt

hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java

Modified: 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1476488&r1=1476487&r2=1476488&view=diff
==
--- 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt 
(original)
+++ 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt 
Sat Apr 27 04:13:04 2013
@@ -127,6 +127,9 @@ Release 2.0.5-beta - UNRELEASED
 
 HADOOP-9473. Typo in FileUtil copy() method. (Glen Mazza via suresh)
 
+HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in
+createMBeanInfo (Liang Xie via jlowe)
+
 Release 2.0.4-alpha - UNRELEASED
 
   INCOMPATIBLE CHANGES
@@ -1162,6 +1165,9 @@ Release 0.23.8 - UNRELEASED
 HADOOP-9469. mapreduce/yarn source jars not included in dist tarball
 (Robert Parker via tgraves)
 
+HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in
+createMBeanInfo (Liang Xie via jlowe)
+
 Release 0.23.7 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java?rev=1476488&r1=1476487&r2=1476488&view=diff
==
--- 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
 (original)
+++ 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
 Sat Apr 27 04:13:04 2013
@@ -18,9 +18,9 @@
 package org.apache.hadoop.metrics.util;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -69,6 +69,7 @@ public abstract class MetricsDynamicMBea
   protected MetricsDynamicMBeanBase(final MetricsRegistry mr, final String 
aMBeanDescription) {
 metricsRegistry = mr;
 mbeanDescription = aMBeanDescription;
+metricsRateAttributeMod = new ConcurrentHashMap();
 createMBeanInfo();
   }
   
@@ -78,7 +79,6 @@ public abstract class MetricsDynamicMBea
   }
   
   private void createMBeanInfo() {
-metricsRateAttributeMod = new HashMap();
 boolean needsMinMaxResetOperation = false;
 List attributesInfo = new 
ArrayList();
 MBeanOperationInfo[] operationsInfo = null;




svn commit: r1476487 - in /hadoop/common/trunk/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java

2013-04-26 Thread jlowe
Author: jlowe
Date: Sat Apr 27 04:11:23 2013
New Revision: 1476487

URL: http://svn.apache.org/r1476487
Log:
HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in createMBeanInfo. 
Contributed by Liang Xie

Modified:
hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt

hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1476487&r1=1476486&r2=1476487&view=diff
==
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt 
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt Sat Apr 
27 04:11:23 2013
@@ -644,6 +644,9 @@ Release 2.0.5-beta - UNRELEASED
 
 HADOOP-9473. Typo in FileUtil copy() method. (Glen Mazza via suresh)
 
+HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in
+createMBeanInfo (Liang Xie via jlowe)
+
 Release 2.0.4-alpha - UNRELEASED
 
   INCOMPATIBLE CHANGES
@@ -1657,6 +1660,9 @@ Release 0.23.8 - UNRELEASED
 HADOOP-9469. mapreduce/yarn source jars not included in dist tarball
 (Robert Parker via tgraves)
 
+HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in
+createMBeanInfo (Liang Xie via jlowe)
+
 Release 0.23.7 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java?rev=1476487&r1=1476486&r2=1476487&view=diff
==
--- 
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
 (original)
+++ 
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
 Sat Apr 27 04:11:23 2013
@@ -18,9 +18,9 @@
 package org.apache.hadoop.metrics.util;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -69,6 +69,7 @@ public abstract class MetricsDynamicMBea
   protected MetricsDynamicMBeanBase(final MetricsRegistry mr, final String 
aMBeanDescription) {
 metricsRegistry = mr;
 mbeanDescription = aMBeanDescription;
+metricsRateAttributeMod = new ConcurrentHashMap();
 createMBeanInfo();
   }
   
@@ -78,7 +79,6 @@ public abstract class MetricsDynamicMBea
   }
   
   private void createMBeanInfo() {
-metricsRateAttributeMod = new HashMap();
 boolean needsMinMaxResetOperation = false;
 List attributesInfo = new 
ArrayList();
 MBeanOperationInfo[] operationsInfo = null;




[Hadoop Wiki] Update of "ContributorsGroup" by Arun C Murthy

2013-04-26 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change 
notification.

The "ContributorsGroup" page has been changed by Arun C Murthy:
http://wiki.apache.org/hadoop/ContributorsGroup?action=diff&rev1=54&rev2=55

   * SteveWatt
   * StuHood
   * sureshms
+  * szetszwo
   * TedDargis
   * TedDunning
   * TeppoKurki


svn commit: r1476464 - in /hadoop/common/branches/branch-1.2: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobInProgress.java src/mapred/org/apache/hadoop/mapred/JobTracker.java src/test/org/apache

2013-04-26 Thread acmurthy
Author: acmurthy
Date: Sat Apr 27 01:43:49 2013
New Revision: 1476464

URL: http://svn.apache.org/r1476464
Log:
Merge -c 1476463 from branch-1 to branch-1.2 to fix MAPREDUCE-5158. Cleanup 
job-submission related files on HDFS during JobTracker restart for jobs which 
set mapreduce.job.restart.recover to false to indicate they don't want to be 
recovered. Contributed by Mayank Bansal.

Modified:
hadoop/common/branches/branch-1.2/CHANGES.txt

hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobInProgress.java

hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobTracker.java

hadoop/common/branches/branch-1.2/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java

Modified: hadoop/common/branches/branch-1.2/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/CHANGES.txt?rev=1476464&r1=1476463&r2=1476464&view=diff
==
--- hadoop/common/branches/branch-1.2/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1.2/CHANGES.txt Sat Apr 27 01:43:49 2013
@@ -594,6 +594,11 @@ Release 1.2.0 - 2013.04.16
 HADOOP-9502. chmod/chown do not return error exit codes for some 
exceptions.
 (szetszwo)
 
+MAPREDUCE-5158. Cleanup job-submission related files on HDFS during
+JobTracker restart for jobs which set mapreduce.job.restart.recover to
+false to indicate they don't want to be recovered. (Mayank Bansal via
+acmurthy) 
+
 Release 1.1.2 - 2013.01.30
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=1476464&r1=1476463&r2=1476464&view=diff
==
--- 
hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
 (original)
+++ 
hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
 Sat Apr 27 01:43:49 2013
@@ -3298,6 +3298,16 @@ public class JobInProgress {
   jobtracker.storeCompletedJob(this);
   jobtracker.finalizeJob(this);
 
+}
+cleanupJob();
+  }
+  
+  /**
+   * The job is dead. We're now cleaning it, getting rid of job directories and
+   * removing all delegation token etc.
+   */
+  void cleanupJob() {
+synchronized (this) {
   try {
 // Definitely remove the local-disk copy of the job file
 if (localJobFile != null) {

Modified: 
hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=1476464&r1=1476463&r2=1476464&view=diff
==
--- 
hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobTracker.java
 (original)
+++ 
hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapred/JobTracker.java
 Sat Apr 27 01:43:49 2013
@@ -3609,6 +3609,8 @@ public class JobTracker implements MRCon
 !job.getJobConf().getBoolean(
 JobConf.MAPREDUCE_RECOVER_JOB, 
 JobConf.DEFAULT_MAPREDUCE_RECOVER_JOB)) {
+  LOG.info("Job "+ jobId.toString() + " is not enable for recovery, 
cleaning up job files");
+  job.cleanupJob();
   return null;
 }
 

Modified: 
hadoop/common/branches/branch-1.2/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java?rev=1476464&r1=1476463&r2=1476464&view=diff
==
--- 
hadoop/common/branches/branch-1.2/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java
 (original)
+++ 
hadoop/common/branches/branch-1.2/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java
 Sat Apr 27 01:43:49 2013
@@ -257,6 +257,8 @@ public class TestRecoveryManager {
   UtilsForTests.waitFor(100);
 }
 Assert.assertTrue("Task should be successful", rJob1.isSuccessful());
+Assert.assertTrue("Job should be cleaned up", !fs.exists(new 
Path(job1.get("mapreduce.job.dir";
+Assert.assertTrue("Job should be cleaned up", !fs.exists(new 
Path(job2.get("mapreduce.job.dir";
   }
 
   public static class TestJobTrackerInstrumentation extends 
JobTrackerInstrumentation {




svn commit: r1476463 - in /hadoop/common/branches/branch-1: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobInProgress.java src/mapred/org/apache/hadoop/mapred/JobTracker.java src/test/org/apache/h

2013-04-26 Thread acmurthy
Author: acmurthy
Date: Sat Apr 27 01:43:06 2013
New Revision: 1476463

URL: http://svn.apache.org/r1476463
Log:
MAPREDUCE-5158. Cleanup job-submission related files on HDFS during JobTracker 
restart for jobs which set mapreduce.job.restart.recover to false to indicate 
they don't want to be recovered. Contributed by Mayank Bansal.

Modified:
hadoop/common/branches/branch-1/CHANGES.txt

hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobInProgress.java

hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java

hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1476463&r1=1476462&r2=1476463&view=diff
==
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Sat Apr 27 01:43:06 2013
@@ -637,6 +637,11 @@ Release 1.2.0 - unreleased
 HADOOP-9502. chmod/chown do not return error exit codes for some 
exceptions.
 (szetszwo)
 
+MAPREDUCE-5158. Cleanup job-submission related files on HDFS during
+JobTracker restart for jobs which set mapreduce.job.restart.recover to
+false to indicate they don't want to be recovered. (Mayank Bansal via
+acmurthy) 
+
 Release 1.1.2 - 2013.01.30
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=1476463&r1=1476462&r2=1476463&view=diff
==
--- 
hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
 (original)
+++ 
hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
 Sat Apr 27 01:43:06 2013
@@ -3298,6 +3298,16 @@ public class JobInProgress {
   jobtracker.storeCompletedJob(this);
   jobtracker.finalizeJob(this);
 
+}
+cleanupJob();
+  }
+  
+  /**
+   * The job is dead. We're now cleaning it, getting rid of job directories and
+   * removing all delegation token etc.
+   */
+  void cleanupJob() {
+synchronized (this) {
   try {
 // Definitely remove the local-disk copy of the job file
 if (localJobFile != null) {

Modified: 
hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=1476463&r1=1476462&r2=1476463&view=diff
==
--- 
hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java
 (original)
+++ 
hadoop/common/branches/branch-1/src/mapred/org/apache/hadoop/mapred/JobTracker.java
 Sat Apr 27 01:43:06 2013
@@ -3609,6 +3609,8 @@ public class JobTracker implements MRCon
 !job.getJobConf().getBoolean(
 JobConf.MAPREDUCE_RECOVER_JOB, 
 JobConf.DEFAULT_MAPREDUCE_RECOVER_JOB)) {
+  LOG.info("Job "+ jobId.toString() + " is not enable for recovery, 
cleaning up job files");
+  job.cleanupJob();
   return null;
 }
 

Modified: 
hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java?rev=1476463&r1=1476462&r2=1476463&view=diff
==
--- 
hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java
 (original)
+++ 
hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRecoveryManager.java
 Sat Apr 27 01:43:06 2013
@@ -257,6 +257,8 @@ public class TestRecoveryManager {
   UtilsForTests.waitFor(100);
 }
 Assert.assertTrue("Task should be successful", rJob1.isSuccessful());
+Assert.assertTrue("Job should be cleaned up", !fs.exists(new 
Path(job1.get("mapreduce.job.dir";
+Assert.assertTrue("Job should be cleaned up", !fs.exists(new 
Path(job2.get("mapreduce.job.dir";
   }
 
   public static class TestJobTrackerInstrumentation extends 
JobTrackerInstrumentation {




svn commit: r1476453 - /hadoop/common/branches/HDFS-2802/

2013-04-26 Thread szetszwo
Author: szetszwo
Date: Fri Apr 26 23:50:17 2013
New Revision: 1476453

URL: http://svn.apache.org/r1476453
Log:
Merge r1476010 through r1476452 from trunk.

Modified:
hadoop/common/branches/HDFS-2802/   (props changed)

Propchange: hadoop/common/branches/HDFS-2802/
--
  Merged /hadoop/common/trunk:r1476010-1476452




svn commit: r1476453 - in /hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common: CHANGES.txt src/main/docs/ src/main/java/ src/main/java/org/apache/hadoop/net/NetworkTopology.java src/

2013-04-26 Thread szetszwo
Author: szetszwo
Date: Fri Apr 26 23:50:17 2013
New Revision: 1476453

URL: http://svn.apache.org/r1476453
Log:
Merge r1476010 through r1476452 from trunk.

Modified:

hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/CHANGES.txt
   (props changed)

hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/docs/
   (props changed)

hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/java/
   (props changed)

hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java

hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/test/core/
   (props changed)

Propchange: 
hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/CHANGES.txt
--
  Merged 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt:r1476010-1476452

Propchange: 
hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/docs/
--
  Merged 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/docs:r1476010-1476452

Propchange: 
hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/java/
--
  Merged 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java:r1476010-1476452

Modified: 
hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java?rev=1476453&r1=1476452&r2=1476453&view=diff
==
--- 
hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
 (original)
+++ 
hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
 Fri Apr 26 23:50:17 2013
@@ -446,6 +446,28 @@ public class NetworkTopology {
 return getNode(node.getNetworkLocation());
   }
   
+  /**
+   * Given a string representation of a rack, return its children
+   * @param loc a path-like string representation of a rack
+   * @return a newly allocated list with all the node's children
+   */
+  public List getDatanodesInRack(String loc) {
+netlock.readLock().lock();
+try {
+  loc = NodeBase.normalize(loc);
+  if (!NodeBase.ROOT.equals(loc)) {
+loc = loc.substring(1);
+  }
+  InnerNode rack = (InnerNode) clusterMap.getLoc(loc);
+  if (rack == null) {
+return null;
+  }
+  return new ArrayList(rack.getChildren());
+} finally {
+  netlock.readLock().unlock();
+}
+  }
+
   /** Remove a node
* Update node counter and rack counter if necessary
* @param node node to be removed; can be null

Propchange: 
hadoop/common/branches/HDFS-2802/hadoop-common-project/hadoop-common/src/test/core/
--
  Merged 
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/core:r1476010-1476452




svn commit: r1476396 - in /hadoop/common/site/main: author/src/documentation/content/xdocs/ publish/

2013-04-26 Thread todd
Author: todd
Date: Fri Apr 26 20:42:32 2013
New Revision: 1476396

URL: http://svn.apache.org/r1476396
Log:
Fix spelling typos in index.html. Reported by Greg Rahn.

Modified:
hadoop/common/site/main/author/src/documentation/content/xdocs/index.xml
hadoop/common/site/main/publish/bylaws.pdf
hadoop/common/site/main/publish/index.html
hadoop/common/site/main/publish/index.pdf
hadoop/common/site/main/publish/issue_tracking.pdf
hadoop/common/site/main/publish/linkmap.pdf
hadoop/common/site/main/publish/mailing_lists.pdf
hadoop/common/site/main/publish/privacy_policy.pdf
hadoop/common/site/main/publish/who.pdf

Modified: 
hadoop/common/site/main/author/src/documentation/content/xdocs/index.xml
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/author/src/documentation/content/xdocs/index.xml?rev=1476396&r1=1476395&r2=1476396&view=diff
==
--- hadoop/common/site/main/author/src/documentation/content/xdocs/index.xml 
(original)
+++ hadoop/common/site/main/author/src/documentation/content/xdocs/index.xml 
Fri Apr 26 20:42:32 2013
@@ -28,8 +28,8 @@
   of computers using simple programming models. It is designed to scale up
   from single servers to thousands of machines, each offering local
   computation and storage. Rather than rely on hardware to deliver
-  high-avaiability, the library itself is designed to detect and handle
-  failures at the application layer, so delivering a highly-availabile
+  high-availability, the library itself is designed to detect and handle
+  failures at the application layer, so delivering a highly-available
   service on top of a cluster of computers, each of which may be prone to
   failures.
   

Modified: hadoop/common/site/main/publish/bylaws.pdf
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/publish/bylaws.pdf?rev=1476396&r1=1476395&r2=1476396&view=diff
==
Binary files - no diff available.

Modified: hadoop/common/site/main/publish/index.html
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/publish/index.html?rev=1476396&r1=1476395&r2=1476396&view=diff
==
--- hadoop/common/site/main/publish/index.html (original)
+++ hadoop/common/site/main/publish/index.html Fri Apr 26 20:42:32 2013
@@ -292,8 +292,8 @@ document.write("Last Published: " + docu
   of computers using simple programming models. It is designed to scale up
   from single servers to thousands of machines, each offering local
   computation and storage. Rather than rely on hardware to deliver
-  high-avaiability, the library itself is designed to detect and handle
-  failures at the application layer, so delivering a highly-availabile
+  high-availability, the library itself is designed to detect and handle
+  failures at the application layer, so delivering a highly-available
   service on top of a cluster of computers, each of which may be prone to
   failures.
   

Modified: hadoop/common/site/main/publish/index.pdf
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/publish/index.pdf?rev=1476396&r1=1476395&r2=1476396&view=diff
==
Binary files - no diff available.

Modified: hadoop/common/site/main/publish/issue_tracking.pdf
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/publish/issue_tracking.pdf?rev=1476396&r1=1476395&r2=1476396&view=diff
==
Binary files - no diff available.

Modified: hadoop/common/site/main/publish/linkmap.pdf
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/publish/linkmap.pdf?rev=1476396&r1=1476395&r2=1476396&view=diff
==
Binary files - no diff available.

Modified: hadoop/common/site/main/publish/mailing_lists.pdf
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/publish/mailing_lists.pdf?rev=1476396&r1=1476395&r2=1476396&view=diff
==
Binary files - no diff available.

Modified: hadoop/common/site/main/publish/privacy_policy.pdf
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/publish/privacy_policy.pdf?rev=1476396&r1=1476395&r2=1476396&view=diff
==
Binary files - no diff available.

Modified: hadoop/common/site/main/publish/who.pdf
URL: 
http://svn.apache.org/viewvc/hadoop/common/site/main/publish/who.pdf?rev=1476396&r1=1476395&r2=1476396&view=diff
==
Binary files - no diff available.




svn commit: r1476395 - /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java

2013-04-26 Thread ddas
Author: ddas
Date: Fri Apr 26 20:39:51 2013
New Revision: 1476395

URL: http://svn.apache.org/r1476395
Log:
HDFS-2576. Enhances the DistributedFileSystem's create API so that clients can 
specify favored datanodes for a file's blocks. Contributed by Devaraj Das and 
Pritam Damania.

Modified:

hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java

Modified: 
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java?rev=1476395&r1=1476394&r2=1476395&view=diff
==
--- 
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
 (original)
+++ 
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
 Fri Apr 26 20:39:51 2013
@@ -446,6 +446,28 @@ public class NetworkTopology {
 return getNode(node.getNetworkLocation());
   }
   
+  /**
+   * Given a string representation of a rack, return its children
+   * @param loc a path-like string representation of a rack
+   * @return a newly allocated list with all the node's children
+   */
+  public List getDatanodesInRack(String loc) {
+netlock.readLock().lock();
+try {
+  loc = NodeBase.normalize(loc);
+  if (!NodeBase.ROOT.equals(loc)) {
+loc = loc.substring(1);
+  }
+  InnerNode rack = (InnerNode) clusterMap.getLoc(loc);
+  if (rack == null) {
+return null;
+  }
+  return new ArrayList(rack.getChildren());
+} finally {
+  netlock.readLock().unlock();
+}
+  }
+
   /** Remove a node
* Update node counter and rack counter if necessary
* @param node node to be removed; can be null