InMemoryAliasMapProtocol (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.aliasmap, interface: InMemoryAliasMapProtocol

Package org.apache.hadoop.hdfs.server.aliasmap

# Interface InMemoryAliasMapProtocol

All Known Implementing Classes:
  `InMemoryAliasMap`, `InMemoryAliasMapProtocolClientSideTranslatorPB`, `InMemoryLevelDBAliasMapServer`

@Private @Unstable public interface InMemoryAliasMapProtocol
Protocol used by clients to read/write data about aliases of provided blocks for an in-memory implementation of the `BlockAliasMap`.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static class`
  `InMemoryAliasMapProtocol.IterationResult`
  The result of a read from the in-memory aliasmap.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getBlockPoolId()`
  Get the associated block pool id.
  `InMemoryAliasMapProtocol.IterationResult`
  `list(Optional<org.apache.hadoop.hdfs.protocol.Block> marker)`
  List the next batch of `FileRegion`s in the alias map starting from the given `marker`.
  `Optional<org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation>`
  `read(org.apache.hadoop.hdfs.protocol.Block block)`
  Gets the `ProvidedStorageLocation` associated with the specified block.
  `void`
  `write(org.apache.hadoop.hdfs.protocol.Block block, org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation)`
  Stores the block and it's associated `ProvidedStorageLocation` in the alias map.

- ## Method Details

  - ### list

    InMemoryAliasMapProtocol.IterationResult list(Optional<org.apache.hadoop.hdfs.protocol.Block> marker) throws IOException
    List the next batch of `FileRegion`s in the alias map starting from the given `marker`. To retrieve all `FileRegion`s stored in the alias map, multiple calls to this function might be required.
    Parameters:
      `marker` - the next block to get fileregions from.
    Returns:
      the `InMemoryAliasMapProtocol.IterationResult` with a set of FileRegions and the next marker.
    Throws:
      `IOException`

  - ### read

    @Nonnull Optional<org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation> read(@Nonnull org.apache.hadoop.hdfs.protocol.Block block) throws IOException
    Gets the `ProvidedStorageLocation` associated with the specified block.
    Parameters:
      `block` - the block to lookup
    Returns:
      the associated `ProvidedStorageLocation`.
    Throws:
      `IOException`

  - ### write

    void write(@Nonnull org.apache.hadoop.hdfs.protocol.Block block, @Nonnull org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation) throws IOException
    Stores the block and it's associated `ProvidedStorageLocation` in the alias map.
    Parameters:
      `block` -
      `providedStorageLocation` -
    Throws:
      `IOException`

  - ### getBlockPoolId

    String getBlockPoolId() throws IOException
    Get the associated block pool id.
    Returns:
      the block pool id associated with the Namenode running the in-memory alias map.
    Throws:
      `IOException`