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; }
/** * Load cache pools from fsimage */ private void loadPools(DataInput in) throws IOException { StartupProgress prog = NameNode.getStartupProgress(); Step step = new Step(StepType.CACHE_POOLS); prog.beginStep(Phase.LOADING_FSIMAGE, step); int numberOfPools = in.readInt(); prog.setTotal(Phase.LOADING_FSIMAGE, step, numberOfPools); Counter counter = prog.getCounter(Phase.LOADING_FSIMAGE, step); for (int i = 0; i < numberOfPools; i++) { addCachePool(FSImageSerialization.readCachePoolInfo(in)); counter.increment(); } prog.endStep(Phase.LOADING_FSIMAGE, step); }
public void loadState(PersistState s) throws IOException { nextDirectiveId = s.section.getNextDirectiveId(); for (CachePoolInfoProto p : s.pools) { CachePoolInfo info = new CachePoolInfo(p.getPoolName()); if (p.hasOwnerName()) info.setOwnerName(p.getOwnerName()); if (p.hasGroupName()) info.setGroupName(p.getGroupName()); if (p.hasMode()) info.setMode(new FsPermission((short) p.getMode())); if (p.hasDefaultReplication()) { info.setDefaultReplication((short) p.getDefaultReplication()); } if (p.hasLimit()) info.setLimit(p.getLimit()); addCachePool(info); } for (CacheDirectiveInfoProto p : s.directives) { // Get pool reference by looking it up in the map final String poolName = p.getPool(); CacheDirective directive = new CacheDirective(p.getId(), new Path( p.getPath()).toUri().getPath(), (short) p.getReplication(), p .getExpiration().getMillis()); addCacheDirective(poolName, directive); } }
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 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; }
fsNamesys.getCacheManager().addCachePool(addOp.info); if (toAddRetryCache) { fsNamesys.addCacheEntry(op.rpcClientId, op.rpcCallId);
/** * Load cache pools from fsimage */ private void loadPools(DataInput in) throws IOException { StartupProgress prog = NameNode.getStartupProgress(); Step step = new Step(StepType.CACHE_POOLS); prog.beginStep(Phase.LOADING_FSIMAGE, step); int numberOfPools = in.readInt(); prog.setTotal(Phase.LOADING_FSIMAGE, step, numberOfPools); Counter counter = prog.getCounter(Phase.LOADING_FSIMAGE, step); for (int i = 0; i < numberOfPools; i++) { addCachePool(FSImageSerialization.readCachePoolInfo(in)); counter.increment(); } prog.endStep(Phase.LOADING_FSIMAGE, step); }
/** * Load cache pools from fsimage */ private void loadPools(DataInput in) throws IOException { StartupProgress prog = NameNode.getStartupProgress(); Step step = new Step(StepType.CACHE_POOLS); prog.beginStep(Phase.LOADING_FSIMAGE, step); int numberOfPools = in.readInt(); prog.setTotal(Phase.LOADING_FSIMAGE, step, numberOfPools); Counter counter = prog.getCounter(Phase.LOADING_FSIMAGE, step); for (int i = 0; i < numberOfPools; i++) { addCachePool(FSImageSerialization.readCachePoolInfo(in)); counter.increment(); } prog.endStep(Phase.LOADING_FSIMAGE, step); }
public void loadState(PersistState s) throws IOException { nextDirectiveId = s.section.getNextDirectiveId(); for (CachePoolInfoProto p : s.pools) { CachePoolInfo info = new CachePoolInfo(p.getPoolName()); if (p.hasOwnerName()) info.setOwnerName(p.getOwnerName()); if (p.hasGroupName()) info.setGroupName(p.getGroupName()); if (p.hasMode()) info.setMode(new FsPermission((short) p.getMode())); if (p.hasLimit()) info.setLimit(p.getLimit()); addCachePool(info); } for (CacheDirectiveInfoProto p : s.directives) { // Get pool reference by looking it up in the map final String poolName = p.getPool(); CacheDirective directive = new CacheDirective(p.getId(), new Path( p.getPath()).toUri().getPath(), (short) p.getReplication(), p .getExpiration().getMillis()); addCacheDirective(poolName, directive); } }
public void loadState(PersistState s) throws IOException { nextDirectiveId = s.section.getNextDirectiveId(); for (CachePoolInfoProto p : s.pools) { CachePoolInfo info = new CachePoolInfo(p.getPoolName()); if (p.hasOwnerName()) info.setOwnerName(p.getOwnerName()); if (p.hasGroupName()) info.setGroupName(p.getGroupName()); if (p.hasMode()) info.setMode(new FsPermission((short) p.getMode())); if (p.hasLimit()) info.setLimit(p.getLimit()); addCachePool(info); } for (CacheDirectiveInfoProto p : s.directives) { // Get pool reference by looking it up in the map final String poolName = p.getPool(); CacheDirective directive = new CacheDirective(p.getId(), new Path( p.getPath()).toUri().getPath(), (short) p.getReplication(), p .getExpiration().getMillis()); addCacheDirective(poolName, directive); } }
fsNamesys.getCacheManager().addCachePool(addOp.info); if (toAddRetryCache) { fsNamesys.addCacheEntry(op.rpcClientId, op.rpcCallId);
fsNamesys.getCacheManager().addCachePool(addOp.info); if (toAddRetryCache) { fsNamesys.addCacheEntry(op.rpcClientId, op.rpcCallId);