@Test public void removeBlockMetaNotExisting() throws Exception { mThrown.expect(BlockDoesNotExistException.class); mThrown.expectMessage(ExceptionMessage.BLOCK_META_NOT_FOUND.getMessage(TEST_BLOCK_ID)); mDir.removeBlockMeta(mBlockMeta); }
public void removeBlockMeta(BlockMeta blockMeta) throws BlockDoesNotExistException { Preconditions.checkNotNull(blockMeta, "blockMeta"); long blockId = blockMeta.getBlockId(); BlockMeta deletedBlockMeta = mBlockIdToBlockMap.remove(blockId); if (deletedBlockMeta == null) { throw new BlockDoesNotExistException(ExceptionMessage.BLOCK_META_NOT_FOUND, blockId); } reclaimSpace(blockMeta.getBlockSize(), true); }
StorageDir { public void removeBlockMeta(BlockMeta blockMeta) throws BlockDoesNotExistException { Preconditions.checkNotNull(blockMeta, "blockMeta"); long blockId = blockMeta.getBlockId(); BlockMeta deletedBlockMeta = mBlockIdToBlockMap.remove(blockId); if (deletedBlockMeta == null) { throw new BlockDoesNotExistException(ExceptionMessage.BLOCK_META_NOT_FOUND, blockId); } reclaimSpace(blockMeta.getBlockSize(), true); } }
StorageDir { public void removeBlockMeta(BlockMeta blockMeta) throws BlockDoesNotExistException { Preconditions.checkNotNull(blockMeta, "blockMeta"); long blockId = blockMeta.getBlockId(); BlockMeta deletedBlockMeta = mBlockIdToBlockMap.remove(blockId); if (deletedBlockMeta == null) { throw new BlockDoesNotExistException(ExceptionMessage.BLOCK_META_NOT_FOUND, blockId); } reclaimSpace(blockMeta.getBlockSize(), true); } private  StorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes,
      String dirPath, String dirMedium); }
StorageDir { public void removeBlockMeta(BlockMeta blockMeta) throws BlockDoesNotExistException { Preconditions.checkNotNull(blockMeta, "blockMeta"); long blockId = blockMeta.getBlockId(); BlockMeta deletedBlockMeta = mBlockIdToBlockMap.remove(blockId); if (deletedBlockMeta == null) { throw new BlockDoesNotExistException(ExceptionMessage.BLOCK_META_NOT_FOUND, blockId); } reclaimSpace(blockMeta.getBlockSize(), true); } private  StorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes,
      String dirPath, String dirMedium); static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes,
      long reservedBytes, String dirPath, String dirMedium); long getCapacityBytes(); long getAvailableBytes(); long getCommittedBytes(); String getDirPath(); String getDirMedium(); StorageTier getParentTier(); int getDirIndex(); List<Long> getBlockIds(); List<BlockMeta> getBlocks(); boolean hasBlockMeta(long blockId); boolean hasTempBlockMeta(long blockId); BlockMeta getBlockMeta(long blockId); TempBlockMeta getTempBlockMeta(long blockId); void addBlockMeta(BlockMeta blockMeta); void addTempBlockMeta(TempBlockMeta tempBlockMeta); void removeBlockMeta(BlockMeta blockMeta); void removeTempBlockMeta(TempBlockMeta tempBlockMeta); void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize); void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds); List<TempBlockMeta> getSessionTempBlocks(long sessionId); BlockStoreLocation toBlockStoreLocation(); long getReservedBytes(); }
StorageDir { public void removeBlockMeta(BlockMeta blockMeta) throws BlockDoesNotExistException { Preconditions.checkNotNull(blockMeta, "blockMeta"); long blockId = blockMeta.getBlockId(); BlockMeta deletedBlockMeta = mBlockIdToBlockMap.remove(blockId); if (deletedBlockMeta == null) { throw new BlockDoesNotExistException(ExceptionMessage.BLOCK_META_NOT_FOUND, blockId); } reclaimSpace(blockMeta.getBlockSize(), true); } private  StorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes,
      String dirPath, String dirMedium); static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capacityBytes,
      long reservedBytes, String dirPath, String dirMedium); long getCapacityBytes(); long getAvailableBytes(); long getCommittedBytes(); String getDirPath(); String getDirMedium(); StorageTier getParentTier(); int getDirIndex(); List<Long> getBlockIds(); List<BlockMeta> getBlocks(); boolean hasBlockMeta(long blockId); boolean hasTempBlockMeta(long blockId); BlockMeta getBlockMeta(long blockId); TempBlockMeta getTempBlockMeta(long blockId); void addBlockMeta(BlockMeta blockMeta); void addTempBlockMeta(TempBlockMeta tempBlockMeta); void removeBlockMeta(BlockMeta blockMeta); void removeTempBlockMeta(TempBlockMeta tempBlockMeta); void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize); void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds); List<TempBlockMeta> getSessionTempBlocks(long sessionId); BlockStoreLocation toBlockStoreLocation(); long getReservedBytes();  }