You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "ZanderXu (Jira)" <ji...@apache.org> on 2024/02/20 09:09:00 UTC
[jira] [Created] (HDFS-17390) [FGL] FSDirectory supports this fine-grained locking
ZanderXu created HDFS-17390:
-------------------------------
Summary: [FGL] FSDirectory supports this fine-grained locking
Key: HDFS-17390
URL: https://issues.apache.org/jira/browse/HDFS-17390
Project: Hadoop HDFS
Issue Type: Sub-task
Reporter: ZanderXu
{code:java}
/**
* The directory lock dirLock provided redundant locking.
* It has been used whenever namesystem.fsLock was used.
* dirLock is now removed and utility methods to acquire and release dirLock
* remain as placeholders only
*/
void readLock() {
assert namesystem.hasReadLock() : "Should hold namesystem read lock";
}
void readUnlock() {
assert namesystem.hasReadLock() : "Should hold namesystem read lock";
}
void writeLock() {
assert namesystem.hasWriteLock() : "Should hold namesystem write lock";
}
void writeUnlock() {
assert namesystem.hasWriteLock() : "Should hold namesystem write lock";
}
boolean hasWriteLock() {
return namesystem.hasWriteLock();
}
boolean hasReadLock() {
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;
} {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org