Class RoundRobinVolumeChoosingPolicy<V extends FsVolumeSpi>

java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.RoundRobinVolumeChoosingPolicy<V>
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, VolumeChoosingPolicy<V>

public class RoundRobinVolumeChoosingPolicy<V extends FsVolumeSpi> extends Object implements VolumeChoosingPolicy<V>, org.apache.hadoop.conf.Configurable
Choose volumes with the same storage type in round-robin order. Use fine-grained locks to synchronize volume choosing.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • RoundRobinVolumeChoosingPolicy

      public RoundRobinVolumeChoosingPolicy()
  • Method Details

    • setConf

      public void setConf(org.apache.hadoop.conf.Configuration conf)
      Specified by:
      setConf in interface org.apache.hadoop.conf.Configurable
    • getConf

      public org.apache.hadoop.conf.Configuration getConf()
      Specified by:
      getConf in interface org.apache.hadoop.conf.Configurable
    • chooseVolume

      public V chooseVolume(List<V> volumes, long blockSize, String storageId) throws IOException
      Description copied from interface: VolumeChoosingPolicy
      Choose a volume to place a replica, given a list of volumes and the replica size sought for storage. The caller should synchronize access to the list of volumes.
      Specified by:
      chooseVolume in interface VolumeChoosingPolicy<V extends FsVolumeSpi>
      Parameters:
      volumes - - a list of available volumes.
      blockSize - - the size of the replica for which a volume is sought.
      storageId - - the storage id of the Volume nominated by the namenode. This can usually be ignored by the VolumeChoosingPolicy.
      Returns:
      the chosen volume.
      Throws:
      IOException - when disks are unavailable or are full.