org.apache.hadoop.hdfs.server.datanode.fsdataset

## Class RoundRobinVolumeChoosingPolicy<V extends FsVolumeSpi>

- java.lang.Object
- - org.apache.hadoop.hdfs.server.datanode.fsdataset.RoundRobinVolumeChoosingPolicy<V>

- All Implemented Interfaces:
    org.apache.hadoop.hdfs.server.datanode.fsdataset.VolumeChoosingPolicy<V>

      public class RoundRobinVolumeChoosingPolicy<V extends FsVolumeSpi>
      extends Object
      implements org.apache.hadoop.hdfs.server.datanode.fsdataset.VolumeChoosingPolicy<V>

  Choose volumes with the same storage type in round-robin order. Use fine-grained locks to synchronize volume choosing.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static org.slf4j.Logger` | `LOG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoundRobinVolumeChoosingPolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `chooseVolume(List<V> volumes, long blockSize, String storageId)` Choose a volume to place a replica, given a list of volumes and the replica size sought for storage.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOG

          public static final org.slf4j.Logger LOG

  - ### Constructor Detail

    - #### RoundRobinVolumeChoosingPolicy

          public RoundRobinVolumeChoosingPolicy()

  - ### Method Detail

    - #### chooseVolume

          public V chooseVolume(List<V> volumes,
                                long blockSize,
                                String storageId)
                         throws IOException

      Description copied from interface: `org.apache.hadoop.hdfs.server.datanode.fsdataset.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 `org.apache.hadoop.hdfs.server.datanode.fsdataset.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.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.