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:
    org.apache.hadoop.hdfs.server.datanode.fsdataset.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 and Description
    `FsVolumeReferences(List<S> curVolumes)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### FsVolumeReferences

          public FsVolumeReferences(List<S> curVolumes)

  - ### Method Detail

    - #### 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 `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

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