|
@@ -1855,16 +1855,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkNameNodeSafeMode("Cannot concat " + target);
|
|
|
stat = FSDirConcatOp.concat(dir, target, srcs, logRetryCache);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "concat", Arrays.toString(srcs), target, stat);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
if (success) {
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
|
+ logAuditEvent(success, "concat", Arrays.toString(srcs), target, stat);
|
|
|
}
|
|
|
- logAuditEvent(success, "concat", Arrays.toString(srcs), target, stat);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2740,8 +2737,9 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
boolean success = ret != null && ret.success;
|
|
|
if (success) {
|
|
|
getEditLog().logSync();
|
|
|
- logAuditEvent(success, "rename", src, dst, ret.auditStat);
|
|
|
}
|
|
|
+ logAuditEvent(success, "rename", src, dst,
|
|
|
+ ret == null ? null : ret.auditStat);
|
|
|
return success;
|
|
|
}
|
|
|
|
|
@@ -3005,19 +3003,16 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
readLock();
|
|
|
boolean success = true;
|
|
|
- ContentSummary cs;
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- cs = FSDirStatAndListingOp.getContentSummary(dir, src);
|
|
|
+ return FSDirStatAndListingOp.getContentSummary(dir, src);
|
|
|
} catch (AccessControlException ace) {
|
|
|
success = false;
|
|
|
- logAuditEvent(success, "contentSummary", src);
|
|
|
throw ace;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
+ logAuditEvent(success, "contentSummary", src);
|
|
|
}
|
|
|
- logAuditEvent(success, "contentSummary", src);
|
|
|
- return cs;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3036,21 +3031,18 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
*/
|
|
|
QuotaUsage getQuotaUsage(final String src) throws IOException {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- QuotaUsage quotaUsage;
|
|
|
readLock();
|
|
|
boolean success = true;
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- quotaUsage = FSDirStatAndListingOp.getQuotaUsage(dir, src);
|
|
|
+ return FSDirStatAndListingOp.getQuotaUsage(dir, src);
|
|
|
} catch (AccessControlException ace) {
|
|
|
success = false;
|
|
|
- logAuditEvent(success, "quotaUsage", src);
|
|
|
throw ace;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
+ logAuditEvent(success, "quotaUsage", src);
|
|
|
}
|
|
|
- logAuditEvent(success, "quotaUsage", src);
|
|
|
- return quotaUsage;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3073,16 +3065,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkNameNodeSafeMode("Cannot set quota on " + src);
|
|
|
FSDirAttrOp.setQuota(dir, src, nsQuota, ssQuota, type);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "setQuota", src);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
if (success) {
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
|
+ logAuditEvent(success, "setQuota", src);
|
|
|
}
|
|
|
- logAuditEvent(success, "setQuota", src);
|
|
|
}
|
|
|
|
|
|
/** Persist all metadata about this file.
|
|
@@ -6614,23 +6603,17 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
String createSnapshot(String snapshotRoot, String snapshotName,
|
|
|
boolean logRetryCache) throws IOException {
|
|
|
String snapshotPath = null;
|
|
|
- boolean success = false;
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot create snapshot for " + snapshotRoot);
|
|
|
snapshotPath = FSDirSnapshotOp.createSnapshot(dir,
|
|
|
snapshotManager, snapshotRoot, snapshotName, logRetryCache);
|
|
|
- success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "createSnapshot", snapshotRoot,
|
|
|
- snapshotPath, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
}
|
|
|
getEditLog().logSync();
|
|
|
- logAuditEvent(success, "createSnapshot", snapshotRoot,
|
|
|
+ logAuditEvent(snapshotPath != null, "createSnapshot", snapshotRoot,
|
|
|
snapshotPath, null);
|
|
|
return snapshotPath;
|
|
|
}
|
|
@@ -6647,8 +6630,6 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
String path, String snapshotOldName, String snapshotNewName,
|
|
|
boolean logRetryCache) throws IOException {
|
|
|
boolean success = false;
|
|
|
- String oldSnapshotRoot = Snapshot.getSnapshotPath(path, snapshotOldName);
|
|
|
- String newSnapshotRoot = Snapshot.getSnapshotPath(path, snapshotNewName);
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -6656,14 +6637,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
FSDirSnapshotOp.renameSnapshot(dir, snapshotManager, path,
|
|
|
snapshotOldName, snapshotNewName, logRetryCache);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "renameSnapshot", oldSnapshotRoot,
|
|
|
- newSnapshotRoot, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
}
|
|
|
getEditLog().logSync();
|
|
|
+ String oldSnapshotRoot = Snapshot.getSnapshotPath(path, snapshotOldName);
|
|
|
+ String newSnapshotRoot = Snapshot.getSnapshotPath(path, snapshotNewName);
|
|
|
logAuditEvent(success, "renameSnapshot", oldSnapshotRoot,
|
|
|
newSnapshotRoot, null);
|
|
|
}
|
|
@@ -6685,9 +6664,6 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
status = FSDirSnapshotOp.getSnapshottableDirListing(dir, snapshotManager);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "listSnapshottableDirectory", null, null, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
}
|
|
@@ -6714,25 +6690,19 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
String fromSnapshot, String toSnapshot) throws IOException {
|
|
|
SnapshotDiffReport diffs = null;
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- boolean success = false;
|
|
|
- String fromSnapshotRoot = (fromSnapshot == null || fromSnapshot.isEmpty()) ?
|
|
|
- path : Snapshot.getSnapshotPath(path, fromSnapshot);
|
|
|
- String toSnapshotRoot = (toSnapshot == null || toSnapshot.isEmpty()) ?
|
|
|
- path : Snapshot.getSnapshotPath(path, toSnapshot);
|
|
|
readLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
diffs = FSDirSnapshotOp.getSnapshotDiffReport(dir, snapshotManager,
|
|
|
path, fromSnapshot, toSnapshot);
|
|
|
- success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "computeSnapshotDiff", fromSnapshotRoot,
|
|
|
- toSnapshotRoot, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
}
|
|
|
- logAuditEvent(success, "computeSnapshotDiff", fromSnapshotRoot,
|
|
|
+ String fromSnapshotRoot = (fromSnapshot == null || fromSnapshot.isEmpty()) ?
|
|
|
+ path : Snapshot.getSnapshotPath(path, fromSnapshot);
|
|
|
+ String toSnapshotRoot = (toSnapshot == null || toSnapshot.isEmpty()) ?
|
|
|
+ path : Snapshot.getSnapshotPath(path, toSnapshot);
|
|
|
+ logAuditEvent(diffs != null, "computeSnapshotDiff", fromSnapshotRoot,
|
|
|
toSnapshotRoot, null);
|
|
|
return diffs;
|
|
|
}
|
|
@@ -6747,19 +6717,15 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
void deleteSnapshot(String snapshotRoot, String snapshotName,
|
|
|
boolean logRetryCache) throws IOException {
|
|
|
boolean success = false;
|
|
|
- String rootPath = null;
|
|
|
writeLock();
|
|
|
BlocksMapUpdateInfo blocksToBeDeleted = null;
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot delete snapshot for " + snapshotRoot);
|
|
|
- rootPath = Snapshot.getSnapshotPath(snapshotRoot, snapshotName);
|
|
|
+
|
|
|
blocksToBeDeleted = FSDirSnapshotOp.deleteSnapshot(dir, snapshotManager,
|
|
|
snapshotRoot, snapshotName, logRetryCache);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "deleteSnapshot", rootPath, null, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
}
|
|
@@ -6770,6 +6736,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
if (blocksToBeDeleted != null) {
|
|
|
removeBlocks(blocksToBeDeleted);
|
|
|
}
|
|
|
+
|
|
|
+ String rootPath = Snapshot.getSnapshotPath(snapshotRoot, snapshotName);
|
|
|
logAuditEvent(success, "deleteSnapshot", rootPath, null, null);
|
|
|
}
|
|
|
|
|
@@ -6827,7 +6795,9 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
}
|
|
|
|
|
|
getEditLog().logSync();
|
|
|
- logAuditEvent(true, "startRollingUpgrade", null, null, null);
|
|
|
+ if (auditLog.isInfoEnabled() && isExternalInvocation()) {
|
|
|
+ logAuditEvent(true, "startRollingUpgrade", null, null, null);
|
|
|
+ }
|
|
|
return rollingUpgradeInfo;
|
|
|
}
|
|
|
|
|
@@ -7018,7 +6988,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
// Sync not needed for ha since the edit was rolled after logging.
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
|
- logAuditEvent(true, "finalizeRollingUpgrade", null, null, null);
|
|
|
+
|
|
|
+ if (auditLog.isInfoEnabled() && isExternalInvocation()) {
|
|
|
+ logAuditEvent(true, "finalizeRollingUpgrade", null, null, null);
|
|
|
+ }
|
|
|
return rollingUpgradeInfo;
|
|
|
}
|
|
|
|
|
@@ -7031,8 +7004,6 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
EnumSet<CacheFlag> flags, boolean logRetryCache)
|
|
|
throws IOException {
|
|
|
CacheDirectiveInfo effectiveDirective = null;
|
|
|
- boolean success = false;
|
|
|
- String effectiveDirectiveStr;
|
|
|
if (!flags.contains(CacheFlag.FORCE)) {
|
|
|
cacheManager.waitForRescanIfNeeded();
|
|
|
}
|
|
@@ -7042,27 +7013,24 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkNameNodeSafeMode("Cannot add cache directive");
|
|
|
effectiveDirective = FSNDNCacheOp.addCacheDirective(this, cacheManager,
|
|
|
directive, flags, logRetryCache);
|
|
|
- success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "addCacheDirective", null,
|
|
|
- null, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
+ boolean success = effectiveDirective != null;
|
|
|
if (success) {
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
|
+
|
|
|
+ String effectiveDirectiveStr = effectiveDirective != null ?
|
|
|
+ effectiveDirective.toString() : null;
|
|
|
+ logAuditEvent(success, "addCacheDirective", effectiveDirectiveStr,
|
|
|
+ null, null);
|
|
|
}
|
|
|
- effectiveDirectiveStr = effectiveDirective.toString();
|
|
|
- logAuditEvent(success, "addCacheDirective", effectiveDirectiveStr,
|
|
|
- null, null);
|
|
|
- return effectiveDirective.getId();
|
|
|
+ return effectiveDirective != null ? effectiveDirective.getId() : 0;
|
|
|
}
|
|
|
|
|
|
void modifyCacheDirective(CacheDirectiveInfo directive,
|
|
|
EnumSet<CacheFlag> flags, boolean logRetryCache) throws IOException {
|
|
|
boolean success = false;
|
|
|
- final String idStr = "{id: " + directive.getId() + "}";
|
|
|
if (!flags.contains(CacheFlag.FORCE)) {
|
|
|
cacheManager.waitForRescanIfNeeded();
|
|
|
}
|
|
@@ -7073,36 +7041,31 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
FSNDNCacheOp.modifyCacheDirective(this, cacheManager, directive, flags,
|
|
|
logRetryCache);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "modifyCacheDirective", idStr,
|
|
|
- directive.toString(), null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
if (success) {
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
|
+ final String idStr = "{id: " + directive.getId() + "}";
|
|
|
+ logAuditEvent(success, "modifyCacheDirective", idStr,
|
|
|
+ directive.toString(), null);
|
|
|
}
|
|
|
- logAuditEvent(success, "modifyCacheDirective", idStr,
|
|
|
- directive.toString(), null);
|
|
|
}
|
|
|
|
|
|
void removeCacheDirective(long id, boolean logRetryCache) throws IOException {
|
|
|
boolean success = false;
|
|
|
- String idStr = "{id: " + Long.toString(id) + "}";
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot remove cache directives");
|
|
|
FSNDNCacheOp.removeCacheDirective(this, cacheManager, id, logRetryCache);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "removeCacheDirective", idStr, null, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
+ String idStr = "{id: " + Long.toString(id) + "}";
|
|
|
+ logAuditEvent(success, "removeCacheDirective", idStr, null,
|
|
|
+ null);
|
|
|
}
|
|
|
- logAuditEvent(success, "removeCacheDirective", idStr, null, null);
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
|
|
|
@@ -7118,15 +7081,11 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
results = FSNDNCacheOp.listCacheDirectives(this, cacheManager, startId,
|
|
|
filter);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "listCacheDirectives", filter.toString(), null,
|
|
|
- null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
+ logAuditEvent(success, "listCacheDirectives", filter.toString(), null,
|
|
|
+ null);
|
|
|
}
|
|
|
- logAuditEvent(success, "listCacheDirectives", filter.toString(), null,
|
|
|
- null);
|
|
|
return results;
|
|
|
}
|
|
|
|
|
@@ -7143,13 +7102,11 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
logRetryCache);
|
|
|
poolInfoStr = info.toString();
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "addCachePool", poolInfoStr, null, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
+ logAuditEvent(success, "addCachePool", poolInfoStr, null, null);
|
|
|
}
|
|
|
- logAuditEvent(success, "addCachePool", poolInfoStr, null, null);
|
|
|
+
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
|
|
|
@@ -7157,23 +7114,19 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
throws IOException {
|
|
|
writeLock();
|
|
|
boolean success = false;
|
|
|
- String poolNameStr = "{poolName: " +
|
|
|
- (req == null ? null : req.getPoolName()) + "}";
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot modify cache pool"
|
|
|
+ (req == null ? null : req.getPoolName()));
|
|
|
FSNDNCacheOp.modifyCachePool(this, cacheManager, req, logRetryCache);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "modifyCachePool", poolNameStr,
|
|
|
- req == null ? null : req.toString(), null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
+ String poolNameStr = "{poolName: " +
|
|
|
+ (req == null ? null : req.getPoolName()) + "}";
|
|
|
+ logAuditEvent(success, "modifyCachePool", poolNameStr,
|
|
|
+ req == null ? null : req.toString(), null);
|
|
|
}
|
|
|
- logAuditEvent(success, "modifyCachePool", poolNameStr,
|
|
|
- req == null ? null : req.toString(), null);
|
|
|
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
@@ -7182,20 +7135,18 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
throws IOException {
|
|
|
writeLock();
|
|
|
boolean success = false;
|
|
|
- String poolNameStr = "{poolName: " + cachePoolName + "}";
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot modify cache pool" + cachePoolName);
|
|
|
FSNDNCacheOp.removeCachePool(this, cacheManager, cachePoolName,
|
|
|
logRetryCache);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "removeCachePool", poolNameStr, null, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
writeUnlock();
|
|
|
+ String poolNameStr = "{poolName: " + cachePoolName + "}";
|
|
|
+ logAuditEvent(success, "removeCachePool", poolNameStr, null, null);
|
|
|
}
|
|
|
- logAuditEvent(success, "removeCachePool", poolNameStr, null, null);
|
|
|
+
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
|
|
|
@@ -7210,13 +7161,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
results = FSNDNCacheOp.listCachePools(this, cacheManager, prevKey);
|
|
|
success = true;
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "listCachePools", null, null, null);
|
|
|
- throw ace;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
+ logAuditEvent(success, "listCachePools", null, null, null);
|
|
|
}
|
|
|
- logAuditEvent(success, "listCachePools", null, null, null);
|
|
|
return results;
|
|
|
}
|
|
|
|
|
@@ -7314,19 +7262,17 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
|
|
|
AclStatus getAclStatus(String src) throws IOException {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- final AclStatus ret;
|
|
|
+ boolean success = false;
|
|
|
readLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- ret = FSDirAclOp.getAclStatus(dir, src);
|
|
|
- } catch(AccessControlException ace) {
|
|
|
- logAuditEvent(false, "getAclStatus", src);
|
|
|
- throw ace;
|
|
|
+ final AclStatus ret = FSDirAclOp.getAclStatus(dir, src);
|
|
|
+ success = true;
|
|
|
+ return ret;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
+ logAuditEvent(success, "getAclStatus", src);
|
|
|
}
|
|
|
- logAuditEvent(true, "getAclStatus", src);
|
|
|
- return ret;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -7381,7 +7327,6 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
throws AccessControlException, UnresolvedLinkException, IOException {
|
|
|
HdfsFileStatus resultingStat = null;
|
|
|
boolean success = false;
|
|
|
- EncryptionZone encryptionZone;
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
readLock();
|
|
@@ -7391,15 +7336,11 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
.getEZForPath(dir, srcArg, pc);
|
|
|
success = true;
|
|
|
resultingStat = ezForPath.getValue();
|
|
|
- encryptionZone = ezForPath.getKey();
|
|
|
- } catch (AccessControlException ace) {
|
|
|
- logAuditEvent(success, "getEZForPath", srcArg, null, resultingStat);
|
|
|
- throw ace;
|
|
|
+ return ezForPath.getKey();
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
+ logAuditEvent(success, "getEZForPath", srcArg, null, resultingStat);
|
|
|
}
|
|
|
- logAuditEvent(success, "getEZForPath", srcArg, null, resultingStat);
|
|
|
- return encryptionZone;
|
|
|
}
|
|
|
|
|
|
BatchedListEntries<EncryptionZone> listEncryptionZones(long prevId)
|
|
@@ -7443,36 +7384,30 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
List<XAttr> getXAttrs(final String src, List<XAttr> xAttrs)
|
|
|
throws IOException {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- List<XAttr> fsXattrs;
|
|
|
readLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- fsXattrs = FSDirXAttrOp.getXAttrs(dir, src, xAttrs);
|
|
|
+ return FSDirXAttrOp.getXAttrs(dir, src, xAttrs);
|
|
|
} catch (AccessControlException e) {
|
|
|
logAuditEvent(false, "getXAttrs", src);
|
|
|
throw e;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
}
|
|
|
- logAuditEvent(true, "getXAttrs", src);
|
|
|
- return fsXattrs;
|
|
|
}
|
|
|
|
|
|
List<XAttr> listXAttrs(String src) throws IOException {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- List<XAttr> fsXattrs;
|
|
|
readLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- fsXattrs = FSDirXAttrOp.listXAttrs(dir, src);
|
|
|
+ return FSDirXAttrOp.listXAttrs(dir, src);
|
|
|
} catch (AccessControlException e) {
|
|
|
logAuditEvent(false, "listXAttrs", src);
|
|
|
throw e;
|
|
|
} finally {
|
|
|
readUnlock();
|
|
|
}
|
|
|
- logAuditEvent(true, "listXAttrs", src);
|
|
|
- return fsXattrs;
|
|
|
}
|
|
|
|
|
|
void removeXAttr(String src, XAttr xAttr, boolean logRetryCache)
|