/** * Gets the metadata of a block given its blockId. * * @param blockId the block ID * @return metadata of the block * @throws NotFoundException if no BlockMeta for this blockId is found */ public synchronized BlockMeta getBlockMeta(long blockId) throws NotFoundException { for (StorageTier tier : mTiers) { for (StorageDir dir : tier.getStorageDirs()) { if (dir.hasBlockMeta(blockId)) { return dir.getBlockMeta(blockId); } } } throw new NotFoundException("Failed to get BlockMeta: blockId " + blockId + " not found"); }