Explorar el Código

Merge -r 587325:587326 from trunk to branch 0.15. Part of HADOOP-2080.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/branches/branch-0.15@587329 13f79535-47bb-0310-9956-ffa450edef68
Owen O'Malley hace 18 años
padre
commit
03e83e39bd
Se han modificado 1 ficheros con 8 adiciones y 2 borrados
  1. 8 2
      src/java/org/apache/hadoop/fs/ChecksumFileSystem.java

+ 8 - 2
src/java/org/apache/hadoop/fs/ChecksumFileSystem.java

@@ -37,7 +37,7 @@ import org.apache.hadoop.util.StringUtils;
  *****************************************************************/
 public abstract class ChecksumFileSystem extends FilterFileSystem {
   private static final byte[] CHECKSUM_VERSION = new byte[] {'c', 'r', 'c', 0};
-  private final int bytesPerChecksum;
+  private int bytesPerChecksum;
 
   public static double getApproxChkSumLength(long size) {
     return ChecksumFSOutputSummer.CHKSUM_AS_FRACTION * size;
@@ -45,7 +45,13 @@ public abstract class ChecksumFileSystem extends FilterFileSystem {
   
   public ChecksumFileSystem(FileSystem fs) {
     super(fs);
-    bytesPerChecksum = getConf().getInt("io.bytes.per.checksum", 512);
+  }
+
+  public void setConf(Configuration conf) {
+    super.setConf(conf);
+    if (conf != null) {
+      bytesPerChecksum = conf.getInt("io.bytes.per.checksum", 512);
+    }
   }
 
   /** get the raw file system */