Browse Source

HDFS-8719. Erasure Coding: client generates too many small packets when writing parity data. Contributed by Li Bo.

Walter Su 10 years ago
parent
commit
48f3830f21

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt

@@ -332,3 +332,6 @@
 
     HDFS-8461. Erasure coding: fix priority level of UnderReplicatedBlocks for
     striped block. (Walter Su via jing9)
+
+    HDFS-8719. Erasure Coding: client generates too many small packets when
+    writing parity data. (Li Bo via waltersu4549)

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java

@@ -459,7 +459,7 @@ public class DFSOutputStream extends FSOutputSummer
    * write filled up its partial chunk. Tell the summer to generate full
    * crc chunks from now on.
    */
-  private void adjustChunkBoundary() {
+  protected void adjustChunkBoundary() {
     if (streamer.getAppendChunk() &&
         streamer.getBytesCurBlock() % bytesPerChecksum == 0) {
       streamer.setAppendChunk(false);

+ 1 - 0
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSStripedOutputStream.java

@@ -318,6 +318,7 @@ public class DFSStripedOutputStream extends DFSOutputStream {
 
   private synchronized StripedDataStreamer setCurrentStreamer(int i) {
     streamer = streamers.get(i);
+    adjustChunkBoundary();
     return getCurrentStreamer();
   }