You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/02/22 06:24:00 UTC
[jira] [Commented] (HDFS-17394) [FGL] Remove unused WriteHoldCount of FSNamesystemLock
[ https://issues.apache.org/jira/browse/HDFS-17394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17819484#comment-17819484 ]
ASF GitHub Bot commented on HDFS-17394:
---------------------------------------
ZanderXu opened a new pull request, #6571:
URL: https://github.com/apache/hadoop/pull/6571
```
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;
}
```
`getWriteHoldCount` in FSNamesystem.java and FSDirectory.java is unused.
`dir.getReadHoldCount()` is useless as it's same as `fsn.getReadHoldCount()`.
> [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
>
> {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: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org