/** {@inheritDoc} */ public BlockMetaDataInfo getBlockMetaDataInfo(int namespaceId, Block block ) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("block=" + block); } Block stored = data.getStoredBlock(namespaceId, block.getBlockId()); if (stored == null) { return null; } BlockMetaDataInfo info = new BlockMetaDataInfo(stored, blockScanner.getLastScanTime(namespaceId, stored)); if (LOG.isDebugEnabled()) { LOG.debug("getBlockMetaDataInfo successful block=" + stored + " length " + stored.getNumBytes() + " genstamp " + stored.getGenerationStamp()); } // paranoia! verify that the contents of the stored block // matches the block file on disk. data.validateBlockMetadata(namespaceId, stored); return info; }
/** {@inheritDoc} */ public BlockMetaDataInfo getBlockMetaDataInfo(Block block ) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("block=" + block); } Block stored = data.getStoredBlock(block.getBlockId()); if (stored == null) { return null; } BlockMetaDataInfo info = new BlockMetaDataInfo(stored, blockScanner.getLastScanTime(stored)); if (LOG.isDebugEnabled()) { LOG.debug("getBlockMetaDataInfo successful block=" + stored + " length " + stored.getNumBytes() + " genstamp " + stored.getGenerationStamp()); } // paranoia! verify that the contents of the stored block // matches the block file on disk. data.validateBlockMetadata(stored); return info; }
public static void checkMetaInfo(int namespaceId, Block b, InterDatanodeProtocol idp, DataBlockScannerSet scanner) throws IOException { BlockMetaDataInfo metainfo = idp.getBlockMetaDataInfo(namespaceId, b); assertEquals(b.getBlockId(), metainfo.getBlockId()); assertEquals(b.getNumBytes(), metainfo.getNumBytes()); if (scanner != null) { assertEquals(scanner.getLastScanTime(namespaceId, b), metainfo.getLastScanTime()); } }
public static void checkMetaInfo(Block b, InterDatanodeProtocol idp, DataBlockScanner scanner) throws IOException { BlockMetaDataInfo metainfo = idp.getBlockMetaDataInfo(b); assertEquals(b.getBlockId(), metainfo.getBlockId()); assertEquals(b.getNumBytes(), metainfo.getNumBytes()); if (scanner != null) { assertEquals(scanner.getLastScanTime(b), metainfo.getLastScanTime()); } }