@InterfaceAudience.Private @InterfaceStability.Stable public class ClientDatanodeProtocolTranslatorPB extends Object implements ProtocolMetaInterface, ClientDatanodeProtocol, ProtocolTranslator, Closeable
ClientDatanodeProtocol interfaces to the RPC server implementing
ClientDatanodeProtocolPB.| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOG |
versionID| Constructor and Description |
|---|
ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid,
Configuration conf,
int socketTimeout,
boolean connectToDnViaHostname)
Constructor.
|
ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid,
Configuration conf,
int socketTimeout,
boolean connectToDnViaHostname,
LocatedBlock locatedBlock) |
ClientDatanodeProtocolTranslatorPB(InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
SocketFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
deleteBlockPool(String bpid,
boolean force)
Delete the block pool directory.
|
BlockLocalPathInfo |
getBlockLocalPathInfo(ExtendedBlock block,
Token<BlockTokenIdentifier> token)
Retrieves the path names of the block file and metadata file stored on the
local file system.
|
HdfsBlocksMetadata |
getHdfsBlocksMetadata(List<ExtendedBlock> blocks,
List<Token<BlockTokenIdentifier>> tokens)
Retrieves volume location information about a list of blocks on a datanode.
|
long |
getReplicaVisibleLength(ExtendedBlock b)
Return the visible length of a replica.
|
Object |
getUnderlyingProxyObject()
Return the proxy object underlying this protocol translator.
|
boolean |
isMethodSupported(String methodName)
Checks whether the given method name is supported by the server.
|
void |
refreshNamenodes()
Refresh the list of federated namenodes from updated configuration
Adds new namenodes and stops the deleted namenodes.
|
public ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid, Configuration conf, int socketTimeout, boolean connectToDnViaHostname, LocatedBlock locatedBlock) throws IOException
IOExceptionpublic ClientDatanodeProtocolTranslatorPB(InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory) throws IOException
IOExceptionpublic ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid, Configuration conf, int socketTimeout, boolean connectToDnViaHostname) throws IOException
datanodeid - Datanode to connect to.conf - Configuration.socketTimeout - Socket timeout to use.connectToDnViaHostname - connect to the Datanode using its hostnameIOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic long getReplicaVisibleLength(ExtendedBlock b) throws IOException
ClientDatanodeProtocolgetReplicaVisibleLength in interface ClientDatanodeProtocolIOExceptionpublic void refreshNamenodes()
throws IOException
ClientDatanodeProtocolrefreshNamenodes in interface ClientDatanodeProtocolIOException - on errorpublic void deleteBlockPool(String bpid, boolean force) throws IOException
ClientDatanodeProtocoldeleteBlockPool in interface ClientDatanodeProtocolbpid - Blockpool id to be deleted.force - If false blockpool directory is deleted only if it is empty
i.e. if it doesn't contain any block files, otherwise it is
deleted along with its contents.IOExceptionpublic BlockLocalPathInfo getBlockLocalPathInfo(ExtendedBlock block, Token<BlockTokenIdentifier> token) throws IOException
ClientDatanodeProtocolgetBlockLocalPathInfo in interface ClientDatanodeProtocolblock - the specified block on the local datanodetoken - the block access token.IOException - on errorpublic boolean isMethodSupported(String methodName) throws IOException
ProtocolMetaInterfaceisMethodSupported in interface ProtocolMetaInterfacemethodName - The name of the methodIOExceptionpublic Object getUnderlyingProxyObject()
ProtocolTranslatorgetUnderlyingProxyObject in interface ProtocolTranslatorpublic HdfsBlocksMetadata getHdfsBlocksMetadata(List<ExtendedBlock> blocks, List<Token<BlockTokenIdentifier>> tokens) throws IOException
ClientDatanodeProtocolVolumeId for each configured
data directory, which is not guaranteed to be the same across DN restarts.getHdfsBlocksMetadata in interface ClientDatanodeProtocolblocks - list of blocks on the local datanodetokens - block access tokens corresponding to the requested blocksExtendedBlocks with
data directoriesIOException - if datanode is unreachable, or replica is not found on datanodeCopyright © 2013 Apache Software Foundation. All rights reserved.