Class RoundRobinVolumeChoosingPolicy

java.lang.Object
org.apache.hadoop.ozone.container.common.volume.RoundRobinVolumeChoosingPolicy
All Implemented Interfaces:
VolumeChoosingPolicy

public class RoundRobinVolumeChoosingPolicy extends Object implements VolumeChoosingPolicy
Choose volumes in round-robin order. The caller should synchronize access to the list of volumes.
  • Constructor Details

    • RoundRobinVolumeChoosingPolicy

      public RoundRobinVolumeChoosingPolicy()
  • Method Details

    • chooseVolume

      public HddsVolume chooseVolume(List<HddsVolume> volumes, long maxContainerSize) throws IOException
      Description copied from interface: VolumeChoosingPolicy
      Choose 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:
      chooseVolume in interface VolumeChoosingPolicy
      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.