@Test public void getDir() { BlockStoreLocation loc; StorageDir dir; loc = new BlockStoreLocation("MEM", 0); dir = mMetaManager.getDir(loc); assertEquals(loc.tierAlias(), dir.getParentTier().getTierAlias()); assertEquals(loc.dir(), dir.getDirIndex()); loc = new BlockStoreLocation("HDD", 1); dir = mMetaManager.getDir(loc); assertEquals(loc.tierAlias(), dir.getParentTier().getTierAlias()); assertEquals(loc.dir(), dir.getDirIndex()); }
public StorageDir getDir(BlockStoreLocation location) { if (location.equals(BlockStoreLocation.anyTier()) || location.equals(BlockStoreLocation.anyDirInTier(location.tierAlias()))) { throw new IllegalArgumentException( ExceptionMessage.GET_DIR_FROM_NON_SPECIFIC_LOCATION.getMessage(location)); } return getTier(location.tierAlias()).getDir(location.dir()); }
BlockMetadataManager { public StorageDir getDir(BlockStoreLocation location) { if (location.equals(BlockStoreLocation.anyTier()) || location.equals(BlockStoreLocation.anyDirInTier(location.tierAlias()))) { throw new IllegalArgumentException( ExceptionMessage.GET_DIR_FROM_NON_SPECIFIC_LOCATION.getMessage(location)); } return getTier(location.tierAlias()).getDir(location.dir()); } }
BlockMetadataManager { public StorageDir getDir(BlockStoreLocation location) { if (location.equals(BlockStoreLocation.anyTier()) || location.equals(BlockStoreLocation.anyDirInTier(location.tierAlias()))) { throw new IllegalArgumentException( ExceptionMessage.GET_DIR_FROM_NON_SPECIFIC_LOCATION.getMessage(location)); } return getTier(location.tierAlias()).getDir(location.dir()); } private  BlockMetadataManager(); }
BlockMetadataManager { public StorageDir getDir(BlockStoreLocation location) { if (location.equals(BlockStoreLocation.anyTier()) || location.equals(BlockStoreLocation.anyDirInTier(location.tierAlias()))) { throw new IllegalArgumentException( ExceptionMessage.GET_DIR_FROM_NON_SPECIFIC_LOCATION.getMessage(location)); } return getTier(location.tierAlias()).getDir(location.dir()); } private  BlockMetadataManager(); BlockIterator getBlockIterator(); static BlockMetadataManager createBlockMetadataManager(); void abortTempBlockMeta(TempBlockMeta tempBlockMeta); void addTempBlockMeta(TempBlockMeta tempBlockMeta); void commitTempBlockMeta(TempBlockMeta tempBlockMeta); void swapBlocks(BlockMeta blockMeta1, BlockMeta blockMeta2); @Deprecated void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds); long getAvailableBytes(BlockStoreLocation location); BlockMeta getBlockMeta(long blockId); @Nullable String getBlockPath(long blockId, BlockStoreLocation location); BlockStoreMeta getBlockStoreMeta(); BlockStoreMeta getBlockStoreMetaFull(); StorageDir getDir(BlockStoreLocation location); TempBlockMeta getTempBlockMeta(long blockId); @Nullable TempBlockMeta getTempBlockMetaOrNull(long blockId); StorageTier getTier(String tierAlias); List<StorageTier> getTiers(); List<StorageTier> getTiersBelow(String tierAlias); List<TempBlockMeta> getSessionTempBlocks(long sessionId); boolean hasBlockMeta(long blockId); boolean hasTempBlockMeta(long blockId); BlockMeta moveBlockMeta(BlockMeta blockMeta, TempBlockMeta tempBlockMeta); @Deprecated BlockMeta moveBlockMeta(BlockMeta blockMeta, BlockStoreLocation newLocation); void removeBlockMeta(BlockMeta block); void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize); StorageTierAssoc getStorageTierAssoc(); }
BlockMetadataManager { public StorageDir getDir(BlockStoreLocation location) { if (location.equals(BlockStoreLocation.anyTier()) || location.equals(BlockStoreLocation.anyDirInTier(location.tierAlias()))) { throw new IllegalArgumentException( ExceptionMessage.GET_DIR_FROM_NON_SPECIFIC_LOCATION.getMessage(location)); } return getTier(location.tierAlias()).getDir(location.dir()); } private  BlockMetadataManager(); BlockIterator getBlockIterator(); static BlockMetadataManager createBlockMetadataManager(); void abortTempBlockMeta(TempBlockMeta tempBlockMeta); void addTempBlockMeta(TempBlockMeta tempBlockMeta); void commitTempBlockMeta(TempBlockMeta tempBlockMeta); void swapBlocks(BlockMeta blockMeta1, BlockMeta blockMeta2); @Deprecated void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds); long getAvailableBytes(BlockStoreLocation location); BlockMeta getBlockMeta(long blockId); @Nullable String getBlockPath(long blockId, BlockStoreLocation location); BlockStoreMeta getBlockStoreMeta(); BlockStoreMeta getBlockStoreMetaFull(); StorageDir getDir(BlockStoreLocation location); TempBlockMeta getTempBlockMeta(long blockId); @Nullable TempBlockMeta getTempBlockMetaOrNull(long blockId); StorageTier getTier(String tierAlias); List<StorageTier> getTiers(); List<StorageTier> getTiersBelow(String tierAlias); List<TempBlockMeta> getSessionTempBlocks(long sessionId); boolean hasBlockMeta(long blockId); boolean hasTempBlockMeta(long blockId); BlockMeta moveBlockMeta(BlockMeta blockMeta, TempBlockMeta tempBlockMeta); @Deprecated BlockMeta moveBlockMeta(BlockMeta blockMeta, BlockStoreLocation newLocation); void removeBlockMeta(BlockMeta block); void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize); StorageTierAssoc getStorageTierAssoc();  }