org.apache.hadoop.hdfs.server.common.blockaliasmap.impl

## Class TextFileRegionAliasMap.TextReader

- java.lang.Object
- - org.apache.hadoop.hdfs.server.common.blockaliasmap.BlockAliasMap.Reader<FileRegion>
  - - org.apache.hadoop.hdfs.server.common.blockaliasmap.impl.TextFileRegionAliasMap.TextReader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Iterable<FileRegion>
  Enclosing class:
    TextFileRegionAliasMap

      public static class TextFileRegionAliasMap.TextReader
      extends BlockAliasMap.Reader<FileRegion>

  This class is used as a reader for block maps which are stored as delimited text files.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `TextFileRegionAliasMap.TextReader.Options` Options for `TextFileRegionAliasMap.TextReader`.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TextReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, org.apache.hadoop.io.compress.CompressionCodec codec, String delim)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `InputStream` | `createStream()`
    `static TextFileRegionAliasMap.ReaderOptions` | `defaults()`
    `Iterator<FileRegion>` | `iterator()`
    `Optional<FileRegion>` | `resolve(org.apache.hadoop.hdfs.protocol.Block ident)`

    - ### 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

    - #### TextReader

          protected TextReader(org.apache.hadoop.fs.FileSystem fs,
                               org.apache.hadoop.fs.Path file,
                               org.apache.hadoop.io.compress.CompressionCodec codec,
                               String delim)

  - ### Method Detail

    - #### defaults

          public static TextFileRegionAliasMap.ReaderOptions defaults()

    - #### resolve

          public Optional<FileRegion> resolve(org.apache.hadoop.hdfs.protocol.Block ident)
                                       throws IOException

      Specified by:
        `resolve` in class `BlockAliasMap.Reader<FileRegion>`
      Parameters:
        `ident` - block to resolve
      Returns:
        BlockAlias corresponding to the provided block.
      Throws:
        `IOException`

    - #### createStream

          public InputStream createStream()
                                   throws IOException

      Throws:
        `IOException`

    - #### iterator

          public Iterator<FileRegion> iterator()

    - #### close

          public void close()
                     throws IOException

      Throws:
        `IOException`

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