HDFS-7459. Consolidate cache-related implementation in FSNamesystem into a single class. Contributed by Haohui Mai.
This commit is contained in:
parent
0707e4eca9
commit
e227fb8fbc
|
@ -435,6 +435,9 @@ Release 2.7.0 - UNRELEASED
|
||||||
|
|
||||||
HDFS-7474. Avoid resolving path in FSPermissionChecker. (jing9)
|
HDFS-7474. Avoid resolving path in FSPermissionChecker. (jing9)
|
||||||
|
|
||||||
|
HDFS-7459. Consolidate cache-related implementation in FSNamesystem into
|
||||||
|
a single class. (wheat9)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HDFS-7454. Reduce memory footprint for AclEntries in NameNode.
|
HDFS-7454. Reduce memory footprint for AclEntries in NameNode.
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.hadoop.hdfs.server.namenode;
|
||||||
|
|
||||||
|
import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries;
|
||||||
|
import org.apache.hadoop.fs.CacheFlag;
|
||||||
|
import org.apache.hadoop.hdfs.protocol.CacheDirectiveEntry;
|
||||||
|
import org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo;
|
||||||
|
import org.apache.hadoop.hdfs.protocol.CachePoolEntry;
|
||||||
|
import org.apache.hadoop.hdfs.protocol.CachePoolInfo;
|
||||||
|
import org.apache.hadoop.security.AccessControlException;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
class FSNDNCacheOp {
|
||||||
|
static CacheDirectiveInfo addCacheDirective(
|
||||||
|
FSNamesystem fsn, CacheManager cacheManager,
|
||||||
|
CacheDirectiveInfo directive, EnumSet<CacheFlag> flags,
|
||||||
|
boolean logRetryCache)
|
||||||
|
throws IOException {
|
||||||
|
|
||||||
|
final FSPermissionChecker pc = getFsPermissionChecker(fsn);
|
||||||
|
|
||||||
|
if (directive.getId() != null) {
|
||||||
|
throw new IOException("addDirective: you cannot specify an ID " +
|
||||||
|
"for this operation.");
|
||||||
|
}
|
||||||
|
CacheDirectiveInfo effectiveDirective =
|
||||||
|
cacheManager.addDirective(directive, pc, flags);
|
||||||
|
fsn.getEditLog().logAddCacheDirectiveInfo(effectiveDirective,
|
||||||
|
logRetryCache);
|
||||||
|
return effectiveDirective;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void modifyCacheDirective(
|
||||||
|
FSNamesystem fsn, CacheManager cacheManager, CacheDirectiveInfo directive,
|
||||||
|
EnumSet<CacheFlag> flags, boolean logRetryCache) throws IOException {
|
||||||
|
final FSPermissionChecker pc = getFsPermissionChecker(fsn);
|
||||||
|
|
||||||
|
cacheManager.modifyDirective(directive, pc, flags);
|
||||||
|
fsn.getEditLog().logModifyCacheDirectiveInfo(directive, logRetryCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void removeCacheDirective(
|
||||||
|
FSNamesystem fsn, CacheManager cacheManager, long id,
|
||||||
|
boolean logRetryCache)
|
||||||
|
throws IOException {
|
||||||
|
final FSPermissionChecker pc = getFsPermissionChecker(fsn);
|
||||||
|
|
||||||
|
cacheManager.removeDirective(id, pc);
|
||||||
|
fsn.getEditLog().logRemoveCacheDirectiveInfo(id, logRetryCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
static BatchedListEntries<CacheDirectiveEntry> listCacheDirectives(
|
||||||
|
FSNamesystem fsn, CacheManager cacheManager,
|
||||||
|
long startId, CacheDirectiveInfo filter) throws IOException {
|
||||||
|
final FSPermissionChecker pc = getFsPermissionChecker(fsn);
|
||||||
|
return cacheManager.listCacheDirectives(startId, filter, pc);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CachePoolInfo addCachePool(
|
||||||
|
FSNamesystem fsn, CacheManager cacheManager, CachePoolInfo req,
|
||||||
|
boolean logRetryCache)
|
||||||
|
throws IOException {
|
||||||
|
final FSPermissionChecker pc = getFsPermissionChecker(fsn);
|
||||||
|
|
||||||
|
if (pc != null) {
|
||||||
|
pc.checkSuperuserPrivilege();
|
||||||
|
}
|
||||||
|
CachePoolInfo info = cacheManager.addCachePool(req);
|
||||||
|
fsn.getEditLog().logAddCachePool(info, logRetryCache);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void modifyCachePool(
|
||||||
|
FSNamesystem fsn, CacheManager cacheManager, CachePoolInfo req,
|
||||||
|
boolean logRetryCache) throws IOException {
|
||||||
|
final FSPermissionChecker pc = getFsPermissionChecker(fsn);
|
||||||
|
if (pc != null) {
|
||||||
|
pc.checkSuperuserPrivilege();
|
||||||
|
}
|
||||||
|
cacheManager.modifyCachePool(req);
|
||||||
|
fsn.getEditLog().logModifyCachePool(req, logRetryCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void removeCachePool(
|
||||||
|
FSNamesystem fsn, CacheManager cacheManager, String cachePoolName,
|
||||||
|
boolean logRetryCache) throws IOException {
|
||||||
|
final FSPermissionChecker pc = getFsPermissionChecker(fsn);
|
||||||
|
if (pc != null) {
|
||||||
|
pc.checkSuperuserPrivilege();
|
||||||
|
}
|
||||||
|
cacheManager.removeCachePool(cachePoolName);
|
||||||
|
fsn.getEditLog().logRemoveCachePool(cachePoolName, logRetryCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
static BatchedListEntries<CachePoolEntry> listCachePools(
|
||||||
|
FSNamesystem fsn, CacheManager cacheManager, String prevKey)
|
||||||
|
throws IOException {
|
||||||
|
final FSPermissionChecker pc = getFsPermissionChecker(fsn);
|
||||||
|
return cacheManager.listCachePools(pc, prevKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static FSPermissionChecker getFsPermissionChecker(FSNamesystem fsn)
|
||||||
|
throws AccessControlException {
|
||||||
|
return fsn.isPermissionEnabled() ? fsn.getPermissionChecker() : null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1355,6 +1355,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isPermissionEnabled() {
|
||||||
|
return isPermissionEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We already know that the safemode is on. We will throw a RetriableException
|
* We already know that the safemode is on. We will throw a RetriableException
|
||||||
* if the safemode is not manual or caused by low resource.
|
* if the safemode is not manual or caused by low resource.
|
||||||
|
@ -3607,7 +3611,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
private FSPermissionChecker getPermissionChecker()
|
FSPermissionChecker getPermissionChecker()
|
||||||
throws AccessControlException {
|
throws AccessControlException {
|
||||||
return dir.getPermissionChecker();
|
return dir.getPermissionChecker();
|
||||||
}
|
}
|
||||||
|
@ -7541,52 +7545,38 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
EnumSet<CacheFlag> flags, boolean logRetryCache)
|
EnumSet<CacheFlag> flags, boolean logRetryCache)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
final FSPermissionChecker pc = isPermissionEnabled ?
|
CacheDirectiveInfo effectiveDirective = null;
|
||||||
getPermissionChecker() : null;
|
|
||||||
|
|
||||||
if (!flags.contains(CacheFlag.FORCE)) {
|
if (!flags.contains(CacheFlag.FORCE)) {
|
||||||
cacheManager.waitForRescanIfNeeded();
|
cacheManager.waitForRescanIfNeeded();
|
||||||
}
|
}
|
||||||
boolean success = false;
|
|
||||||
writeLock();
|
writeLock();
|
||||||
String effectiveDirectiveStr = null;
|
|
||||||
Long result = null;
|
|
||||||
try {
|
try {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
if (isInSafeMode()) {
|
if (isInSafeMode()) {
|
||||||
throw new SafeModeException(
|
throw new SafeModeException(
|
||||||
"Cannot add cache directive", safeMode);
|
"Cannot add cache directive", safeMode);
|
||||||
}
|
}
|
||||||
if (directive.getId() != null) {
|
effectiveDirective = FSNDNCacheOp.addCacheDirective(this, cacheManager,
|
||||||
throw new IOException("addDirective: you cannot specify an ID " +
|
directive, flags, logRetryCache);
|
||||||
"for this operation.");
|
|
||||||
}
|
|
||||||
CacheDirectiveInfo effectiveDirective =
|
|
||||||
cacheManager.addDirective(directive, pc, flags);
|
|
||||||
getEditLog().logAddCacheDirectiveInfo(effectiveDirective, logRetryCache);
|
|
||||||
result = effectiveDirective.getId();
|
|
||||||
effectiveDirectiveStr = effectiveDirective.toString();
|
|
||||||
success = true;
|
|
||||||
} finally {
|
} finally {
|
||||||
writeUnlock();
|
writeUnlock();
|
||||||
|
boolean success = effectiveDirective != null;
|
||||||
if (success) {
|
if (success) {
|
||||||
getEditLog().logSync();
|
getEditLog().logSync();
|
||||||
}
|
}
|
||||||
if (isAuditEnabled() && isExternalInvocation()) {
|
|
||||||
logAuditEvent(success, "addCacheDirective", effectiveDirectiveStr, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
String effectiveDirectiveStr = effectiveDirective != null ?
|
||||||
|
effectiveDirective.toString() : null;
|
||||||
|
logAuditEvent(success, "addCacheDirective", effectiveDirectiveStr,
|
||||||
|
null, null);
|
||||||
}
|
}
|
||||||
return result;
|
return effectiveDirective != null ? effectiveDirective.getId() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void modifyCacheDirective(CacheDirectiveInfo directive,
|
void modifyCacheDirective(CacheDirectiveInfo directive,
|
||||||
EnumSet<CacheFlag> flags, boolean logRetryCache) throws IOException {
|
EnumSet<CacheFlag> flags, boolean logRetryCache) throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
final FSPermissionChecker pc = isPermissionEnabled ?
|
|
||||||
getPermissionChecker() : null;
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
|
||||||
if (!flags.contains(CacheFlag.FORCE)) {
|
if (!flags.contains(CacheFlag.FORCE)) {
|
||||||
cacheManager.waitForRescanIfNeeded();
|
cacheManager.waitForRescanIfNeeded();
|
||||||
}
|
}
|
||||||
|
@ -7597,26 +7587,22 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
throw new SafeModeException(
|
throw new SafeModeException(
|
||||||
"Cannot add cache directive", safeMode);
|
"Cannot add cache directive", safeMode);
|
||||||
}
|
}
|
||||||
cacheManager.modifyDirective(directive, pc, flags);
|
FSNDNCacheOp.modifyCacheDirective(this, cacheManager, directive, flags,
|
||||||
getEditLog().logModifyCacheDirectiveInfo(directive, logRetryCache);
|
logRetryCache);
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
writeUnlock();
|
writeUnlock();
|
||||||
if (success) {
|
if (success) {
|
||||||
getEditLog().logSync();
|
getEditLog().logSync();
|
||||||
}
|
}
|
||||||
if (isAuditEnabled() && isExternalInvocation()) {
|
|
||||||
String idStr = "{id: " + directive.getId().toString() + "}";
|
String idStr = "{id: " + directive.getId().toString() + "}";
|
||||||
logAuditEvent(success, "modifyCacheDirective", idStr, directive.toString(), null);
|
logAuditEvent(success, "modifyCacheDirective", idStr,
|
||||||
}
|
directive.toString(), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeCacheDirective(long id, boolean logRetryCache) throws IOException {
|
void removeCacheDirective(long id, boolean logRetryCache) throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
final FSPermissionChecker pc = isPermissionEnabled ?
|
|
||||||
getPermissionChecker() : null;
|
|
||||||
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
writeLock();
|
writeLock();
|
||||||
try {
|
try {
|
||||||
|
@ -7625,50 +7611,40 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
throw new SafeModeException(
|
throw new SafeModeException(
|
||||||
"Cannot remove cache directives", safeMode);
|
"Cannot remove cache directives", safeMode);
|
||||||
}
|
}
|
||||||
cacheManager.removeDirective(id, pc);
|
FSNDNCacheOp.removeCacheDirective(this, cacheManager, id, logRetryCache);
|
||||||
getEditLog().logRemoveCacheDirectiveInfo(id, logRetryCache);
|
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
writeUnlock();
|
writeUnlock();
|
||||||
if (isAuditEnabled() && isExternalInvocation()) {
|
|
||||||
String idStr = "{id: " + Long.toString(id) + "}";
|
String idStr = "{id: " + Long.toString(id) + "}";
|
||||||
logAuditEvent(success, "removeCacheDirective", idStr, null,
|
logAuditEvent(success, "removeCacheDirective", idStr, null,
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
getEditLog().logSync();
|
getEditLog().logSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
BatchedListEntries<CacheDirectiveEntry> listCacheDirectives(
|
BatchedListEntries<CacheDirectiveEntry> listCacheDirectives(
|
||||||
long startId, CacheDirectiveInfo filter) throws IOException {
|
long startId, CacheDirectiveInfo filter) throws IOException {
|
||||||
checkOperation(OperationCategory.READ);
|
checkOperation(OperationCategory.READ);
|
||||||
final FSPermissionChecker pc = isPermissionEnabled ?
|
|
||||||
getPermissionChecker() : null;
|
|
||||||
BatchedListEntries<CacheDirectiveEntry> results;
|
BatchedListEntries<CacheDirectiveEntry> results;
|
||||||
cacheManager.waitForRescanIfNeeded();
|
cacheManager.waitForRescanIfNeeded();
|
||||||
readLock();
|
readLock();
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
checkOperation(OperationCategory.READ);
|
checkOperation(OperationCategory.READ);
|
||||||
results =
|
results = FSNDNCacheOp.listCacheDirectives(this, cacheManager, startId,
|
||||||
cacheManager.listCacheDirectives(startId, filter, pc);
|
filter);
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
readUnlock();
|
readUnlock();
|
||||||
if (isAuditEnabled() && isExternalInvocation()) {
|
|
||||||
logAuditEvent(success, "listCacheDirectives", filter.toString(), null,
|
logAuditEvent(success, "listCacheDirectives", filter.toString(), null,
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addCachePool(CachePoolInfo req, boolean logRetryCache)
|
void addCachePool(CachePoolInfo req, boolean logRetryCache)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
final FSPermissionChecker pc = isPermissionEnabled ?
|
|
||||||
getPermissionChecker() : null;
|
|
||||||
|
|
||||||
writeLock();
|
writeLock();
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
String poolInfoStr = null;
|
String poolInfoStr = null;
|
||||||
|
@ -7678,29 +7654,21 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
throw new SafeModeException(
|
throw new SafeModeException(
|
||||||
"Cannot add cache pool " + req.getPoolName(), safeMode);
|
"Cannot add cache pool " + req.getPoolName(), safeMode);
|
||||||
}
|
}
|
||||||
if (pc != null) {
|
CachePoolInfo info = FSNDNCacheOp.addCachePool(this, cacheManager, req,
|
||||||
pc.checkSuperuserPrivilege();
|
logRetryCache);
|
||||||
}
|
|
||||||
CachePoolInfo info = cacheManager.addCachePool(req);
|
|
||||||
poolInfoStr = info.toString();
|
poolInfoStr = info.toString();
|
||||||
getEditLog().logAddCachePool(info, logRetryCache);
|
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
writeUnlock();
|
writeUnlock();
|
||||||
if (isAuditEnabled() && isExternalInvocation()) {
|
|
||||||
logAuditEvent(success, "addCachePool", poolInfoStr, null, null);
|
logAuditEvent(success, "addCachePool", poolInfoStr, null, null);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
getEditLog().logSync();
|
getEditLog().logSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void modifyCachePool(CachePoolInfo req, boolean logRetryCache)
|
void modifyCachePool(CachePoolInfo req, boolean logRetryCache)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
final FSPermissionChecker pc =
|
|
||||||
isPermissionEnabled ? getPermissionChecker() : null;
|
|
||||||
|
|
||||||
writeLock();
|
writeLock();
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
|
@ -7709,29 +7677,22 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
throw new SafeModeException(
|
throw new SafeModeException(
|
||||||
"Cannot modify cache pool " + req.getPoolName(), safeMode);
|
"Cannot modify cache pool " + req.getPoolName(), safeMode);
|
||||||
}
|
}
|
||||||
if (pc != null) {
|
FSNDNCacheOp.modifyCachePool(this, cacheManager, req, logRetryCache);
|
||||||
pc.checkSuperuserPrivilege();
|
|
||||||
}
|
|
||||||
cacheManager.modifyCachePool(req);
|
|
||||||
getEditLog().logModifyCachePool(req, logRetryCache);
|
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
writeUnlock();
|
writeUnlock();
|
||||||
if (isAuditEnabled() && isExternalInvocation()) {
|
String poolNameStr = "{poolName: " +
|
||||||
String poolNameStr = "{poolName: " + req.getPoolName() + "}";
|
(req == null ? null : req.getPoolName()) + "}";
|
||||||
logAuditEvent(success, "modifyCachePool", poolNameStr, req.toString(), null);
|
logAuditEvent(success, "modifyCachePool", poolNameStr,
|
||||||
}
|
req == null ? null : req.toString(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
getEditLog().logSync();
|
getEditLog().logSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeCachePool(String cachePoolName, boolean logRetryCache)
|
void removeCachePool(String cachePoolName, boolean logRetryCache)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
final FSPermissionChecker pc =
|
|
||||||
isPermissionEnabled ? getPermissionChecker() : null;
|
|
||||||
|
|
||||||
writeLock();
|
writeLock();
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
|
@ -7740,27 +7701,20 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
throw new SafeModeException(
|
throw new SafeModeException(
|
||||||
"Cannot remove cache pool " + cachePoolName, safeMode);
|
"Cannot remove cache pool " + cachePoolName, safeMode);
|
||||||
}
|
}
|
||||||
if (pc != null) {
|
FSNDNCacheOp.removeCachePool(this, cacheManager, cachePoolName,
|
||||||
pc.checkSuperuserPrivilege();
|
logRetryCache);
|
||||||
}
|
|
||||||
cacheManager.removeCachePool(cachePoolName);
|
|
||||||
getEditLog().logRemoveCachePool(cachePoolName, logRetryCache);
|
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
writeUnlock();
|
writeUnlock();
|
||||||
if (isAuditEnabled() && isExternalInvocation()) {
|
|
||||||
String poolNameStr = "{poolName: " + cachePoolName + "}";
|
String poolNameStr = "{poolName: " + cachePoolName + "}";
|
||||||
logAuditEvent(success, "removeCachePool", poolNameStr, null, null);
|
logAuditEvent(success, "removeCachePool", poolNameStr, null, null);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
getEditLog().logSync();
|
getEditLog().logSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BatchedListEntries<CachePoolEntry> listCachePools(String prevKey)
|
BatchedListEntries<CachePoolEntry> listCachePools(String prevKey)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
final FSPermissionChecker pc =
|
|
||||||
isPermissionEnabled ? getPermissionChecker() : null;
|
|
||||||
BatchedListEntries<CachePoolEntry> results;
|
BatchedListEntries<CachePoolEntry> results;
|
||||||
checkOperation(OperationCategory.READ);
|
checkOperation(OperationCategory.READ);
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
@ -7768,14 +7722,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
readLock();
|
readLock();
|
||||||
try {
|
try {
|
||||||
checkOperation(OperationCategory.READ);
|
checkOperation(OperationCategory.READ);
|
||||||
results = cacheManager.listCachePools(pc, prevKey);
|
results = FSNDNCacheOp.listCachePools(this, cacheManager, prevKey);
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
readUnlock();
|
readUnlock();
|
||||||
if (isAuditEnabled() && isExternalInvocation()) {
|
|
||||||
logAuditEvent(success, "listCachePools", null, null, null);
|
logAuditEvent(success, "listCachePools", null, null, null);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue