Class ClientDatanodeProtocolTranslatorPB
java.lang.Object
org.apache.hadoop.hdfs.protocolPB.ClientDatanodeProtocolTranslatorPB
- All Implemented Interfaces:
Closeable,AutoCloseable,ClientDatanodeProtocol,org.apache.hadoop.ipc.ProtocolMetaInterface,org.apache.hadoop.ipc.ProtocolTranslator
@Private
@Stable
public class ClientDatanodeProtocolTranslatorPB
extends Object
implements org.apache.hadoop.ipc.ProtocolMetaInterface, ClientDatanodeProtocol, org.apache.hadoop.ipc.ProtocolTranslator, Closeable
This class is the client side translator to translate the requests made on
ClientDatanodeProtocol interfaces to the RPC server implementing
ClientDatanodeProtocolPB.-
Field Summary
FieldsFields inherited from interface org.apache.hadoop.hdfs.protocol.ClientDatanodeProtocol
versionID -
Constructor Summary
ConstructorsConstructorDescriptionClientDatanodeProtocolTranslatorPB(InetSocketAddress addr, org.apache.hadoop.security.UserGroupInformation ticket, org.apache.hadoop.conf.Configuration conf, 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) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelDiskBalancePlan(String planID) Cancels an executing disk balancer plan.voidclose()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.booleanisMethodSupported(String methodName) 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) Submits a disk balancer plan to the datanode.voidtriggerBlockReport(BlockReportOptions options) Trigger a new block report.
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
ClientDatanodeProtocolTranslatorPB
public ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid, org.apache.hadoop.conf.Configuration conf, int socketTimeout, boolean connectToDnViaHostname, LocatedBlock locatedBlock) throws IOException - Throws:
IOException
-
ClientDatanodeProtocolTranslatorPB
public ClientDatanodeProtocolTranslatorPB(InetSocketAddress addr, org.apache.hadoop.security.UserGroupInformation ticket, org.apache.hadoop.conf.Configuration conf, SocketFactory factory) throws IOException - Throws:
IOException
-
ClientDatanodeProtocolTranslatorPB
public ClientDatanodeProtocolTranslatorPB(DatanodeID datanodeid, org.apache.hadoop.conf.Configuration conf, int socketTimeout, boolean connectToDnViaHostname) throws IOException Constructor.- Parameters:
datanodeid- Datanode to connect to.conf- Configuration.socketTimeout- Socket timeout to use.connectToDnViaHostname- connect to the Datanode using its hostname- Throws:
IOException
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getReplicaVisibleLength
Description copied from interface:ClientDatanodeProtocolReturn the visible length of a replica.- Specified by:
getReplicaVisibleLengthin interfaceClientDatanodeProtocol- Throws:
IOException
-
refreshNamenodes
Description copied from interface:ClientDatanodeProtocolRefresh the list of federated namenodes from updated configuration Adds new namenodes and stops the deleted namenodes.- Specified by:
refreshNamenodesin interfaceClientDatanodeProtocol- Throws:
IOException- on error
-
deleteBlockPool
Description copied from interface:ClientDatanodeProtocolDelete the block pool directory. If force is false it is deleted only if it is empty, otherwise it is deleted along with its contents.- Specified by:
deleteBlockPoolin interfaceClientDatanodeProtocol- 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
public BlockLocalPathInfo getBlockLocalPathInfo(ExtendedBlock block, org.apache.hadoop.security.token.Token<BlockTokenIdentifier> token) throws IOException Description copied from interface:ClientDatanodeProtocolRetrieves 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.
- Specified by:
getBlockLocalPathInfoin interfaceClientDatanodeProtocol- Parameters:
block- the specified block on the local datanodetoken- the block access token.- Returns:
- the BlockLocalPathInfo of a block
- Throws:
IOException- on error
-
isMethodSupported
- Specified by:
isMethodSupportedin interfaceorg.apache.hadoop.ipc.ProtocolMetaInterface- Throws:
IOException
-
getUnderlyingProxyObject
- Specified by:
getUnderlyingProxyObjectin interfaceorg.apache.hadoop.ipc.ProtocolTranslator
-
shutdownDatanode
Description copied from interface:ClientDatanodeProtocolShuts down a datanode.- Specified by:
shutdownDatanodein interfaceClientDatanodeProtocol- 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
Description copied from interface:ClientDatanodeProtocolEvict clients that are writing to a datanode.- Specified by:
evictWritersin interfaceClientDatanodeProtocol- Throws:
IOException
-
getDatanodeInfo
Description copied from interface:ClientDatanodeProtocolObtains datanode info- Specified by:
getDatanodeInfoin interfaceClientDatanodeProtocol- Returns:
- software/config version and uptime of the datanode
- Throws:
IOException
-
startReconfiguration
Description copied from interface:ClientDatanodeProtocolAsynchronously reload configuration on disk and apply changes.- Specified by:
startReconfigurationin interfaceClientDatanodeProtocol- Throws:
IOException
-
getReconfigurationStatus
public org.apache.hadoop.conf.ReconfigurationTaskStatus getReconfigurationStatus() throws IOExceptionDescription copied from interface:ClientDatanodeProtocolGet the status of the previously issued reconfig task.- Specified by:
getReconfigurationStatusin interfaceClientDatanodeProtocol- Throws:
IOException- See Also:
-
ReconfigurationTaskStatus
-
listReconfigurableProperties
Description copied from interface:ClientDatanodeProtocolGet a list of allowed properties for reconfiguration.- Specified by:
listReconfigurablePropertiesin interfaceClientDatanodeProtocol- Throws:
IOException
-
triggerBlockReport
Description copied from interface:ClientDatanodeProtocolTrigger a new block report.- Specified by:
triggerBlockReportin interfaceClientDatanodeProtocol- Throws:
IOException
-
getBalancerBandwidth
Description copied from interface:ClientDatanodeProtocolGet current value of the balancer bandwidth in bytes per second.- Specified by:
getBalancerBandwidthin interfaceClientDatanodeProtocol- Returns:
- balancer bandwidth
- Throws:
IOException
-
submitDiskBalancerPlan
public void submitDiskBalancerPlan(String planID, long planVersion, String planFile, String planData, boolean skipDateCheck) throws IOException Submits a disk balancer plan to the datanode.- Specified by:
submitDiskBalancerPlanin interfaceClientDatanodeProtocol- Parameters:
planID- - 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.- Throws:
IOException
-
cancelDiskBalancePlan
Cancels an executing disk balancer plan.- Specified by:
cancelDiskBalancePlanin interfaceClientDatanodeProtocol- Parameters:
planID- - A SHA-1 hash of the plan string.- Throws:
IOException- on error
-
queryDiskBalancerPlan
Gets the status of an executing diskbalancer Plan.- Specified by:
queryDiskBalancerPlanin interfaceClientDatanodeProtocol- Throws:
IOException
-
getDiskBalancerSetting
Description copied from interface:ClientDatanodeProtocolGets a run-time configuration value from running diskbalancer instance. For example : Disk Balancer bandwidth of a running instance.- Specified by:
getDiskBalancerSettingin interfaceClientDatanodeProtocol- Parameters:
key- runtime configuration key- Returns:
- value of the key as a string.
- Throws:
IOException- - Throws if there is no such key
-
getVolumeReport
Description copied from interface:ClientDatanodeProtocolGet volume report of datanode.- Specified by:
getVolumeReportin interfaceClientDatanodeProtocol- Throws:
IOException
-