Class InMemoryLevelDBAliasMapServer
java.lang.Object
org.apache.hadoop.hdfs.server.aliasmap.InMemoryLevelDBAliasMapServer
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.conf.Configurable,InMemoryAliasMapProtocol
@Private
@Unstable
public class InMemoryLevelDBAliasMapServer
extends Object
implements InMemoryAliasMapProtocol, org.apache.hadoop.conf.Configurable, Closeable
InMemoryLevelDBAliasMapServer is the entry point from the Namenode into
the
InMemoryAliasMap.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol
InMemoryAliasMapProtocol.IterationResult -
Constructor Summary
ConstructorsConstructorDescriptionInMemoryLevelDBAliasMapServer(InMemoryAliasMap.CheckedFunction2<org.apache.hadoop.conf.Configuration, String, InMemoryAliasMap> initFun, String blockPoolId) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Get theInMemoryAliasMapused by this server.Get the associated block pool id.org.apache.hadoop.conf.ConfigurationgetConf()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.voidsetConf(org.apache.hadoop.conf.Configuration conf) voidstart()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
-
InMemoryLevelDBAliasMapServer
public InMemoryLevelDBAliasMapServer(InMemoryAliasMap.CheckedFunction2<org.apache.hadoop.conf.Configuration, String, InMemoryAliasMap> initFun, String blockPoolId)
-
-
Method Details
-
start
- Throws:
IOException
-
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.
-
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf) - Specified by:
setConfin interfaceorg.apache.hadoop.conf.Configurable
-
getConf
public org.apache.hadoop.conf.Configuration getConf()- Specified by:
getConfin interfaceorg.apache.hadoop.conf.Configurable
-
getAliasMap
Get theInMemoryAliasMapused by this server.- Returns:
- the inmemoryaliasmap used.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-