FsDatasetSpi.FsVolumeReferences (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.datanode.fsdataset, interface: FsDatasetSpi, class: FsVolumeReferences

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

# Class FsDatasetSpi.FsVolumeReferences

java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi.FsVolumeReferences

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Iterable<FsVolumeSpi>`

Enclosing interface:
  FsDatasetSpi<V extends FsVolumeSpi>

public static class FsDatasetSpi.FsVolumeReferences extends Object implements Iterable<FsVolumeSpi>, Closeable
It behaviors as an unmodifiable list of FsVolume. Individual FsVolume can be obtained by using `get(int)`. This also holds the reference counts for these volumes. It releases all the reference counts in `close()`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FsVolumeReferences(List<S> curVolumes)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `FsVolumeSpi`
  `get(int index)`
  Get the volume for a given index.
  `FsVolumeReference`
  `getReference(int index)`
  Get the reference for a given index.
  `Iterator<FsVolumeSpi>`
  `iterator()`
  `int`
  `size()`
  Get the number of volumes.

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

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

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### FsVolumeReferences

    public FsVolumeReferences(List<S> curVolumes)

- ## Method Details

  - ### iterator

    public Iterator<FsVolumeSpi> iterator()
    Specified by:
      `iterator` in interface `Iterable<FsVolumeSpi>`

  - ### size

    public int size()
    Get the number of volumes.

  - ### get

    public FsVolumeSpi get(int index)
    Get the volume for a given index.

  - ### getReference

    public FsVolumeReference getReference(int index)
    Get the reference for a given index.

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Throws:
      `IOException`