java.io.Closeable, java.lang.AutoCloseable, ClientDatanodeProtocol, org.apache.hadoop.ipc.ProtocolMetaInterface, org.apache.hadoop.ipc.ProtocolTranslator@Private @Stable public class ClientDatanodeProtocolTranslatorPB extends java.lang.Object implements org.apache.hadoop.ipc.ProtocolMetaInterface, ClientDatanodeProtocol, org.apache.hadoop.ipc.ProtocolTranslator, java.io.Closeable
ClientDatanodeProtocol interfaces to the RPC server implementing
ClientDatanodeProtocolPB.| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
versionID| Constructor | Description |
|---|---|
ClientDatanodeProtocolTranslatorPB(java.net.InetSocketAddress addr,
org.apache.hadoop.security.UserGroupInformation ticket,
org.apache.hadoop.conf.Configuration conf,
javax.net.SocketFactory factory) |
|
ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid,
org.apache.hadoop.conf.Configuration conf,
int socketTimeout,
boolean connectToDnViaHostname) |
Constructor.
|
ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid,
org.apache.hadoop.conf.Configuration conf,
int socketTimeout,
boolean connectToDnViaHostname,
LocatedBlock locatedBlock) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
cancelDiskBalancePlan(java.lang.String planID) |
Cancels an executing disk balancer plan.
|
void |
close() |
|
void |
deleteBlockPool(java.lang.String bpid,
boolean force) |
Delete the block pool directory.
|
void |
evictWriters() |
Evict clients that are writing to a datanode.
|
long |
getBalancerBandwidth() |
Get current value of the balancer bandwidth in bytes per second.
|
BlockLocalPathInfo |
getBlockLocalPathInfo(ExtendedBlock block,
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> token) |
Retrieves the path names of the block file and metadata file stored on the
local file system.
|
DatanodeLocalInfo |
getDatanodeInfo() |
Obtains datanode info
|
java.lang.String |
getDiskBalancerSetting(java.lang.String key) |
Gets a run-time configuration value from running diskbalancer instance.
|
org.apache.hadoop.conf.ReconfigurationTaskStatus |
getReconfigurationStatus() |
Get the status of the previously issued reconfig task.
|
long |
getReplicaVisibleLength(ExtendedBlock b) |
Return the visible length of a replica.
|
java.lang.Object |
getUnderlyingProxyObject() |
|
java.util.List<DatanodeVolumeInfo> |
getVolumeReport() |
Get volume report of datanode.
|
boolean |
isMethodSupported(java.lang.String methodName) |
|
java.util.List<java.lang.String> |
listReconfigurableProperties() |
Get a list of allowed properties for reconfiguration.
|
DiskBalancerWorkStatus |
queryDiskBalancerPlan() |
Gets the status of an executing diskbalancer Plan.
|
void |
refreshNamenodes() |
Refresh the list of federated namenodes from updated configuration
Adds new namenodes and stops the deleted namenodes.
|
void |
shutdownDatanode(boolean forUpgrade) |
Shuts down a datanode.
|
void |
startReconfiguration() |
Asynchronously reload configuration on disk and apply changes.
|
void |
submitDiskBalancerPlan(java.lang.String planID,
long planVersion,
java.lang.String planFile,
java.lang.String planData,
boolean skipDateCheck) |
Submits a disk balancer plan to the datanode.
|
void |
triggerBlockReport(BlockReportOptions options) |
Trigger a new block report.
|
public ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid, org.apache.hadoop.conf.Configuration conf, int socketTimeout, boolean connectToDnViaHostname, LocatedBlock locatedBlock) throws java.io.IOException
java.io.IOExceptionpublic ClientDatanodeProtocolTranslatorPB(java.net.InetSocketAddress addr,
org.apache.hadoop.security.UserGroupInformation ticket,
org.apache.hadoop.conf.Configuration conf,
javax.net.SocketFactory factory)
throws java.io.IOException
java.io.IOExceptionpublic ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid, org.apache.hadoop.conf.Configuration conf, int socketTimeout, boolean connectToDnViaHostname) throws java.io.IOException
datanodeid - Datanode to connect to.conf - Configuration.socketTimeout - Socket timeout to use.connectToDnViaHostname - connect to the Datanode using its hostnamejava.io.IOExceptionpublic void close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablepublic long getReplicaVisibleLength(ExtendedBlock b) throws java.io.IOException
ClientDatanodeProtocolgetReplicaVisibleLength in interface ClientDatanodeProtocoljava.io.IOExceptionpublic void refreshNamenodes()
throws java.io.IOException
ClientDatanodeProtocolrefreshNamenodes in interface ClientDatanodeProtocoljava.io.IOException - on errorpublic void deleteBlockPool(java.lang.String bpid,
boolean force)
throws java.io.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.java.io.IOExceptionpublic BlockLocalPathInfo getBlockLocalPathInfo(ExtendedBlock block, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> token) throws java.io.IOException
ClientDatanodeProtocolgetBlockLocalPathInfo in interface ClientDatanodeProtocolblock - the specified block on the local datanodetoken - the block access token.java.io.IOException - on errorpublic boolean isMethodSupported(java.lang.String methodName)
throws java.io.IOException
isMethodSupported in interface org.apache.hadoop.ipc.ProtocolMetaInterfacejava.io.IOExceptionpublic java.lang.Object getUnderlyingProxyObject()
getUnderlyingProxyObject in interface org.apache.hadoop.ipc.ProtocolTranslatorpublic void shutdownDatanode(boolean forUpgrade)
throws java.io.IOException
ClientDatanodeProtocolshutdownDatanode in interface ClientDatanodeProtocolforUpgrade - If true, data node does extra prep work before shutting
down. The work includes advising clients to wait and saving
certain states for quick restart. This should only be used when
the stored data will remain the same during upgrade/restart.java.io.IOExceptionpublic void evictWriters()
throws java.io.IOException
ClientDatanodeProtocolevictWriters in interface ClientDatanodeProtocoljava.io.IOExceptionpublic DatanodeLocalInfo getDatanodeInfo() throws java.io.IOException
ClientDatanodeProtocolgetDatanodeInfo in interface ClientDatanodeProtocoljava.io.IOExceptionpublic void startReconfiguration()
throws java.io.IOException
ClientDatanodeProtocolstartReconfiguration in interface ClientDatanodeProtocoljava.io.IOExceptionpublic org.apache.hadoop.conf.ReconfigurationTaskStatus getReconfigurationStatus()
throws java.io.IOException
ClientDatanodeProtocolgetReconfigurationStatus in interface ClientDatanodeProtocoljava.io.IOExceptionReconfigurationTaskStatuspublic java.util.List<java.lang.String> listReconfigurableProperties()
throws java.io.IOException
ClientDatanodeProtocollistReconfigurableProperties in interface ClientDatanodeProtocoljava.io.IOExceptionpublic void triggerBlockReport(BlockReportOptions options) throws java.io.IOException
ClientDatanodeProtocoltriggerBlockReport in interface ClientDatanodeProtocoljava.io.IOExceptionpublic long getBalancerBandwidth()
throws java.io.IOException
ClientDatanodeProtocolgetBalancerBandwidth in interface ClientDatanodeProtocoljava.io.IOExceptionpublic void submitDiskBalancerPlan(java.lang.String planID,
long planVersion,
java.lang.String planFile,
java.lang.String planData,
boolean skipDateCheck)
throws java.io.IOException
submitDiskBalancerPlan in interface ClientDatanodeProtocolplanID - - Plan ID is the hash512 string of the plan that is
submitted. This is used by clients when they want to find
local copies of these plans.planVersion - - The data format of the plans - for future , not
used now.planFile - - Plan file nameplanData - - Actual plan data in json formatskipDateCheck - - Skips the date check.java.io.IOExceptionpublic void cancelDiskBalancePlan(java.lang.String planID)
throws java.io.IOException
cancelDiskBalancePlan in interface ClientDatanodeProtocolplanID - - A SHA-1 hash of the plan string.java.io.IOException - on errorpublic DiskBalancerWorkStatus queryDiskBalancerPlan() throws java.io.IOException
queryDiskBalancerPlan in interface ClientDatanodeProtocoljava.io.IOExceptionpublic java.lang.String getDiskBalancerSetting(java.lang.String key)
throws java.io.IOException
ClientDatanodeProtocolgetDiskBalancerSetting in interface ClientDatanodeProtocolkey - runtime configuration keyjava.io.IOException - - Throws if there is no such keypublic java.util.List<DatanodeVolumeInfo> getVolumeReport() throws java.io.IOException
ClientDatanodeProtocolgetVolumeReport in interface ClientDatanodeProtocoljava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.