public BlockMeta moveBlockMeta ( BlockMeta blockMeta , TempBlockMeta tempBlockMeta ) throws BlockDoesNotExistException , WorkerOutOfSpaceException , BlockAlreadyExistsException { StorageDir srcDir = blockMeta . getParentDir ( ) ; StorageDir dstDir = tempBlockMeta . getParentDir ( ) ; srcDir . removeBlockMeta ( blockMeta ) ; BlockMeta newBlockMeta = new BlockMeta ( blockMeta . getBlockId ( ) , blockMeta . getBlockSize ( ) , dstDir ) ; dstDir . removeTempBlockMeta ( tempBlockMeta ) ; dstDir . addBlockMeta ( newBlockMeta ) ; return newBlockMeta ; }
Moves an existing block to another location currently hold by a temp block .