hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hadoop] snvijaya commented on a change in pull request #3026: HADOOP-17590 ABFS: Introduce Lease Operations with Append to provide single writer semantics
Date Wed, 02 Jun 2021 10:49:29 GMT

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



##########
File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java
##########
@@ -585,6 +589,26 @@ public AbfsRestOperation append(final String path, final byte[] buffer,
       }
     }
 
+    if (lease != null && lease.getLeaseID() != null && !lease.getLeaseID().isEmpty())
{

Review comment:
       Add below member functions to AbfsLease : 
   1. boolean hasValidLease() - which will return value of ( lease.getLeaseID() != null &&
!lease.getLeaseID().isEmpty())
   2. AddLeaseHeaders(List<AbfsHttpHeader> requestHeaders) - and move the requestHeader
conditional header add logic into it

##########
File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java
##########
@@ -648,16 +672,33 @@ public boolean appendSuccessCheckOp(AbfsRestOperation op, final String
path,
   }
 
   public AbfsRestOperation flush(final String path, final long position, boolean retainUncommittedData,
-                                 boolean isClose, final String cachedSasToken, final String
leaseId)
+                                 boolean isClose, final String cachedSasToken, AbfsLease
lease)
       throws AzureBlobFileSystemException {
     final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();
     addCustomerProvidedKeyHeaders(requestHeaders);
     // 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 (leaseId != null) {
-      requestHeaders.add(new AbfsHttpHeader(X_MS_LEASE_ID, leaseId));
+
+    if (lease != null && lease.getLeaseID() != null && !lease.getLeaseID().isEmpty())
{

Review comment:
       Same as above




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


Mime
View raw message