Explorar o código

HADOOP-1340. Set the replication factor of the MD5 file in the filecache to be the same as the replication factor of the original file. Contributed by Dhruba Borthakur.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@538631 13f79535-47bb-0310-9956-ffa450edef68
Thomas White %!s(int64=18) %!d(string=hai) anos
pai
achega
534d7b4eeb
Modificáronse 2 ficheiros con 6 adicións e 1 borrados
  1. 4 0
      CHANGES.txt
  2. 2 1
      src/java/org/apache/hadoop/filecache/DistributedCache.java

+ 4 - 0
CHANGES.txt

@@ -14,6 +14,10 @@ Trunk (unreleased changes)
   4. HADOOP-1342.  In aggregators, permit one to limit the number of
      unique values per key.  (Runping Qi via cutting)
 
+  5. HADOOP-1340.  Set the replication factor of the MD5 file in the filecache
+     to be the same as the replication factor of the original file.
+     (Dhruba Borthakur via tomwhite.)
+
 
 Branch 0.13 (unreleased changes)
 

+ 2 - 1
src/java/org/apache/hadoop/filecache/DistributedCache.java

@@ -320,7 +320,8 @@ public class DistributedCache {
       fsStream.close();
       digest = md5.digest();
 
-      FSDataOutputStream out = fileSystem.create(md5File);
+      short replication = fileSystem.getReplication(filePath);
+      FSDataOutputStream out = fileSystem.create(md5File, replication);
       out.write(digest);
       out.close();
     } else {