@InterfaceAudience.Public @InterfaceStability.Unstable public class InMemoryAliasMap extends Object implements org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol, org.apache.hadoop.conf.Configurable
Modifier and Type | Class and Description |
---|---|
static interface |
InMemoryAliasMap.CheckedFunction2<T1,T2,R>
CheckedFunction is akin to
Function but
specifies an IOException. |
InMemoryAliasMapProtocol.IterationResult
Modifier and Type | Method and Description |
---|---|
void |
close() |
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.
|
org.apache.hadoop.conf.Configuration |
getConf() |
static InMemoryAliasMap |
init(org.apache.hadoop.conf.Configuration conf,
String blockPoolID) |
InMemoryAliasMapProtocol.IterationResult |
list(Optional<org.apache.hadoop.hdfs.protocol.Block> marker)
List the next batch of
FileRegion s 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(org.apache.hadoop.conf.Configuration conf) |
static byte[] |
toProtoBufBytes(org.apache.hadoop.hdfs.protocol.Block block) |
static byte[] |
toProtoBufBytes(org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation) |
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(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
@Nonnull public static InMemoryAliasMap init(org.apache.hadoop.conf.Configuration conf, String blockPoolID) throws IOException
IOException
public InMemoryAliasMapProtocol.IterationResult list(Optional<org.apache.hadoop.hdfs.protocol.Block> marker) throws IOException
org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol
FileRegion
s in the alias map starting from
the given marker
. To retrieve all FileRegion
s stored in the
alias map, multiple calls to this function might be required.list
in interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol
marker
- 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.InMemoryAliasMapProtocol
ProvidedStorageLocation
associated with the
specified block.read
in interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol
block
- the block to lookupProvidedStorageLocation
.IOException
public 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.InMemoryAliasMapProtocol
ProvidedStorageLocation
in the alias map.write
in interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol
IOException
public String getBlockPoolId()
org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol
getBlockPoolId
in interface org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol
public void close() throws IOException
IOException
@Nonnull public static org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation fromProvidedStorageLocationBytes(@Nonnull byte[] providedStorageLocationDbFormat) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
@Nonnull public static org.apache.hadoop.hdfs.protocol.Block fromBlockBytes(@Nonnull byte[] blockDbFormat) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static byte[] toProtoBufBytes(@Nonnull org.apache.hadoop.hdfs.protocol.ProvidedStorageLocation providedStorageLocation) throws IOException
IOException
public static byte[] toProtoBufBytes(@Nonnull org.apache.hadoop.hdfs.protocol.Block block) throws IOException
IOException
Copyright © 2008–2021 Apache Software Foundation. All rights reserved.