[ 
https://issues.apache.org/jira/browse/HADOOP-17590?focusedWorklogId=605105&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-605105
 ]

ASF GitHub Bot logged work on HADOOP-17590:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Jun/21 10:49
            Start Date: 02/Jun/21 10:49
    Worklog Time Spent: 10m 
      Work Description: 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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 605105)
    Time Spent: 2h 10m  (was: 2h)

> ABFS: Introduce Lease Operations with Append to provide single writer 
> semantics
> -------------------------------------------------------------------------------
>
>                 Key: HADOOP-17590
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17590
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Sneha Varma
>            Assignee: Sneha Varma
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> The lease operations will be introduced as part of Append, Flush to ensure 
> the single writer semantics.
>  
> Details:
> Acquire Lease will be introduced in Create, Auto-Renew, Acquire will be added 
> to Append & Release, Auto-Renew, Acquire in Flush.
>  
> Duration the creation of the file the lease will be acquired, as part of 
> appends the lease will be auto-renewed & the lease can be released as part of 
> flush.
>  
> By default the lease duration will be of 60 seconds.
> "fs.azure.write.enforcelease" & "fs.azure.write.lease.duration" two configs 
> will be introduced.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to