Jelajahi Sumber

HDFS-17394. [FGL] Remove unused WriteHoldCount of FSNamesystemLock (#6571)

ZanderXu 1 tahun lalu
induk
melakukan
8afbfbc2f5

+ 1 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ContentSummaryComputationContext.java

@@ -123,8 +123,7 @@ public class ContentSummaryComputationContext {
 
     // sanity check.
     if (!hadDirReadLock || !hadFsnReadLock || hadDirWriteLock ||
-        hadFsnWriteLock || dir.getReadHoldCount() != 1 ||
-        fsn.getReadHoldCount() != 1) {
+        hadFsnWriteLock || fsn.getReadHoldCount() != 1) {
       // cannot relinquish
       return false;
     }

+ 0 - 10
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java

@@ -285,16 +285,6 @@ public class FSDirectory implements Closeable {
     return namesystem.hasReadLock();
   }
 
-  @Deprecated // dirLock is obsolete, use namesystem.fsLock instead
-  public int getReadHoldCount() {
-    return namesystem.getReadHoldCount();
-  }
-
-  @Deprecated // dirLock is obsolete, use namesystem.fsLock instead
-  public int getWriteHoldCount() {
-    return namesystem.getWriteHoldCount();
-  }
-
   public int getListLimit() {
     return lsLimit;
   }

+ 0 - 4
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -1859,10 +1859,6 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
     return this.fsLock.getReadHoldCount();
   }
 
-  public int getWriteHoldCount() {
-    return this.fsLock.getWriteHoldCount();
-  }
-
   /** Lock the checkpoint lock */
   public void cpLock() {
     this.cpLock.lock();