org.apache.hadoop.hdfs.server.blockmanagement
Interface MutableBlockCollection

All Superinterfaces:
org.apache.hadoop.hdfs.server.blockmanagement.BlockCollection

public interface MutableBlockCollection
extends org.apache.hadoop.hdfs.server.blockmanagement.BlockCollection

This interface is used by the block manager to expose a few characteristics of a collection of Block/BlockUnderConstruction.


Method Summary
 void setBlock(int index, org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo blk)
          Set the block at the given index.
 BlockInfoUnderConstruction setLastBlock(org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo lastBlock, DatanodeStorageInfo[] storages)
          Convert the last block of the collection to an under-construction block and set the locations.
 
Methods inherited from interface org.apache.hadoop.hdfs.server.blockmanagement.BlockCollection
computeContentSummary, getBlockReplication, getBlocks, getLastBlock, getName, getPreferredBlockSize, getStoragePolicyID, isUnderConstruction, numBlocks
 

Method Detail

setBlock

void setBlock(int index,
              org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo blk)
Set the block at the given index.

Specified by:
setBlock in interface org.apache.hadoop.hdfs.server.blockmanagement.BlockCollection

setLastBlock

BlockInfoUnderConstruction setLastBlock(org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo lastBlock,
                                        DatanodeStorageInfo[] storages)
                                        throws IOException
Convert the last block of the collection to an under-construction block and set the locations.

Specified by:
setLastBlock in interface org.apache.hadoop.hdfs.server.blockmanagement.BlockCollection
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.