hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r767636 - in /hadoop/core/trunk: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
Date Wed, 22 Apr 2009 19:53:57 GMT
Author: cdouglas
Date: Wed Apr 22 19:53:57 2009
New Revision: 767636

URL: http://svn.apache.org/viewvc?rev=767636&view=rev
Log:
HADOOP-5688. Fix HftpFileSystem checksum path construction. Contributed by Tsz Wo (Nicholas)
Sze

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java
    hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=767636&r1=767635&r2=767636&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Apr 22 19:53:57 2009
@@ -435,6 +435,13 @@
     and instead passes the PID back and forth between the TaskTracker and the Task 
     processes. (Ravi Gummadi via ddas)
 
+Release 0.20.1 - Unreleased
+
+  BUG FIXES
+
+    HADOOP-5688. Fix HftpFileSystem checksum path construction. (Tsz Wo
+    (Nicholas) Sze via cdouglas)
+
 Release 0.20.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java?rev=767636&r1=767635&r2=767636&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java Wed Apr 22 19:53:57
2009
@@ -262,7 +262,7 @@
       filechecksum = MD5MD5CRC32FileChecksum.valueOf(attrs);
     }
 
-    private FileChecksum getFileChecksum(Path f) throws IOException {
+    private FileChecksum getFileChecksum(String f) throws IOException {
       final HttpURLConnection connection = openConnection(
           "/fileChecksum" + f, "ugi=" + ugi);
       try {
@@ -288,7 +288,8 @@
 
   /** {@inheritDoc} */
   public FileChecksum getFileChecksum(Path f) throws IOException {
-    return new ChecksumParser().getFileChecksum(f);
+    final String s = makeQualified(f).toUri().getPath();
+    return new ChecksumParser().getFileChecksum(s);
   }
 
   @Override

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java?rev=767636&r1=767635&r2=767636&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java Wed Apr
22 19:53:57 2009
@@ -202,6 +202,10 @@
       final FileChecksum hftpfoocs = hftp.getFileChecksum(foo);
       System.out.println("hftpfoocs=" + hftpfoocs);
 
+      final Path qualified = new Path(hftpuri + dir, "foo" + n);
+      final FileChecksum qfoocs = hftp.getFileChecksum(qualified);
+      System.out.println("qfoocs=" + qfoocs);
+
       //write another file
       final Path bar = new Path(dir, "bar" + n);
       {
@@ -219,6 +223,9 @@
 
         assertEquals(hftpfoocs.hashCode(), barhashcode);
         assertEquals(hftpfoocs, barcs);
+
+        assertEquals(qfoocs.hashCode(), barhashcode);
+        assertEquals(qfoocs, barcs);
       }
     }
   }



Mime
View raw message