Author: suresh
Date: Tue Sep 27 07:38:27 2011
New Revision: 1176248
URL: http://svn.apache.org/viewvc?rev=1176248&view=rev
Log:
HDFS-2375. Fix TestFileAppend4 failure. Contributed by Suresh Srinivas.
Modified:
hadoop/common/branches/branch-0.20-security-205/CHANGES.txt
hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/hdfs/TestFileAppend4.java
Modified: hadoop/common/branches/branch-0.20-security-205/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/CHANGES.txt?rev=1176248&r1=1176247&r2=1176248&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security-205/CHANGES.txt Tue Sep 27
07:38:27 2011
@@ -222,6 +222,8 @@ Release 0.20.205.0 - 2011.09.12
HDFS-2361. hftp is broken. Fixed username checks in JspHelper. (jitendra)
+ HDFS-2375. Fix TestFileAppend4 failure. (suresh)
+
IMPROVEMENTS
MAPREDUCE-2928. MR-2413 improvements (Eli Collins via mattf)
Modified:
hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/hdfs/TestFileAppend4.java
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/hdfs/TestFileAppend4.java?rev=1176248&r1=1176247&r2=1176248&view=diff
==============================================================================
---
hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/hdfs/TestFileAppend4.java
(original)
+++
hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/hdfs/TestFileAppend4.java
Tue Sep 27 07:38:27 2011
@@ -139,11 +139,9 @@ public class TestFileAppend4 extends Tes
}
private void assertNumCurrentReplicas(short rep) throws Exception {
- OutputStream hdfs_out = stm.getWrappedStream();
- Method r = hdfs_out.getClass().getMethod("getNumCurrentReplicas",
- new Class<?> []{});
- r.setAccessible(true);
- int actualRepl = ((Integer)r.invoke(hdfs_out, NO_ARGS)).intValue();
+ DFSClient.DFSOutputStream hdfs_out = (DFSClient.DFSOutputStream) stm
+ .getWrappedStream();
+ int actualRepl = hdfs_out.getNumCurrentReplicas();
assertTrue(file1 + " should be replicated to " + rep + " datanodes, not " +
actualRepl + ".", actualRepl == rep);
}