org.apache.hadoop.hdfs.server.datanode
Class RoundRobinVolumesPolicy

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.datanode.RoundRobinVolumesPolicy
All Implemented Interfaces:
BlockVolumeChoosingPolicy

public class RoundRobinVolumesPolicy
extends Object
implements BlockVolumeChoosingPolicy


Constructor Summary
RoundRobinVolumesPolicy()
           
 
Method Summary
 org.apache.hadoop.hdfs.server.datanode.FSDataset.FSVolume chooseVolume(List<org.apache.hadoop.hdfs.server.datanode.FSDataset.FSVolume> volumes, long blockSize)
          Returns a specific FSVolume after applying a suitable choice algorithm to place a given block, given a list of FSVolumes and the block size sought for storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobinVolumesPolicy

public RoundRobinVolumesPolicy()
Method Detail

chooseVolume

public org.apache.hadoop.hdfs.server.datanode.FSDataset.FSVolume chooseVolume(List<org.apache.hadoop.hdfs.server.datanode.FSDataset.FSVolume> volumes,
                                                                              long blockSize)
                                                                       throws IOException
Description copied from interface: BlockVolumeChoosingPolicy
Returns a specific FSVolume after applying a suitable choice algorithm to place a given block, given a list of FSVolumes and the block size sought for storage. (Policies that maintain state must be thread-safe.)

Specified by:
chooseVolume in interface BlockVolumeChoosingPolicy
Parameters:
volumes - - the array of FSVolumes that are available.
blockSize - - the size of the block for which a volume is sought.
Returns:
the chosen volume to store the block.
Throws:
IOException - when disks are unavailable or are full.


Copyright © 2012 Apache Software Foundation. All Rights Reserved.