@InterfaceAudience.Public @InterfaceStability.Unstable public class InMemoryAliasMap extends Object implements org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol, Configurable
| Modifier and Type | Method and Description | 
|---|---|
void | 
close()  | 
static void | 
completeBootstrapTransfer(File aliasMap)
Extract the aliasmap archive to complete the bootstrap process. 
 | 
static org.apache.hadoop.hdfs.protocol.Block | 
fromBlockBytes(byte[] blockDbFormat)  | 
static org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation | 
fromProvidedStorageLocationBytes(byte[] providedStorageLocationDbFormat)  | 
String | 
getBlockPoolId()
Get the associated block pool id. 
 | 
Configuration | 
getConf()
Return the configuration used by this object. 
 | 
static InMemoryAliasMap | 
init(Configuration conf,
    String blockPoolID)  | 
org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol.IterationResult | 
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 | 
setConf(Configuration conf)
Set the configuration to be used by this object. 
 | 
static byte[] | 
toProtoBufBytes(org.apache.hadoop.hdfs.protocol.Block block)  | 
static byte[] | 
toProtoBufBytes(org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation)  | 
static void | 
transferForBootstrap(javax.servlet.http.HttpServletResponse response,
                    Configuration conf,
                    InMemoryAliasMap aliasMap)
Transfer this aliasmap for bootstrapping standby Namenodes. 
 | 
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. | 
public void setConf(Configuration conf)
ConfigurablesetConf in interface Configurableconf - configuration to be usedpublic Configuration getConf()
ConfigurablegetConf in interface Configurable@Nonnull public static InMemoryAliasMap init(Configuration conf, String blockPoolID) throws IOException
IOExceptionpublic org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol.IterationResult list(Optional<org.apache.hadoop.hdfs.protocol.Block> marker) throws IOException
org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocolFileRegions 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.list in interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocolmarker - the next block to get fileregions from.InMemoryAliasMapProtocol.IterationResult with a set of
 FileRegions and the next marker.IOException@Nonnull public Optional<org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation> read(@Nonnull org.apache.hadoop.hdfs.protocol.Block block) throws IOException
org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocolProvidedStorageLocation associated with the
 specified block.read in interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocolblock - the block to lookupProvidedStorageLocation.IOExceptionpublic void write(@Nonnull org.apache.hadoop.hdfs.protocol.Block block, @Nonnull org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation) throws IOException
org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocolProvidedStorageLocation
 in the alias map.write in interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocolIOExceptionpublic String getBlockPoolId()
org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocolgetBlockPoolId in interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocolpublic void close()
           throws IOException
IOException@Nonnull public static org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation fromProvidedStorageLocationBytes(@Nonnull byte[] providedStorageLocationDbFormat) throws org.apache.hadoop.thirdparty.protobuf.InvalidProtocolBufferException
org.apache.hadoop.thirdparty.protobuf.InvalidProtocolBufferException@Nonnull public static org.apache.hadoop.hdfs.protocol.Block fromBlockBytes(@Nonnull byte[] blockDbFormat) throws org.apache.hadoop.thirdparty.protobuf.InvalidProtocolBufferException
org.apache.hadoop.thirdparty.protobuf.InvalidProtocolBufferExceptionpublic static byte[] toProtoBufBytes(@Nonnull org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation) throws IOException
IOExceptionpublic static byte[] toProtoBufBytes(@Nonnull org.apache.hadoop.hdfs.protocol.Block block) throws IOException
IOExceptionpublic static void transferForBootstrap(javax.servlet.http.HttpServletResponse response,
                                        Configuration conf,
                                        InMemoryAliasMap aliasMap)
                                 throws IOException
response - http response.conf - configuration to use.aliasMap - aliasmap to transfer.IOExceptionpublic static void completeBootstrapTransfer(File aliasMap) throws IOException
aliasMap - location of the aliasmap.IOExceptionCopyright © 2023 Apache Software Foundation. All rights reserved.