use of alluxio.wire.Capacity in project alluxio by Alluxio.
the class AlluxioMasterRestApiTest method getCapacity.
@Test
public void getCapacity() throws Exception {
long total = Configuration.getBytes(PropertyKey.WORKER_MEMORY_SIZE);
Capacity capacity = getInfo(NO_PARAMS).getCapacity();
Assert.assertEquals(total, capacity.getTotal());
Assert.assertEquals(0, capacity.getUsed());
}
use of alluxio.wire.Capacity in project alluxio by Alluxio.
the class AlluxioWorkerRestApiTest method getCapacity.
@Test
public void getCapacity() throws Exception {
long total = Configuration.getBytes(PropertyKey.WORKER_MEMORY_SIZE);
Capacity capacity = getInfo().getCapacity();
Assert.assertEquals(total, capacity.getTotal());
Assert.assertEquals(0, capacity.getUsed());
}
use of alluxio.wire.Capacity in project alluxio by Alluxio.
the class AlluxioWorkerRestApiTest method getTierCapacity.
@Test
public void getTierCapacity() throws Exception {
long total = Configuration.getLong(PropertyKey.WORKER_MEMORY_SIZE);
Capacity capacity = getInfo().getTierCapacity().get("MEM");
Assert.assertEquals(total, capacity.getTotal());
Assert.assertEquals(0, capacity.getUsed());
}
use of alluxio.wire.Capacity in project alluxio by Alluxio.
the class AlluxioMasterRestServiceHandler method getTierCapacityInternal.
private Map<String, Capacity> getTierCapacityInternal() {
SortedMap<String, Capacity> tierCapacity = new TreeMap<>();
Map<String, Long> totalTierCapacity = mBlockMaster.getTotalBytesOnTiers();
Map<String, Long> usedTierCapacity = mBlockMaster.getUsedBytesOnTiers();
for (String tierAlias : mBlockMaster.getGlobalStorageTierAssoc().getOrderedStorageAliases()) {
long total = totalTierCapacity.containsKey(tierAlias) ? totalTierCapacity.get(tierAlias) : 0;
long used = usedTierCapacity.containsKey(tierAlias) ? usedTierCapacity.get(tierAlias) : 0;
tierCapacity.put(tierAlias, new Capacity().setTotal(total).setUsed(used));
}
return tierCapacity;
}
use of alluxio.wire.Capacity in project alluxio by Alluxio.
the class AlluxioMasterRestApiTest method getTierCapacity.
@Test
public void getTierCapacity() throws Exception {
long total = Configuration.getLong(PropertyKey.WORKER_MEMORY_SIZE);
Capacity capacity = getInfo(NO_PARAMS).getTierCapacity().get("MEM");
Assert.assertEquals(total, capacity.getTotal());
Assert.assertEquals(0, capacity.getUsed());
}