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



##########
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntry.java
##########
@@ -113,8 +113,13 @@ public void write(int b) throws IOException {
   @Override
   public void write(byte[] b, int off, int len) throws IOException {
     checkStream();
-    getOutputStream().write(b, off, len);
-    incCurrentPosition(len);
+    try {
+      getOutputStream().write(b, off, len);
+    }finally {
+      //Even though actual write failed we will move the position and when

Review comment:
       From *KeyOututStream: write(int) will use  write(buf, 0, 1); method only.
   ```
     @Override
     public void write(int b) throws IOException {
       byte[] buf = new byte[1];
       buf[0] = (byte) b;
       write(buf, 0, 1);
     }
   ```
   I am not very sure how we are using write(int) in *BlockOutputStream itself. 
This is not exposed impl.
   
   We are resetting the length in handleStripeFailure. HandleException is just 
setting the IOException when writing. After and before putBlock we will verify 
the failure and reset the lengths on the streams as needed if there are 
failures.




-- 
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