Search in sources :

Example 1 with CacheDirectiveStats

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);
}
Also used : CacheDirectiveInfo(org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo) CacheDirectiveStats(org.apache.hadoop.hdfs.protocol.CacheDirectiveStats) CacheDirectiveEntry(org.apache.hadoop.hdfs.protocol.CacheDirectiveEntry)

Example 2 with CacheDirectiveStats

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();
}
Also used : CacheDirective(org.apache.hadoop.hdfs.protocol.CacheDirective) CacheDirectiveStats(org.apache.hadoop.hdfs.protocol.CacheDirectiveStats)

Aggregations

CacheDirectiveStats (org.apache.hadoop.hdfs.protocol.CacheDirectiveStats)2 CacheDirective (org.apache.hadoop.hdfs.protocol.CacheDirective)1 CacheDirectiveEntry (org.apache.hadoop.hdfs.protocol.CacheDirectiveEntry)1 CacheDirectiveInfo (org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo)1