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 2021/06/03 16:01:19 UTC

[GitHub] [hadoop] anoopsjohn commented on a change in pull request #2972: HADOOP-17643 WASB : Make metadata checks case insensitive

anoopsjohn commented on a change in pull request #2972:
URL: https://github.com/apache/hadoop/pull/2972#discussion_r644923176



##########
File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java
##########
@@ -1698,19 +1721,32 @@ private static void storeLinkAttribute(CloudBlobWrapper blob,
         OLD_LINK_BACK_TO_UPLOAD_IN_PROGRESS_METADATA_KEY);
   }
 
-  private static String getLinkAttributeValue(CloudBlobWrapper blob)
+  private String getLinkAttributeValue(CloudBlobWrapper blob)
       throws UnsupportedEncodingException {
-    String encodedLinkTarget = getMetadataAttribute(blob,
+    String encodedLinkTarget = getMetadataAttribute(blob.getMetadata(),
         LINK_BACK_TO_UPLOAD_IN_PROGRESS_METADATA_KEY,
         OLD_LINK_BACK_TO_UPLOAD_IN_PROGRESS_METADATA_KEY);
     return decodeMetadataAttribute(encodedLinkTarget);
   }
 
-  private static boolean retrieveFolderAttribute(CloudBlobWrapper blob) {
+  private boolean retrieveFolderAttribute(CloudBlobWrapper blob) {
     HashMap<String, String> metadata = blob.getMetadata();
-    return null != metadata
-        && (metadata.containsKey(IS_FOLDER_METADATA_KEY) || metadata
-            .containsKey(OLD_IS_FOLDER_METADATA_KEY));
+    if (null != metadata) {

Review comment:
       Reason why that was not done is to avoid extra call Map#get().  retrieveFolderAttribute() will be a very often called API. So I did not want to make any extra calls as part of this change, specially in default case of 'fs.azure.blob.metadata.key.case.sensitive' false.
   Also practically it may not possible but still its possible that a Map contains a given Key but with value as null. What we used to check at this API was/is just check whether key is present in Map or not.
   




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



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