bilaharith commented on a change in pull request #2021:
URL: https://github.com/apache/hadoop/pull/2021#discussion_r425317447



##########
File path: 
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java
##########
@@ -321,9 +324,81 @@ public AbfsRestOperation renamePath(String source, final 
String destination, fin
             url,
             requestHeaders);
     op.execute();
+
+    if (op.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) {
+      return renameIdempotencyCheckOp(op, destination);
+    }
+
     return op;
   }
 
+  /**

Review comment:
       In that case is it possible to reduce the visibility to package 
protected and use @VisibleForTesting annotation.
   
   Though it is subjective. The idea is if you have methods 'assisting', 
chances are the class is actually doing too much. Splitting into smaller 
methods and then moving these methods into separate classes with public 
interfaces keeps the class with the big method responsible for one thing and 
one thing only (see Single Responsibility Principle). This move into separte 
classes automatically makes for a testable structure as your methods must be 
made public.
   
   
https://softwareengineering.stackexchange.com/questions/274937/is-it-bad-practice-to-make-methods-public-solely-for-the-sake-of-unit-testing
   




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

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