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



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