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 ClassesModifier and TypeInterfaceDescriptionstatic classThe result of a read from the in-memory aliasmap. -
Method Summary
Modifier and TypeMethodDescriptionGet the associated block pool id.List the next batch ofFileRegions in the alias map starting from the givenmarker.Optional<org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation>read(org.apache.hadoop.hdfs.protocol.Block block) Gets theProvidedStorageLocationassociated with the specified block.voidwrite(org.apache.hadoop.hdfs.protocol.Block block, org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation) Stores the block and it's associatedProvidedStorageLocationin the alias map.
-
Method Details
-
list
InMemoryAliasMapProtocol.IterationResult list(Optional<org.apache.hadoop.hdfs.protocol.Block> marker) throws IOException List the next batch ofFileRegions in the alias map starting from the givenmarker. To retrieve allFileRegions 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.IterationResultwith 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 theProvidedStorageLocationassociated 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 associatedProvidedStorageLocationin the alias map.- Parameters:
block-providedStorageLocation-- Throws:
IOException
-
getBlockPoolId
Get the associated block pool id.- Returns:
- the block pool id associated with the Namenode running the in-memory alias map.
- Throws:
IOException
-