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

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

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


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClientHandler.java:
##########
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.fs.azurebfs.services;
+
+import org.apache.hadoop.fs.azurebfs.constants.AbfsServiceType;
+import org.apache.hadoop.util.Preconditions;
+
+/**
+ * AbfsClientHandler is a class that provides a way to get the AbfsClient
+ * based on the service type.
+ */
+public class AbfsClientHandler {
+  private AbfsServiceType defaultServiceType;
+  private AbfsClient dfsAbfsClient;
+  private AbfsClient blobAbfsClient;
+
+  public AbfsClientHandler(AbfsServiceType defaultServiceType,
+      AbfsClient dfsAbfsClient, AbfsClient blobAbfsClient) {
+    this.blobAbfsClient = blobAbfsClient;
+    this.dfsAbfsClient = dfsAbfsClient;
+    this.defaultServiceType = defaultServiceType;
+  }
+
+  public AbfsClient getClient() {
+    if (defaultServiceType == AbfsServiceType.DFS) {
+      Preconditions.checkNotNull(dfsAbfsClient, "DFS client is not 
initialized");

Review Comment:
   Checked the constructor, blobClient can be null if 
`abfsConfiguration#isBlobClientInitRequired` is false. We would need these 
preconditions. We can resolve this comment.





> 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