Interface VolumeChoosingPolicy<V extends FsVolumeSpi>

All Known Implementing Classes:
AvailableSpaceVolumeChoosingPolicy, RoundRobinVolumeChoosingPolicy

@Private public interface VolumeChoosingPolicy<V extends FsVolumeSpi>
This interface specifies the policy for choosing volumes to store replicas.
  • Method Summary

    Modifier and Type
    Method
    Description
    chooseVolume(List<V> volumes, long replicaSize, String storageId)
    Choose a volume to place a replica, given a list of volumes and the replica size sought for storage.
  • Method Details

    • chooseVolume

      V chooseVolume(List<V> volumes, long replicaSize, String storageId) throws IOException
      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.
      Parameters:
      volumes - - a list of available volumes.
      replicaSize - - 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.