You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/10/14 11:35:36 UTC

[GitHub] [hadoop-ozone] captainzmc opened a new pull request #1497: HDDS-4345. Delete the deprecated Lock method

captainzmc opened a new pull request #1497:
URL: https://github.com/apache/hadoop-ozone/pull/1497


   ## What changes were proposed in this pull request?
   
   ![image](https://user-images.githubusercontent.com/13825159/95983129-b06dea80-0e53-11eb-806c-bd113c75f570.png)
   ![image](https://user-images.githubusercontent.com/13825159/95983142-b6fc6200-0e53-11eb-93cf-1e9454e3c6f3.png)
   
   AcquireLock has been Deprecated and replaced by acquireWriteLock. This PR unifies this usage.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4345
   
   ## How was this patch tested?
   
   Use existing UT
   


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] captainzmc commented on pull request #1497: HDDS-4345. Replace the deprecated Lock method

Posted by GitBox <gi...@apache.org>.
captainzmc commented on pull request #1497:
URL: https://github.com/apache/hadoop-ozone/pull/1497#issuecomment-716470302


   Thanks for @xiaoyuyao‘s review, the issues has been fixed.


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] xiaoyuyao commented on a change in pull request #1497: HDDS-4345. Replace the deprecated Lock method

Posted by GitBox <gi...@apache.org>.
xiaoyuyao commented on a change in pull request #1497:
URL: https://github.com/apache/hadoop-ozone/pull/1497#discussion_r511191225



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/PrefixManagerImpl.java
##########
@@ -253,18 +253,18 @@ public boolean checkAccess(OzoneObj ozObject, RequestContext context)
         return true;
       }
     } finally {
-      metadataManager.getLock().releaseLock(PREFIX_LOCK, prefixPath);
+      metadataManager.getLock().releaseWriteLock(PREFIX_LOCK, prefixPath);
     }
   }
 
   @Override
   public List<OmPrefixInfo> getLongestPrefixPath(String path) {
     String prefixPath = prefixTree.getLongestPrefix(path);
-    metadataManager.getLock().acquireLock(PREFIX_LOCK, prefixPath);
+    metadataManager.getLock().acquireWriteLock(PREFIX_LOCK, prefixPath);

Review comment:
       Same as above.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/PrefixManagerImpl.java
##########
@@ -232,7 +232,7 @@ public boolean checkAccess(OzoneObj ozObject, RequestContext context)
     Objects.requireNonNull(context);
 
     String prefixPath = ozObject.getPath();
-    metadataManager.getLock().acquireLock(PREFIX_LOCK, prefixPath);
+    metadataManager.getLock().acquireWriteLock(PREFIX_LOCK, prefixPath);

Review comment:
       Should we use acquireReadLock here?




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] xiaoyuyao commented on a change in pull request #1497: HDDS-4345. Replace the deprecated Lock method

Posted by GitBox <gi...@apache.org>.
xiaoyuyao commented on a change in pull request #1497:
URL: https://github.com/apache/hadoop-ozone/pull/1497#discussion_r512223510



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/VolumeManagerImpl.java
##########
@@ -620,7 +620,7 @@ public boolean checkAccess(OzoneObj ozObject, RequestContext context)
     Objects.requireNonNull(context);
 
     String volume = ozObject.getVolumeName();
-    metadataManager.getLock().acquireLock(VOLUME_LOCK, volume);
+    metadataManager.getLock().acquireWriteLock(VOLUME_LOCK, volume);

Review comment:
       This should be a ReadLock

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/VolumeManagerImpl.java
##########
@@ -647,7 +647,7 @@ public boolean checkAccess(OzoneObj ozObject, RequestContext context)
       throw new OMException("Check access operation failed for " +
           "volume:" + volume, ex, ResultCodes.INTERNAL_ERROR);
     } finally {
-      metadataManager.getLock().releaseLock(VOLUME_LOCK, volume);
+      metadataManager.getLock().releaseWriteLock(VOLUME_LOCK, volume);

Review comment:
       This should be a ReadLock




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] captainzmc closed pull request #1497: HDDS-4345. Replace the deprecated Lock method

Posted by GitBox <gi...@apache.org>.
captainzmc closed pull request #1497:
URL: https://github.com/apache/hadoop-ozone/pull/1497


   


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org