checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot add cache directive"); effectiveDirective = FSNDNCacheOp.addCacheDirective(this, cacheManager, directive, flags, logRetryCache); success = true;
static BatchedListEntries<CachePoolEntry> listCachePools( FSNamesystem fsn, CacheManager cacheManager, String prevKey) throws IOException { final FSPermissionChecker pc = getFsPermissionChecker(fsn); return cacheManager.listCachePools(pc, prevKey); }
BatchedListEntries<CacheDirectiveEntry> listCacheDirectives( long startId, CacheDirectiveInfo filter) throws IOException { final String operationName = "listCacheDirectives"; checkOperation(OperationCategory.READ); BatchedListEntries<CacheDirectiveEntry> results; cacheManager.waitForRescanIfNeeded(); readLock(); boolean success = false; try { checkOperation(OperationCategory.READ); results = FSNDNCacheOp.listCacheDirectives(this, cacheManager, startId, filter); success = true; } catch (AccessControlException ace) { logAuditEvent(success, operationName, filter.toString(), null, null); throw ace; } finally { readUnlock(operationName); } logAuditEvent(success, operationName, filter.toString(), null, null); return results; }
void removeCacheDirective(long id, boolean logRetryCache) throws IOException { final String operationName = "removeCacheDirective"; boolean success = false; String idStr = "{id: " + Long.toString(id) + "}"; checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot remove cache directives"); FSNDNCacheOp.removeCacheDirective(this, cacheManager, id, logRetryCache); success = true; } catch (AccessControlException ace) { logAuditEvent(success, operationName, idStr, null, null); throw ace; } finally { writeUnlock(operationName); } logAuditEvent(success, operationName, idStr, null, null); getEditLog().logSync(); }
BatchedListEntries<CachePoolEntry> listCachePools(String prevKey) throws IOException { final String operationName = "listCachePools"; BatchedListEntries<CachePoolEntry> results; checkOperation(OperationCategory.READ); boolean success = false; cacheManager.waitForRescanIfNeeded(); readLock(); try { checkOperation(OperationCategory.READ); results = FSNDNCacheOp.listCachePools(this, cacheManager, prevKey); success = true; } catch (AccessControlException ace) { logAuditEvent(success, operationName, null, null, null); throw ace; } finally { readUnlock(operationName); } logAuditEvent(success, operationName, null, null, null); return results; }
void removeCachePool(String cachePoolName, boolean logRetryCache) throws IOException { final String operationName = "removeCachePool"; checkOperation(OperationCategory.WRITE); 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, operationName, poolNameStr, null, null); throw ace; } finally { writeUnlock(operationName); } logAuditEvent(success, operationName, poolNameStr, null, null); getEditLog().logSync(); }
void addCachePool(CachePoolInfo req, boolean logRetryCache) throws IOException { final String operationName = "addCachePool"; checkOperation(OperationCategory.WRITE); writeLock(); boolean success = false; String poolInfoStr = null; try { checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot add cache pool" + (req == null ? null : req.getPoolName())); CachePoolInfo info = FSNDNCacheOp.addCachePool(this, cacheManager, req, logRetryCache); poolInfoStr = info.toString(); success = true; } catch (AccessControlException ace) { logAuditEvent(success, operationName, poolInfoStr, null, null); throw ace; } finally { writeUnlock(operationName); } logAuditEvent(success, operationName, poolInfoStr, null, null); getEditLog().logSync(); }
void modifyCachePool(CachePoolInfo req, boolean logRetryCache) throws IOException { final String operationName = "modifyCachePool"; checkOperation(OperationCategory.WRITE); 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, operationName, poolNameStr, req == null ? null : req.toString(), null); throw ace; } finally { writeUnlock(operationName); } logAuditEvent(success, operationName, poolNameStr, req == null ? null : req.toString(), null); getEditLog().logSync(); }
void modifyCacheDirective(CacheDirectiveInfo directive, EnumSet<CacheFlag> flags, boolean logRetryCache) throws IOException { final String operationName = "modifyCacheDirective"; boolean success = false; final String idStr = "{id: " + directive.getId() + "}"; if (!flags.contains(CacheFlag.FORCE)) { cacheManager.waitForRescanIfNeeded(); } checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot add cache directive"); FSNDNCacheOp.modifyCacheDirective(this, cacheManager, directive, flags, logRetryCache); success = true; } catch (AccessControlException ace) { logAuditEvent(success, operationName, idStr, directive.toString(), null); throw ace; } finally { writeUnlock(operationName); if (success) { getEditLog().logSync(); } } logAuditEvent(success, operationName, idStr, directive.toString(), null); }
void removeCacheDirective(long id, boolean logRetryCache) throws IOException { final String operationName = "removeCacheDirective"; boolean success = false; writeLock(); try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot remove cache directives", safeMode); } FSNDNCacheOp.removeCacheDirective(this, cacheManager, id, logRetryCache); success = true; } finally { writeUnlock(operationName); String idStr = "{id: " + Long.toString(id) + "}"; logAuditEvent(success, operationName, idStr, null, null); } getEditLog().logSync(); }
BatchedListEntries<CachePoolEntry> listCachePools(String prevKey) throws IOException { final String operationName = "listCachePools"; BatchedListEntries<CachePoolEntry> results; checkOperation(OperationCategory.READ); boolean success = false; cacheManager.waitForRescanIfNeeded(); readLock(); try { checkOperation(OperationCategory.READ); results = FSNDNCacheOp.listCachePools(this, cacheManager, prevKey); success = true; } finally { readUnlock(operationName); logAuditEvent(success, operationName, null, null, null); } return results; }
void removeCachePool(String cachePoolName, boolean logRetryCache) throws IOException { final String operationName = "removeCachePool"; writeLock(); boolean success = false; try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot remove cache pool " + cachePoolName, safeMode); } FSNDNCacheOp.removeCachePool(this, cacheManager, cachePoolName, logRetryCache); success = true; } finally { writeUnlock(operationName); String poolNameStr = "{poolName: " + cachePoolName + "}"; logAuditEvent(success, operationName, poolNameStr, null, null); } getEditLog().logSync(); }
void addCachePool(CachePoolInfo req, boolean logRetryCache) throws IOException { final String operationName = "addCachePool"; writeLock(); boolean success = false; String poolInfoStr = null; try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot add cache pool " + req.getPoolName(), safeMode); } CachePoolInfo info = FSNDNCacheOp.addCachePool(this, cacheManager, req, logRetryCache); poolInfoStr = info.toString(); success = true; } finally { writeUnlock(operationName); logAuditEvent(success, operationName, poolInfoStr, null, null); } getEditLog().logSync(); }
void modifyCachePool(CachePoolInfo req, boolean logRetryCache) throws IOException { final String operationName = "modifyCachePool"; writeLock(); boolean success = false; try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot modify cache pool " + req.getPoolName(), safeMode); } FSNDNCacheOp.modifyCachePool(this, cacheManager, req, logRetryCache); success = true; } finally { writeUnlock(operationName); String poolNameStr = "{poolName: " + (req == null ? null : req.getPoolName()) + "}"; logAuditEvent(success, operationName, poolNameStr, req == null ? null : req.toString(), null); } getEditLog().logSync(); }
void modifyCacheDirective(CacheDirectiveInfo directive, EnumSet<CacheFlag> flags, boolean logRetryCache) throws IOException { final String operationName = "modifyCacheDirective"; boolean success = false; if (!flags.contains(CacheFlag.FORCE)) { cacheManager.waitForRescanIfNeeded(); } writeLock(); try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot add cache directive", safeMode); } FSNDNCacheOp.modifyCacheDirective(this, cacheManager, directive, flags, logRetryCache); success = true; } finally { writeUnlock(operationName); if (success) { getEditLog().logSync(); } String idStr = "{id: " + directive.getId().toString() + "}"; logAuditEvent(success, "modifyCacheDirective", idStr, directive.toString(), null); } }
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); }
void removeCacheDirective(long id, boolean logRetryCache) throws IOException { final String operationName = "removeCacheDirective"; boolean success = false; writeLock(); try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot remove cache directives", safeMode); } FSNDNCacheOp.removeCacheDirective(this, cacheManager, id, logRetryCache); success = true; } finally { writeUnlock(operationName); String idStr = "{id: " + Long.toString(id) + "}"; logAuditEvent(success, operationName, idStr, null, null); } getEditLog().logSync(); }
BatchedListEntries<CachePoolEntry> listCachePools(String prevKey) throws IOException { final String operationName = "listCachePools"; BatchedListEntries<CachePoolEntry> results; checkOperation(OperationCategory.READ); boolean success = false; cacheManager.waitForRescanIfNeeded(); readLock(); try { checkOperation(OperationCategory.READ); results = FSNDNCacheOp.listCachePools(this, cacheManager, prevKey); success = true; } finally { readUnlock(operationName); logAuditEvent(success, operationName, null, null, null); } return results; }
void removeCachePool(String cachePoolName, boolean logRetryCache) throws IOException { final String operationName = "removeCachePool"; writeLock(); boolean success = false; try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot remove cache pool " + cachePoolName, safeMode); } FSNDNCacheOp.removeCachePool(this, cacheManager, cachePoolName, logRetryCache); success = true; } finally { writeUnlock(operationName); String poolNameStr = "{poolName: " + cachePoolName + "}"; logAuditEvent(success, operationName, poolNameStr, null, null); } getEditLog().logSync(); }
BatchedListEntries<CacheDirectiveEntry> listCacheDirectives( long startId, CacheDirectiveInfo filter) throws IOException { final String operationName = "listCacheDirectives"; checkOperation(OperationCategory.READ); BatchedListEntries<CacheDirectiveEntry> results; cacheManager.waitForRescanIfNeeded(); readLock(); boolean success = false; try { checkOperation(OperationCategory.READ); results = FSNDNCacheOp.listCacheDirectives(this, cacheManager, startId, filter); success = true; } finally { readUnlock(operationName); logAuditEvent(success, operationName, filter.toString(), null, null); } return results; }