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); } }
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); } }