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


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java:
##########
@@ -1776,38 +1791,40 @@ private void initializeClient(URI uri, String 
fileSystemName,
       dfsClient = new AbfsDfsClient(baseUrl, creds, abfsConfiguration,
           tokenProvider, encryptionContextProvider,
           populateAbfsClientContext());
-      blobClient = defaultServiceType == AbfsServiceType.BLOB
-          || abfsConfiguration.isBlobClientInitRequired()
+      blobClient = abfsConfiguration.isBlobClientInitRequired()
           ? new AbfsBlobClient(baseUrl, creds, abfsConfiguration, 
tokenProvider,
           encryptionContextProvider, populateAbfsClientContext())
           : null;
     } else {
       dfsClient = new AbfsDfsClient(baseUrl, creds, abfsConfiguration,
           sasTokenProvider, encryptionContextProvider,
           populateAbfsClientContext());
-      blobClient = defaultServiceType == AbfsServiceType.BLOB
-          || abfsConfiguration.isBlobClientInitRequired()
+      blobClient = abfsConfiguration.isBlobClientInitRequired()
           ? new AbfsBlobClient(baseUrl, creds, abfsConfiguration, 
sasTokenProvider,
           encryptionContextProvider, populateAbfsClientContext())
           : null;
     }
 
-    this.clientHandler = new AbfsClientHandler(defaultServiceType, dfsClient, 
blobClient);
+    this.clientHandler = new AbfsClientHandler(getConfiguredServiceType(),
+        dfsClient, blobClient);
     this.client = clientHandler.getClient();
 
     LOG.trace("AbfsClient init complete");
   }
 
-  private AbfsServiceType getDefaultServiceType(Configuration conf)
-      throws UnsupportedAbfsOperationException{
-    if 
(conf.get(FS_DEFAULT_NAME_KEY).contains(AbfsServiceType.BLOB.toString().toLowerCase()))
 {
-      // Todo: [FnsOverBlob] return "AbfsServiceType.BLOB" once the code is 
ready for Blob Endpoint Support.
-      throw new UnsupportedAbfsOperationException(
-          "Blob Endpoint Support is not yet implemented. Please use DFS 
Endpoint.");
+  private AbfsServiceType identifyAbfsServiceType() {
+    if (uri.toString().contains(FileSystemUriSchemes.ABFS_BLOB_DOMAIN_NAME)) {
+      return AbfsServiceType.BLOB;
     }
+    // Incase of DFS Domain name or any other custom endpoint, the service
+    // type is to be identified as default DFS.
     return AbfsServiceType.DFS;

Review Comment:
   we can have get(uri) in AbfsServiceType, which returns back the relevant 
enum. Also, we can remove FileSystemUriSchemes#ABFS_BLOB_DOMAIN_NAME, and 
ABFS_DFS_DOMAIN_NAME



-- 
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: common-issues-unsubscr...@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to