Search in sources :

Example 1 with Capacity

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());
}
Also used : Capacity(alluxio.wire.Capacity) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest)

Example 2 with Capacity

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());
}
Also used : Capacity(alluxio.wire.Capacity) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest)

Example 3 with Capacity

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());
}
Also used : Capacity(alluxio.wire.Capacity) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest)

Example 4 with Capacity

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;
}
Also used : Capacity(alluxio.wire.Capacity) TreeMap(java.util.TreeMap)

Example 5 with Capacity

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());
}
Also used : Capacity(alluxio.wire.Capacity) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest)

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