You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/10/29 18:11:00 UTC

[GitHub] [hadoop] DadanielZ commented on a change in pull request #1611: HADOOP-16612 Track Azure Blob File System client-perceived latency

DadanielZ commented on a change in pull request #1611: HADOOP-16612 Track Azure Blob File System client-perceived latency
URL: https://github.com/apache/hadoop/pull/1611#discussion_r340219667
 
 

 ##########
 File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java
 ##########
 @@ -684,212 +770,263 @@ private String generateContinuationTokenForNonXns(final String path, final Strin
 
   public void setOwner(final Path path, final String owner, final String group) throws
           AzureBlobFileSystemException {
-    if (!getIsNamespaceEnabled()) {
-      throw new UnsupportedOperationException(
-          "This operation is only valid for storage accounts with the hierarchical namespace enabled.");
-    }
+    try (AbfsPerfInfo tracker = startTracking("setOwner", "setOwner")) {
+      if (!getIsNamespaceEnabled()) {
+        throw new UnsupportedOperationException(
+                "This operation is only valid for storage accounts with the hierarchical namespace enabled.");
+      }
 
-    LOG.debug(
-            "setOwner filesystem: {} path: {} owner: {} group: {}",
-            client.getFileSystem(),
-            path.toString(),
-            owner,
-            group);
+      LOG.debug(
+              "setOwner filesystem: {} path: {} owner: {} group: {}",
+              client.getFileSystem(),
+              path.toString(),
+              owner,
+              group);
+
+      final String transformedOwner = identityTransformer.transformUserOrGroupForSetRequest(owner);
+      final String transformedGroup = identityTransformer.transformUserOrGroupForSetRequest(group);
 
-    final String transformedOwner = identityTransformer.transformUserOrGroupForSetRequest(owner);
-    final String transformedGroup = identityTransformer.transformUserOrGroupForSetRequest(group);
+      final AbfsRestOperation op = client.setOwner(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path, true), transformedOwner, transformedGroup);
 
-    client.setOwner(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path, true), transformedOwner, transformedGroup);
+      tracker.registerResult(op.getResult()).registerSuccess(true);
+    }
   }
 
   public void setPermission(final Path path, final FsPermission permission) throws
           AzureBlobFileSystemException {
-    if (!getIsNamespaceEnabled()) {
-      throw new UnsupportedOperationException(
-          "This operation is only valid for storage accounts with the hierarchical namespace enabled.");
-    }
+    try (AbfsPerfInfo tracker = startTracking("setPermission", "setPermission")) {
+      if (!getIsNamespaceEnabled()) {
 
 Review comment:
   same here and below

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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