[ 
https://issues.apache.org/jira/browse/HADOOP-19187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17851578#comment-17851578
 ] 

ASF GitHub Bot commented on HADOOP-19187:
-----------------------------------------

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





> ABFS: Making AbfsClient Abstract for supporting both DFS and Blob Endpoint
> --------------------------------------------------------------------------
>
>                 Key: HADOOP-19187
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19187
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/azure
>    Affects Versions: 3.4.0
>            Reporter: Anuj Modi
>            Assignee: Anuj Modi
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.5.0, 3.4.1
>
>
> Azure Services support two different set of APIs.
> Blob: 
> [https://learn.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api]
>  
> DFS: 
> [https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/operation-groups]
>  
> As per the plan in HADOOP-19179, this task enables ABFS Driver to work with 
> both set of APIs as per the requirement.
> Scope of this task is to refactor the ABfsClient so that ABFSStore can choose 
> to interact with the client it wants based on the endpoint configured by user.
> The blob endpoint support will remain "Unsupported" until the whole code is 
> checked-in and well tested.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to