Class CapacityVolumeChoosingPolicy
java.lang.Object
org.apache.hadoop.ozone.container.common.volume.CapacityVolumeChoosingPolicy
- All Implemented Interfaces:
VolumeChoosingPolicy
Volume choosing policy that randomly choose volume with remaining
space to satisfy the size constraints.
The Algorithm is as follows, Pick 2 random volumes from a given pool of volumeSet and then pick the volume with lower utilization. This leads to a higher probability of volume with lower utilization to be picked.
Same algorithm as the SCMContainerPlacementCapacity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchooseVolume(List<HddsVolume> volumes, long maxContainerSize) Choose a volume to place a container, given a list of volumes and the max container size sought for storage.
-
Constructor Details
-
CapacityVolumeChoosingPolicy
public CapacityVolumeChoosingPolicy()
-
-
Method Details
-
chooseVolume
Description copied from interface:VolumeChoosingPolicyChoose a volume to place a container, given a list of volumes and the max container size sought for storage. The implementations of this interface must be thread-safe.- Specified by:
chooseVolumein interfaceVolumeChoosingPolicy- Parameters:
volumes- - a list of available volumes.maxContainerSize- - the maximum size of the container for which a volume is sought.- Returns:
- the chosen volume.
- Throws:
IOException- when disks are unavailable or are full.
-