You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/12/13 11:32:28 UTC

[GitHub] [ozone] sodonnel commented on a change in pull request #2910: HDDS-6036: EC: handleStripeFailure should retry

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org