Interface VolumeChoosingPolicy<V extends FsVolumeSpi>
- All Known Implementing Classes:
AvailableSpaceVolumeChoosingPolicy,RoundRobinVolumeChoosingPolicy
This interface specifies the policy for choosing volumes to store replicas.
-
Method Summary
Modifier and TypeMethodDescriptionchooseVolume(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
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.
-