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:
One option is restrict the method accessibility tp package level and use
@VisibleForTesting annotation. Keeping a method public solely for testing
doesn't look good practice.
Also the idea is, If you have methods 'assisting', chances are the class is
actually doing too much. Moving these methods into separate classes with public
interfaces keeps the class with the assisting methods 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]