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 
    The result of a read from the in-memory aliasmap.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the associated block pool id.
    list(Optional<org.apache.hadoop.hdfs.protocol.Block> marker)
    List the next batch of FileRegions 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 FileRegions in the alias map starting from the given marker. To retrieve all FileRegions 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