Class InMemoryAliasMapProtocolClientSideTranslatorPB
java.lang.Object
org.apache.hadoop.hdfs.protocolPB.InMemoryAliasMapProtocolClientSideTranslatorPB
- All Implemented Interfaces:
Closeable,AutoCloseable,InMemoryAliasMapProtocol
@Private
@Unstable
public class InMemoryAliasMapProtocolClientSideTranslatorPB
extends Object
implements InMemoryAliasMapProtocol, Closeable
This class is the client side translator to translate requests made to the
InMemoryAliasMapProtocol interface to the RPC server implementing
AliasMapProtocolPB.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol
InMemoryAliasMapProtocol.IterationResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Get the associated block pool id.static Collection<InMemoryAliasMapProtocol>init(org.apache.hadoop.conf.Configuration conf) 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.
-
Constructor Details
-
InMemoryAliasMapProtocolClientSideTranslatorPB
-
-
Method Details
-
init
-
list
public InMemoryAliasMapProtocol.IterationResult list(Optional<org.apache.hadoop.hdfs.protocol.Block> marker) throws IOException Description copied from interface:InMemoryAliasMapProtocolList 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.- Specified by:
listin interfaceInMemoryAliasMapProtocol- 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 public Optional<org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation> read(@Nonnull org.apache.hadoop.hdfs.protocol.Block block) throws IOException Description copied from interface:InMemoryAliasMapProtocolGets theProvidedStorageLocationassociated with the specified block.- Specified by:
readin interfaceInMemoryAliasMapProtocol- Parameters:
block- the block to lookup- Returns:
- the associated
ProvidedStorageLocation. - Throws:
IOException
-
write
public void write(@Nonnull org.apache.hadoop.hdfs.protocol.Block block, @Nonnull org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation) throws IOException Description copied from interface:InMemoryAliasMapProtocolStores the block and it's associatedProvidedStorageLocationin the alias map.- Specified by:
writein interfaceInMemoryAliasMapProtocol- Throws:
IOException
-
getBlockPoolId
Description copied from interface:InMemoryAliasMapProtocolGet the associated block pool id.- Specified by:
getBlockPoolIdin interfaceInMemoryAliasMapProtocol- Returns:
- the block pool id associated with the Namenode running the in-memory alias map.
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-