فهرست منبع

HADOOP-6558. Return null in HarFileSystem.getFileChecksum(..) since no checksum algorithm is implemented.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@911646 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 15 سال پیش
والد
کامیت
50dcc335be
3فایلهای تغییر یافته به همراه17 افزوده شده و 0 حذف شده
  1. 3 0
      CHANGES.txt
  2. 7 0
      src/java/org/apache/hadoop/fs/HarFileSystem.java
  3. 7 0
      src/test/core/org/apache/hadoop/fs/TestHarFileSystem.java

+ 3 - 0
CHANGES.txt

@@ -210,6 +210,9 @@ Trunk (unreleased changes)
     HADOOP-6570. RPC#stopProxy throws NPE if getProxyEngine(proxy) returns
     HADOOP-6570. RPC#stopProxy throws NPE if getProxyEngine(proxy) returns
     null. (hairong)
     null. (hairong)
 
 
+    HADOOP-6558. Return null in HarFileSystem.getFileChecksum(..) since no
+    checksum algorithm is implemented.  (szetszwo)
+
 Release 0.21.0 - Unreleased
 Release 0.21.0 - Unreleased
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 7 - 0
src/java/org/apache/hadoop/fs/HarFileSystem.java

@@ -539,6 +539,13 @@ public class HarFileSystem extends FilterFileSystem {
             makeRelative(this.uri.toString(), new Path(hstatus.name)));
             makeRelative(this.uri.toString(), new Path(hstatus.name)));
   }
   }
 
 
+  /**
+   * @return null since no checksum algorithm is implemented.
+   */
+  public FileChecksum getFileChecksum(Path f) {
+    return null;
+  }
+
   /**
   /**
    * Returns a har input stream which fakes end of 
    * Returns a har input stream which fakes end of 
    * file. It reads the index files to get the part 
    * file. It reads the index files to get the part 

+ 7 - 0
src/test/core/org/apache/hadoop/fs/TestHarFileSystem.java

@@ -45,4 +45,11 @@ public class TestHarFileSystem {
       e.printStackTrace(System.out);
       e.printStackTrace(System.out);
     }
     }
   }
   }
+
+  @Test
+  public void testFileChecksum() {
+    final Path p = new Path("har://file-localhost/foo.har/file1");
+    final HarFileSystem harfs = new HarFileSystem();
+    Assert.assertEquals(null, harfs.getFileChecksum(p));
+  }
 }
 }