@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
IOException
public ClientDatanodeProtocolTranslatorPB(InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory) throws IOException
IOException
public 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 hostnameIOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public long getReplicaVisibleLength(ExtendedBlock b) throws IOException
ClientDatanodeProtocol
getReplicaVisibleLength
in interface ClientDatanodeProtocol
IOException
public void refreshNamenodes() throws IOException
ClientDatanodeProtocol
refreshNamenodes
in interface ClientDatanodeProtocol
IOException
- on errorpublic void deleteBlockPool(String bpid, boolean force) throws IOException
ClientDatanodeProtocol
deleteBlockPool
in interface ClientDatanodeProtocol
bpid
- 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.IOException
public BlockLocalPathInfo getBlockLocalPathInfo(ExtendedBlock block, Token<BlockTokenIdentifier> token) throws IOException
ClientDatanodeProtocol
getBlockLocalPathInfo
in interface ClientDatanodeProtocol
block
- the specified block on the local datanodetoken
- the block access token.IOException
- on errorpublic boolean isMethodSupported(String methodName) throws IOException
ProtocolMetaInterface
isMethodSupported
in interface ProtocolMetaInterface
methodName
- The name of the methodIOException
public Object getUnderlyingProxyObject()
ProtocolTranslator
getUnderlyingProxyObject
in interface ProtocolTranslator
public HdfsBlocksMetadata getHdfsBlocksMetadata(List<ExtendedBlock> blocks, List<Token<BlockTokenIdentifier>> tokens) throws IOException
ClientDatanodeProtocol
VolumeId
for each configured
data directory, which is not guaranteed to be the same across DN restarts.getHdfsBlocksMetadata
in interface ClientDatanodeProtocol
blocks
- list of blocks on the local datanodetokens
- block access tokens corresponding to the requested blocksExtendedBlock
s with
data directoriesIOException
- if datanode is unreachable, or replica is not found on datanodeCopyright © 2013 Apache Software Foundation. All rights reserved.