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/05/31 07:15:56 UTC

[GitHub] [hadoop] snehavarma commented on a change in pull request #3026: HADOOP-17590 ABFS: Introduce Lease Operations with Append to provide single writer semantics

snehavarma commented on a change in pull request #3026:
URL: https://github.com/apache/hadoop/pull/3026#discussion_r642264994



##########
File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java
##########
@@ -1698,14 +1703,29 @@ private void updateInfiniteLeaseDirs() {
     this.azureInfiniteLeaseDirSet.remove("");
   }
 
-  private AbfsLease maybeCreateLease(String relativePath)
+  private AbfsLease maybeCreateFiniteLease(String relativePath, boolean isNamespaceEnabled)
       throws AzureBlobFileSystemException {
     boolean enableInfiniteLease = isInfiniteLeaseKey(relativePath);
-    if (!enableInfiniteLease) {
-      return null;
+    AbfsLease lease = null;
+    if (!enableInfiniteLease && abfsConfiguration.isLeaseEnforced() && isNamespaceEnabled) {
+      lease = new AbfsLease(client, relativePath, false);
     }
-    AbfsLease lease = new AbfsLease(client, relativePath);
-    leaseRefs.put(lease, null);
+
+    return lease;
+  }
+
+  private AbfsLease maybeCreateLease(String relativePath, boolean isNamespaceEnabled)

Review comment:
       Merge maybeCreateLease and maybeCreateInfiniteLease




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