Package org.apache.hadoop.hdfs.protocol
Interface ClientDatanodeProtocol
- All Known Implementing Classes:
ClientDatanodeProtocolTranslatorPB
@Private
@Evolving
public interface ClientDatanodeProtocol
An client-datanode protocol for block recovery
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longUntil version 9, this class ClientDatanodeProtocol served as both the client interface to the DN AND the RPC protocol used to communicate with the NN. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelDiskBalancePlan(String planID) Cancel an executing plan.voiddeleteBlockPool(String bpid, boolean force) Delete the block pool directory.voidEvict clients that are writing to a datanode.longGet current value of the balancer bandwidth in bytes per second.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.Obtains datanode infoGets a run-time configuration value from running diskbalancer instance.org.apache.hadoop.conf.ReconfigurationTaskStatusGet the status of the previously issued reconfig task.longReturn the visible length of a replica.Get volume report of datanode.Get a list of allowed properties for reconfiguration.Gets the status of an executing diskbalancer Plan.voidRefresh the list of federated namenodes from updated configuration Adds new namenodes and stops the deleted namenodes.voidshutdownDatanode(boolean forUpgrade) Shuts down a datanode.voidAsynchronously reload configuration on disk and apply changes.voidsubmitDiskBalancerPlan(String planID, long planVersion, String planFile, String planData, boolean skipDateCheck) Submit a disk balancer plan for execution.voidtriggerBlockReport(BlockReportOptions options) Trigger a new block report.
-
Field Details
-
versionID
static final long versionIDUntil version 9, this class ClientDatanodeProtocol served as both the client interface to the DN AND the RPC protocol used to communicate with the NN. This class is used by both the DFSClient and the DN server side to insulate from the protocol serialization. If you are adding/changing DN's interface then you need to change both this class and ALSO related protocol buffer wire protocol definition in ClientDatanodeProtocol.proto. For more details on protocol buffer wire protocol, please see .../org/apache/hadoop/hdfs/protocolPB/overview.html The log of historical changes can be retrieved from the svn). 9: Added deleteBlockPool method 9 is the last version id when this class was used for protocols serialization. DO not update this version any further.- See Also:
-
-
Method Details
-
getReplicaVisibleLength
Return the visible length of a replica.- Throws:
IOException
-
refreshNamenodes
Refresh the list of federated namenodes from updated configuration Adds new namenodes and stops the deleted namenodes.- Throws:
IOException- on error
-
deleteBlockPool
Delete the block pool directory. If force is false it is deleted only if it is empty, otherwise it is deleted along with its contents.- Parameters:
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.- Throws:
IOException
-
getBlockLocalPathInfo
BlockLocalPathInfo getBlockLocalPathInfo(ExtendedBlock block, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> token) throws IOException Retrieves the path names of the block file and metadata file stored on the local file system. In order for this method to work, one of the following should be satisfied:- The client user must be configured at the datanode to be able to use this method.
- When security is enabled, kerberos authentication must be used to connect to the datanode.
- Parameters:
block- the specified block on the local datanodetoken- the block access token.- Returns:
- the BlockLocalPathInfo of a block
- Throws:
IOException- on error
-
shutdownDatanode
Shuts down a datanode.- Parameters:
forUpgrade- 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.- Throws:
IOException
-
evictWriters
Evict clients that are writing to a datanode.- Throws:
IOException
-
getDatanodeInfo
Obtains datanode info- Returns:
- software/config version and uptime of the datanode
- Throws:
IOException
-
startReconfiguration
Asynchronously reload configuration on disk and apply changes.- Throws:
IOException
-
getReconfigurationStatus
Get the status of the previously issued reconfig task.- Throws:
IOException- See Also:
-
ReconfigurationTaskStatus
-
listReconfigurableProperties
Get a list of allowed properties for reconfiguration.- Throws:
IOException
-
triggerBlockReport
Trigger a new block report.- Throws:
IOException
-
getBalancerBandwidth
Get current value of the balancer bandwidth in bytes per second.- Returns:
- balancer bandwidth
- Throws:
IOException
-
getVolumeReport
Get volume report of datanode.- Throws:
IOException
-
submitDiskBalancerPlan
void submitDiskBalancerPlan(String planID, long planVersion, String planFile, String planData, boolean skipDateCheck) throws IOException Submit a disk balancer plan for execution.- Throws:
IOException
-
cancelDiskBalancePlan
Cancel an executing plan.- Parameters:
planID- - A SHA-1 hash of the plan string.- Throws:
IOException
-
queryDiskBalancerPlan
Gets the status of an executing diskbalancer Plan.- Throws:
IOException
-
getDiskBalancerSetting
Gets a run-time configuration value from running diskbalancer instance. For example : Disk Balancer bandwidth of a running instance.- Parameters:
key- runtime configuration key- Returns:
- value of the key as a string.
- Throws:
IOException- - Throws if there is no such key
-