saxenapranav commented on code in PR #5447:
URL: https://github.com/apache/hadoop/pull/5447#discussion_r1133411855


##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/BasicAuthConfigurator.java:
##########
@@ -33,6 +33,16 @@ public class BasicAuthConfigurator implements 
ConnectionConfigurator {
   private final ConnectionConfigurator parent;
   private final String credentials;
 
+  static public ConnectionConfigurator getConfigurator(

Review Comment:
   Since this method has to be called by URLConnectionFactory which is in same 
package. Lets have it package-protected and remove `public`



##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/BasicAuthConfigurator.java:
##########
@@ -33,6 +33,16 @@ public class BasicAuthConfigurator implements 
ConnectionConfigurator {
   private final ConnectionConfigurator parent;
   private final String credentials;
 
+  static public ConnectionConfigurator getConfigurator(

Review Comment:
   Should this method be moved to `URLConnectionFactory` class only?
   Reason being, when external class calls ` 
BasicAuthConfigurator.getConfigurator`, to developer it can look that we want 
something out of `BasicAuthConfigurator`, but instead it either gives 
BasicAuthConfigurator object or parent-configurator object. What you feel?



##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java:
##########
@@ -307,6 +310,20 @@ public StorageStatistics provide() {
                 return new DFSOpsCountStatistics();
               }
             });
+    pathPrefix = PATH_PREFIX;
+    boolean useBasePath = conf.getBoolean(
+        HdfsClientConfigKeys.DFS_CLIENT_WEBHDFS_USE_BASE_PATH_KEY,
+        HdfsClientConfigKeys.DFS_CLIENT_WEBHDFS_USE_BASE_PATH_DEFAULT
+    );
+    if (uri.getPath() != null && !uri.getPath().equals("") && useBasePath) {

Review Comment:
   although uri can not be null, but better to have null-check on that.



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