[
https://issues.apache.org/jira/browse/HADOOP-19187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871425#comment-17871425
]
ASF GitHub Bot commented on HADOOP-19187:
-----------------------------------------
anujmodi2021 commented on code in PR #6879:
URL: https://github.com/apache/hadoop/pull/6879#discussion_r1705908959
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -1507,7 +1053,7 @@ private String appendSASTokenToQuery(String path,
}
@VisibleForTesting
- private URL createRequestUrl(final String query) throws
AzureBlobFileSystemException {
+ protected URL createRequestUrl(final String query) throws
AzureBlobFileSystemException {
Review Comment:
Added
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -1292,117 +889,79 @@ public AbfsRestOperation deleteIdempotencyCheckOp(final
AbfsRestOperation op) {
return op;
}
- public AbfsRestOperation setOwner(final String path, final String owner,
final String group,
- TracingContext tracingContext)
- throws AzureBlobFileSystemException {
- final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();
- // JDK7 does not support PATCH, so to workaround the issue we will use
- // PUT and specify the real method in the X-Http-Method-Override header.
- requestHeaders.add(new AbfsHttpHeader(X_HTTP_METHOD_OVERRIDE,
- HTTP_METHOD_PATCH));
-
- if (owner != null && !owner.isEmpty()) {
- requestHeaders.add(new
AbfsHttpHeader(HttpHeaderConfigurations.X_MS_OWNER, owner));
- }
- if (group != null && !group.isEmpty()) {
- requestHeaders.add(new
AbfsHttpHeader(HttpHeaderConfigurations.X_MS_GROUP, group));
- }
-
- final AbfsUriQueryBuilder abfsUriQueryBuilder =
createDefaultUriQueryBuilder();
- abfsUriQueryBuilder.addQuery(HttpQueryParams.QUERY_PARAM_ACTION,
AbfsHttpConstants.SET_ACCESS_CONTROL);
- appendSASTokenToQuery(path, SASTokenProvider.SET_OWNER_OPERATION,
abfsUriQueryBuilder);
-
- final URL url = createRequestUrl(path, abfsUriQueryBuilder.toString());
- final AbfsRestOperation op = getAbfsRestOperation(
- AbfsRestOperationType.SetOwner,
- AbfsHttpConstants.HTTP_METHOD_PUT,
- url,
- requestHeaders);
- op.execute(tracingContext);
- return op;
- }
-
- public AbfsRestOperation setPermission(final String path, final String
permission,
- TracingContext tracingContext)
- throws AzureBlobFileSystemException {
- final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();
- // JDK7 does not support PATCH, so to workaround the issue we will use
- // PUT and specify the real method in the X-Http-Method-Override header.
- requestHeaders.add(new AbfsHttpHeader(X_HTTP_METHOD_OVERRIDE,
- HTTP_METHOD_PATCH));
-
- requestHeaders.add(new
AbfsHttpHeader(HttpHeaderConfigurations.X_MS_PERMISSIONS, permission));
-
- final AbfsUriQueryBuilder abfsUriQueryBuilder =
createDefaultUriQueryBuilder();
- abfsUriQueryBuilder.addQuery(HttpQueryParams.QUERY_PARAM_ACTION,
AbfsHttpConstants.SET_ACCESS_CONTROL);
- appendSASTokenToQuery(path, SASTokenProvider.SET_PERMISSION_OPERATION,
abfsUriQueryBuilder);
+ /**
+ * Sets the owner on tha path.
+ * @param path on which owner has to be set.
+ * @param owner to be set.
+ * @param group to be set.
+ * @param tracingContext for tracing the server calls.
+ * @return executed rest operation containing response from server.
+ * @throws AzureBlobFileSystemException if rest operation fails.
+ */
+ public abstract AbfsRestOperation setOwner(String path, String owner, String
group,
+ TracingContext tracingContext)
+ throws AzureBlobFileSystemException;
- final URL url = createRequestUrl(path, abfsUriQueryBuilder.toString());
- final AbfsRestOperation op = getAbfsRestOperation(
- AbfsRestOperationType.SetPermissions,
- AbfsHttpConstants.HTTP_METHOD_PUT,
- url,
- requestHeaders);
- op.execute(tracingContext);
- return op;
- }
+ /**
+ * Sets the permission on the path.
+ * @param path on which permission has to be set.
+ * @param permission to be set.
+ * @param tracingContext for tracing the server calls.
+ * @return executed rest operation containing response from server.
+ * @throws AzureBlobFileSystemException if rest operation fails.
+ */
+ public abstract AbfsRestOperation setPermission(String path, String
permission,
+ TracingContext tracingContext)
+ throws AzureBlobFileSystemException;
+ /**
+ * Sets the ACL
Review Comment:
Added
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -831,7 +627,7 @@ AbfsRestOperation createRenameRestOperation(URL url,
List<AbfsHttpHeader> reques
return op;
}
- private void incrementAbfsRenamePath() {
+ protected void incrementAbfsRenamePath() {
Review Comment:
Added
> ABFS: [FnsOverBlob]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
>
> 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]