[
https://issues.apache.org/jira/browse/HDFS-17394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hui Fei resolved HDFS-17394.
----------------------------
Resolution: Fixed
> [FGL] Remove unused WriteHoldCount of FSNamesystemLock
> ------------------------------------------------------
>
> Key: HDFS-17394
> URL: https://issues.apache.org/jira/browse/HDFS-17394
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: ZanderXu
> Assignee: ZanderXu
> Priority: Major
> Labels: pull-request-available
>
> {code:java}
> public int getWriteHoldCount() {
> return this.fsLock.getWriteHoldCount(FSNamesystemLockMode.GLOBAL);
> }
> @Deprecated // dirLock is obsolete, use namesystem.fsLock instead
> public int getWriteHoldCount() {
> return namesystem.getWriteHoldCount();
> }
> // sanity check.
> if (!hadDirReadLock || !hadFsnReadLock || hadDirWriteLock ||
> hadFsnWriteLock || dir.getReadHoldCount() != 1 ||
> fsn.getReadHoldCount() != 1) {
> // cannot relinquish
> return false;
> } {code}
> getWriteHoldCount in FSNamesystem.java and FSDirectory.java is unused.
> dir.getReadHoldCount() is useless as it's same as fsn.getReadHoldCount().
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]