|
@@ -1844,6 +1844,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
|
|
|
if (!isInSafeMode() && res.updateAccessTime()) {
|
|
|
String src = srcArg;
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
final long now = now();
|
|
|
try {
|
|
@@ -1917,6 +1918,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final String operationName = "concat";
|
|
|
FileStatus stat = null;
|
|
|
boolean success = false;
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -5642,6 +5644,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
String clientName, ExtendedBlock oldBlock, ExtendedBlock newBlock,
|
|
|
DatanodeID[] newNodes, String[] newStorageIDs, boolean logRetryCache)
|
|
|
throws IOException {
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
LOG.info("updatePipeline(" + oldBlock.getLocalBlock()
|
|
|
+ ", newGS=" + newBlock.getGenerationStamp()
|
|
|
+ ", newLength=" + newBlock.getNumBytes()
|
|
@@ -6806,6 +6809,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
boolean logRetryCache) throws IOException {
|
|
|
final String operationName = "deleteSnapshot";
|
|
|
boolean success = false;
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
BlocksMapUpdateInfo blocksToBeDeleted = null;
|
|
|
try {
|
|
@@ -6845,6 +6849,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
readLock();
|
|
|
try {
|
|
|
+ checkOperation(OperationCategory.READ);
|
|
|
if (!isRollingUpgrade()) {
|
|
|
return null;
|
|
|
}
|
|
@@ -7099,6 +7104,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
if (!flags.contains(CacheFlag.FORCE)) {
|
|
|
cacheManager.waitForRescanIfNeeded();
|
|
|
}
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -7127,6 +7133,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
if (!flags.contains(CacheFlag.FORCE)) {
|
|
|
cacheManager.waitForRescanIfNeeded();
|
|
|
}
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -7148,6 +7155,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
void removeCacheDirective(long id, boolean logRetryCache) throws IOException {
|
|
|
final String operationName = "removeCacheDirective";
|
|
|
boolean success = false;
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -7187,6 +7195,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
void addCachePool(CachePoolInfo req, boolean logRetryCache)
|
|
|
throws IOException {
|
|
|
final String operationName = "addCachePool";
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
boolean success = false;
|
|
|
String poolInfoStr = null;
|
|
@@ -7209,6 +7218,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
void modifyCachePool(CachePoolInfo req, boolean logRetryCache)
|
|
|
throws IOException {
|
|
|
final String operationName = "modifyCachePool";
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
boolean success = false;
|
|
|
try {
|
|
@@ -7231,6 +7241,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
void removeCachePool(String cachePoolName, boolean logRetryCache)
|
|
|
throws IOException {
|
|
|
final String operationName = "removeCachePool";
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
boolean success = false;
|
|
|
try {
|