|
@@ -1253,11 +1253,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
}
|
|
|
@Override
|
|
|
public boolean hasReadLock() {
|
|
|
- return this.fsLock.getReadHoldCount() > 0;
|
|
|
- }
|
|
|
- @Override
|
|
|
- public boolean hasReadOrWriteLock() {
|
|
|
- return hasReadLock() || hasWriteLock();
|
|
|
+ return this.fsLock.getReadHoldCount() > 0 || hasWriteLock();
|
|
|
}
|
|
|
|
|
|
NamespaceInfo getNamespaceInfo() {
|
|
@@ -1990,7 +1986,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
*/
|
|
|
private void verifyParentDir(String src) throws FileNotFoundException,
|
|
|
ParentNotDirectoryException, UnresolvedLinkException {
|
|
|
- assert hasReadOrWriteLock();
|
|
|
+ assert hasReadLock();
|
|
|
Path parent = new Path(src).getParent();
|
|
|
if (parent != null) {
|
|
|
final INode parentNode = dir.getINode(parent.toString());
|
|
@@ -2588,7 +2584,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
ExtendedBlock previous,
|
|
|
LocatedBlock[] onRetryBlock)
|
|
|
throws IOException {
|
|
|
- assert hasReadOrWriteLock();
|
|
|
+ assert hasReadLock();
|
|
|
|
|
|
checkBlock(previous);
|
|
|
onRetryBlock[0] = null;
|
|
@@ -2785,7 +2781,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
private INodeFileUnderConstruction checkLease(String src, long fileId,
|
|
|
String holder, INode inode) throws LeaseExpiredException,
|
|
|
FileNotFoundException {
|
|
|
- assert hasReadOrWriteLock();
|
|
|
+ assert hasReadLock();
|
|
|
if (inode == null || !inode.isFile()) {
|
|
|
Lease lease = leaseManager.getLease(holder);
|
|
|
throw new LeaseExpiredException(
|