BlockInfo extends Block implements LightWeightGSet.LinkedElement { abstract boolean addStorage(DatanodeStorageInfo storage, Block reportedBlock); BlockInfo(short size);  BlockInfo(Block blk, short size); short getReplication(); void setReplication(short repl); long getBlockCollectionId(); void setBlockCollectionId(long id); boolean isDeleted(); DatanodeDescriptor getDatanode(int index); int getCapacity(); abstract int numNodes(); abstract boolean isStriped(); BlockInfo moveBlockToHead(BlockInfo head, DatanodeStorageInfo storage,
      int curIndex, int headIndex); @Override int hashCode(); @Override boolean equals(Object obj); @Override LightWeightGSet.LinkedElement getNext(); @Override void setNext(LightWeightGSet.LinkedElement next); BlockUnderConstructionFeature getUnderConstructionFeature(); BlockUCState getBlockUCState(); boolean isComplete(); void convertToBlockUnderConstruction(BlockUCState s,
      DatanodeStorageInfo[] targets); void setGenerationStampAndVerifyReplicas(long genStamp); static final BlockInfo[] EMPTY_ARRAY; }
@Test public void testAddStorage() throws Exception { BlockInfo blockInfo = new BlockInfoContiguous((short) 3); final DatanodeStorageInfo storage = DFSTestUtil.createDatanodeStorageInfo("storageID", "127.0.0.1"); boolean added = blockInfo.addStorage(storage, blockInfo); Assert.assertTrue(added); Assert.assertEquals(storage, blockInfo.getStorageInfo(0)); }