umamaheswararao commented on a change in pull request #2455:
URL: https://github.com/apache/ozone/pull/2455#discussion_r697505771



##########
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java
##########
@@ -473,6 +524,39 @@ public void close() throws IOException {
     ecChunkBufferCache.release();
   }
 
+  private void addPadding(int parityCellSize) {
+    ByteBuffer[] buffers = ecChunkBufferCache.getDataBuffers();
+
+    for (int i = 1; i < numDataBlks; i++) {
+      // Pad zero bytes to make all cells exactly the size of parityCellSize
+      // If internal block is smaller than parity block, pad zero bytes.
+      // Also pad zero bytes to all parity cells
+      final int position = buffers[i].position();
+      assert position <= parityCellSize : "If an internal block is smaller"
+          + " than parity block, then its last cell should be small than last"
+          + " parity cell";
+      padBufferToLimit(buffers[i], parityCellSize);
+    }
+  }
+
+  public static void padBufferToLimit(ByteBuffer buf, int limit) {
+    int pos = buf.position();
+    if (pos >= limit) {
+      return;
+    }
+    Arrays.fill(buf.array(), pos, limit, (byte)0);
+    buf.position(limit);
+  }
+
+  private boolean isPartialStripe() {

Review comment:
       Agree. Just modified it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to