Search in sources :

Example 6 with Capacity

use of alluxio.wire.Capacity in project alluxio by Alluxio.

the class AlluxioWorkerRestServiceHandler method getTierCapacityInternal.

private Map<String, Capacity> getTierCapacityInternal() {
    SortedMap<String, Capacity> tierCapacity = new TreeMap<>(getTierAliasComparator());
    Map<String, Long> capacityBytesOnTiers = mStoreMeta.getCapacityBytesOnTiers();
    Map<String, Long> usedBytesOnTiers = mStoreMeta.getUsedBytesOnTiers();
    for (Map.Entry<String, Long> entry : capacityBytesOnTiers.entrySet()) {
        tierCapacity.put(entry.getKey(), new Capacity().setTotal(entry.getValue()).setUsed(usedBytesOnTiers.get(entry.getKey())));
    }
    return tierCapacity;
}
Also used : Capacity(alluxio.wire.Capacity) TreeMap(java.util.TreeMap) Map(java.util.Map) TreeMap(java.util.TreeMap) SortedMap(java.util.SortedMap)

Aggregations

Capacity (alluxio.wire.Capacity)6 RestApiTest (alluxio.rest.RestApiTest)4 Test (org.junit.Test)4 TreeMap (java.util.TreeMap)2 Map (java.util.Map)1 SortedMap (java.util.SortedMap)1