public void removeDirective(long id, FSPermissionChecker pc) throws IOException { assert namesystem.hasWriteLock(); try { CacheDirective directive = getById(id); checkWritePermission(pc, directive.getPool()); removeInternal(directive); } catch (IOException e) { LOG.warn("removeDirective of " + id + " failed: ", e); throw e; } LOG.info("removeDirective of " + id + " successful."); }
public CacheDirectiveInfo addDirective( CacheDirectiveInfo info, FSPermissionChecker pc, EnumSet<CacheFlag> flags) throws IOException { assert namesystem.hasWriteLock(); CacheDirective directive; try { CachePool pool = getCachePool(validatePoolName(info)); checkWritePermission(pc, pool); String path = validatePath(info); short replication = validateReplication( info, pool.getDefaultReplication()); long expiryTime = validateExpiryTime(info, pool.getMaxRelativeExpiryMs()); // Do quota validation if required if (!flags.contains(CacheFlag.FORCE)) { checkLimit(pool, path, replication); } // All validation passed // Add a new entry with the next available ID. long id = getNextDirectiveId(); directive = new CacheDirective(id, path, replication, expiryTime); addInternal(directive, pool); } catch (IOException e) { LOG.warn("addDirective of " + info + " failed: ", e); throw e; } LOG.info("addDirective of {} successful.", info); return directive.toInfo(); }
checkWritePermission(pc, prevEntry.getPool()); CachePool destPool = getCachePool(validatePoolName(infoWithDefaults)); if (!srcPool.getPoolName().equals(destPool.getPoolName())) { checkWritePermission(pc, destPool); if (!flags.contains(CacheFlag.FORCE)) { checkLimit(destPool, infoWithDefaults.getPath().toUri().getPath(),
public void removeDirective(long id, FSPermissionChecker pc) throws IOException { assert namesystem.hasWriteLock(); try { CacheDirective directive = getById(id); checkWritePermission(pc, directive.getPool()); removeInternal(directive); } catch (IOException e) { LOG.warn("removeDirective of " + id + " failed: ", e); throw e; } LOG.info("removeDirective of " + id + " successful."); }
public void removeDirective(long id, FSPermissionChecker pc) throws IOException { assert namesystem.hasWriteLock(); try { CacheDirective directive = getById(id); checkWritePermission(pc, directive.getPool()); removeInternal(directive); } catch (IOException e) { LOG.warn("removeDirective of " + id + " failed: ", e); throw e; } LOG.info("removeDirective of " + id + " successful."); }
public CacheDirectiveInfo addDirective( CacheDirectiveInfo info, FSPermissionChecker pc, EnumSet<CacheFlag> flags) throws IOException { assert namesystem.hasWriteLock(); CacheDirective directive; try { CachePool pool = getCachePool(validatePoolName(info)); checkWritePermission(pc, pool); String path = validatePath(info); short replication = validateReplication(info, (short)1); long expiryTime = validateExpiryTime(info, pool.getMaxRelativeExpiryMs()); // Do quota validation if required if (!flags.contains(CacheFlag.FORCE)) { checkLimit(pool, path, replication); } // All validation passed // Add a new entry with the next available ID. long id = getNextDirectiveId(); directive = new CacheDirective(id, path, replication, expiryTime); addInternal(directive, pool); } catch (IOException e) { LOG.warn("addDirective of " + info + " failed: ", e); throw e; } LOG.info("addDirective of {} successful.", info); return directive.toInfo(); }
checkWritePermission(pc, prevEntry.getPool()); CachePool destPool = getCachePool(validatePoolName(infoWithDefaults)); if (!srcPool.getPoolName().equals(destPool.getPoolName())) { checkWritePermission(pc, destPool); if (!flags.contains(CacheFlag.FORCE)) { checkLimit(destPool, infoWithDefaults.getPath().toUri().getPath(),
checkWritePermission(pc, prevEntry.getPool()); CachePool destPool = getCachePool(validatePoolName(infoWithDefaults)); if (!srcPool.getPoolName().equals(destPool.getPoolName())) { checkWritePermission(pc, destPool); if (!flags.contains(CacheFlag.FORCE)) { checkLimit(destPool, infoWithDefaults.getPath().toUri().getPath(),
public CacheDirectiveInfo addDirective( CacheDirectiveInfo info, FSPermissionChecker pc, EnumSet<CacheFlag> flags) throws IOException { assert namesystem.hasWriteLock(); CacheDirective directive; try { CachePool pool = getCachePool(validatePoolName(info)); checkWritePermission(pc, pool); String path = validatePath(info); short replication = validateReplication(info, (short)1); long expiryTime = validateExpiryTime(info, pool.getMaxRelativeExpiryMs()); // Do quota validation if required if (!flags.contains(CacheFlag.FORCE)) { checkLimit(pool, path, replication); } // All validation passed // Add a new entry with the next available ID. long id = getNextDirectiveId(); directive = new CacheDirective(id, path, replication, expiryTime); addInternal(directive, pool); } catch (IOException e) { LOG.warn("addDirective of " + info + " failed: ", e); throw e; } LOG.info("addDirective of {} successful.", info); return directive.toInfo(); }