use of alluxio.worker.block.meta.StorageTier in project alluxio by Alluxio.
the class BlockStoreMetaTest method getBlockList.
/**
* Tests the {@link BlockStoreMeta#getBlockList()} method.
*/
@Test
public void getBlockList() {
Map<String, List<Long>> tierAliasToBlockIds = new HashMap<>();
for (StorageTier tier : mMetadataManager.getTiers()) {
List<Long> blockIdsOnTier = new ArrayList<>();
for (StorageDir dir : tier.getStorageDirs()) {
blockIdsOnTier.addAll(dir.getBlockIds());
}
tierAliasToBlockIds.put(tier.getTierAlias(), blockIdsOnTier);
}
Map<String, List<Long>> actual = mBlockStoreMetaFull.getBlockList();
Assert.assertEquals(TieredBlockStoreTestUtils.TIER_ALIAS.length, actual.keySet().size());
Assert.assertEquals(tierAliasToBlockIds, actual);
}
use of alluxio.worker.block.meta.StorageTier in project alluxio by Alluxio.
the class BlockStoreMetaTest method getCapacityBytesOnDirs.
/**
* Tests the {@link BlockStoreMeta#getCapacityBytes()} method.
*/
@Test
public void getCapacityBytesOnDirs() {
Map<Pair<String, String>, Long> dirsToCapacityBytes = new HashMap<>();
for (StorageTier tier : mMetadataManager.getTiers()) {
for (StorageDir dir : tier.getStorageDirs()) {
dirsToCapacityBytes.put(new Pair<>(tier.getTierAlias(), dir.getDirPath()), dir.getCapacityBytes());
}
}
Assert.assertEquals(dirsToCapacityBytes, mBlockStoreMeta.getCapacityBytesOnDirs());
Assert.assertEquals(TieredBlockStoreTestUtils.getDefaultDirNum(), mBlockStoreMeta.getCapacityBytesOnDirs().values().size());
}
Aggregations