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 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); }
effectiveDirectiveStr = effectiveDirective.toString(); logAuditEvent(success, operationName, effectiveDirectiveStr, null, null);
throws Exception { LOG.info("Polling listCacheDirectives " + ((filter == null) ? "ALL" : filter.toString()) + " for " + targetBytesNeeded + " targetBytesNeeded, " + targetBytesCached + " targetBytesCached, " +
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); } }
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; }
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); } }
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; }
long addCacheDirective(CacheDirectiveInfo directive, EnumSet<CacheFlag> flags, boolean logRetryCache) throws IOException { final String operationName = "addCacheDirective"; CacheDirectiveInfo effectiveDirective = null; if (!flags.contains(CacheFlag.FORCE)) { cacheManager.waitForRescanIfNeeded(); } writeLock(); try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot add cache directive", safeMode); } effectiveDirective = FSNDNCacheOp.addCacheDirective(this, cacheManager, directive, flags, logRetryCache); } finally { writeUnlock(operationName); boolean success = effectiveDirective != null; if (success) { getEditLog().logSync(); } String effectiveDirectiveStr = effectiveDirective != null ? effectiveDirective.toString() : null; logAuditEvent(success, operationName, effectiveDirectiveStr, null, null); } return effectiveDirective != null ? effectiveDirective.getId() : 0; }
long addCacheDirective(CacheDirectiveInfo directive, EnumSet<CacheFlag> flags, boolean logRetryCache) throws IOException { final String operationName = "addCacheDirective"; CacheDirectiveInfo effectiveDirective = null; if (!flags.contains(CacheFlag.FORCE)) { cacheManager.waitForRescanIfNeeded(); } writeLock(); try { checkOperation(OperationCategory.WRITE); if (isInSafeMode()) { throw new SafeModeException( "Cannot add cache directive", safeMode); } effectiveDirective = FSNDNCacheOp.addCacheDirective(this, cacheManager, directive, flags, logRetryCache); } finally { writeUnlock(operationName); boolean success = effectiveDirective != null; if (success) { getEditLog().logSync(); } String effectiveDirectiveStr = effectiveDirective != null ? effectiveDirective.toString() : null; logAuditEvent(success, operationName, effectiveDirectiveStr, null, null); } return effectiveDirective != null ? effectiveDirective.getId() : 0; }