Skip to content

Commit 551683d

Browse files
ZanderXuzengqiang.xu
authored andcommitted
HDFS-17394. [FGL] Remove unused WriteHoldCount of FSNamesystemLock (#6571)
1 parent 5c7e40f commit 551683d

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ public boolean yield() {
123123

124124
// sanity check.
125125
if (!hadDirReadLock || !hadFsnReadLock || hadDirWriteLock ||
126-
hadFsnWriteLock || dir.getReadHoldCount() != 1 ||
127-
fsn.getReadHoldCount() != 1) {
126+
hadFsnWriteLock || fsn.getReadHoldCount() != 1) {
128127
// cannot relinquish
129128
return false;
130129
}

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,6 @@ boolean hasReadLock() {
284284
return namesystem.hasReadLock();
285285
}
286286

287-
@Deprecated // dirLock is obsolete, use namesystem.fsLock instead
288-
public int getReadHoldCount() {
289-
return namesystem.getReadHoldCount();
290-
}
291-
292-
@Deprecated // dirLock is obsolete, use namesystem.fsLock instead
293-
public int getWriteHoldCount() {
294-
return namesystem.getWriteHoldCount();
295-
}
296-
297287
public int getListLimit() {
298288
return lsLimit;
299289
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,10 +1849,6 @@ public int getReadHoldCount() {
18491849
return this.fsLock.getReadHoldCount();
18501850
}
18511851

1852-
public int getWriteHoldCount() {
1853-
return this.fsLock.getWriteHoldCount();
1854-
}
1855-
18561852
/** Lock the checkpoint lock */
18571853
public void cpLock() {
18581854
this.cpLock.lock();

0 commit comments

Comments
 (0)