fapifta commented on a change in pull request #2849:
URL: https://github.com/apache/ozone/pull/2849#discussion_r754752049



##########
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java
##########
@@ -351,38 +363,27 @@ private void handleOutputStreamWrite(int currIdx, long 
len,
       try {
         // Since it's a fullcell, let's write all content from buffer.
         writeToOutputStream(current, len, bytesToWrite.array(),
-            bytesToWrite.array().length, 0, current.getWrittenDataLength(),
-            isParity);
+            bytesToWrite.array().length, 0, isParity);
       } catch (Exception e) {
         markStreamAsFailed(e);
       }
     }
   }
 
   private int writeToOutputStream(BlockOutputStreamEntry current, long len,
-      byte[] b, int writeLen, int off, long currentPos, boolean isParity)
+      byte[] b, int writeLen, int off, boolean isParity)
       throws IOException {
     try {
       current.write(b, off, writeLen);
       if (!isParity) {
         offset += writeLen;
       }
     } catch (IOException ioe) {
-      // for the current iteration, totalDataWritten - currentPos gives the
-      // amount of data already written to the buffer
-
-      // In the retryPath, the total data to be written will always be equal
-      // to or less than the max length of the buffer allocated.
-      // The len specified here is the combined sum of the data length of
-      // the buffers
-      Preconditions.checkState(len <= config.getStreamBufferMaxSize());
-      int dataWritten = (int) (current.getWrittenDataLength() - currentPos);
-      writeLen = dataWritten;
-
       if (!isParity) {

Review comment:
       if we remove the changes to writeLen, during the exception handling, 
then we can just increase the offset before the write in the try block.
   Though I am not sure why this change is happening, can you share some 
reasoning? The original idea here is that there might be a partial write, and 
if that happened, we wanted to decrease the reported written length, with the 
change we do not do so anymore. Shouldn't we care about it? You might be right, 
and probably I just don't see 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