sodonnel commented on a change in pull request #2910:
URL: https://github.com/apache/ozone/pull/2910#discussion_r767666266



##########
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java
##########
@@ -502,6 +551,27 @@ public void close() throws IOException {
     ecChunkBufferCache.release();
   }
 
+  private void handleStripeFailure(int lastStripeSize, int parityCellSize,

Review comment:
       This is not a big problem, but is this method easier to follow written 
like this:
   
   ```
     private void handleStripeFailure(int lastStripeSize, int parityCellSize,
         boolean allocateBlockIfFull)
         throws IOException {
       for (int i = 0; i < RETRIES_ON_STRIPE_WRITE_FAILURE; i++) {
         stripeWriteStatus =
             rewriteStripeToNewBlockGroup(parityCellSize, lastStripeSize,
                 allocateBlockIfFull);
         if (stripeWriteStatus == StripeWriteStatus.SUCCESS) {
          return;
         }
       }
       throw new IOException(
           "Completed max allowed retries " + RETRIES_ON_STRIPE_WRITE_FAILURE
               + " on stripe failures.");
       }
     }
     ```
   
     It saves allocating a couple of variables and removes one of the two 
conditions in the while and the final IF statement. It look me a little bit of 
time to understand this method, so wanted to see how it would look if written 
like above.




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