use of org.apache.hadoop.hdfs.protocol.CacheDirectiveStats in project hadoop by apache.
the class PBHelperClient method convert.
public static CacheDirectiveEntry convert(CacheDirectiveEntryProto proto) {
CacheDirectiveInfo info = convert(proto.getInfo());
CacheDirectiveStats stats = convert(proto.getStats());
return new CacheDirectiveEntry(info, stats);
}
use of org.apache.hadoop.hdfs.protocol.CacheDirectiveStats in project hadoop by apache.
the class CacheManager method addInternal.
// RPC handlers
private void addInternal(CacheDirective directive, CachePool pool) {
boolean addedDirective = pool.getDirectiveList().add(directive);
assert addedDirective;
directivesById.put(directive.getId(), directive);
String path = directive.getPath();
List<CacheDirective> directives = directivesByPath.get(path);
if (directives == null) {
directives = new ArrayList<CacheDirective>(1);
directivesByPath.put(path, directives);
}
directives.add(directive);
// Fix up pool stats
CacheDirectiveStats stats = computeNeeded(directive.getPath(), directive.getReplication());
directive.addBytesNeeded(stats.getBytesNeeded());
directive.addFilesNeeded(directive.getFilesNeeded());
setNeedsRescan();
}
Aggregations