virajjasani commented on code in PR #5675:
URL: https://github.com/apache/hadoop/pull/5675#discussion_r1213340095


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/prefetch/SingleFilePerBlockCache.java:
##########
@@ -127,11 +128,33 @@ void takeLock(LockType lockType) {
      */
     void releaseLock(LockType lockType) {
       if (LockType.READ == lockType) {
-        this.lock.readLock().unlock();
+        lock.readLock().unlock();
       } else if (LockType.WRITE == lockType) {
-        this.lock.writeLock().unlock();
+        lock.writeLock().unlock();
       }
     }
+
+    /**
+     * Try to take the read or write lock within the given timeout.
+     *
+     * @param lockType type of the lock.
+     * @param timeout the time to wait for the given lock.
+     * @param unit the time unit of the timeout argument.
+     * @return true if the lock of the given lock type was acquired.
+     */
+    boolean takeLock(LockType lockType, long timeout, TimeUnit unit) {

Review Comment:
   sounds good, done



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to