Class SCMConnectionManager
java.lang.Object
org.apache.hadoop.ozone.container.common.statemachine.SCMConnectionManager
- All Implemented Interfaces:
Closeable,AutoCloseable,SCMConnectionManagerMXBean
SCMConnectionManager - Acts as a class that manages the membership
information of the SCMs that we are working with.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReconServer(InetSocketAddress address, String threadNamePrefix) Adds a new Recon server to the set of endpoints.voidaddSCMServer(InetSocketAddress address, String threadNamePrefix) adds a new SCM machine to the target set.voidclose()org.apache.hadoop.hdds.conf.ConfigurationSourcegetConf()Returns Config.intGet RpcTimeout.Returns all known RPCEndpoints.voidreadLock()Takes a read lock.voidReleases the read lock.voidremoveSCMServer(InetSocketAddress address) Removes a SCM machine for the target set.voidTakes the write lock.voidReleases the write lock.
-
Constructor Details
-
SCMConnectionManager
public SCMConnectionManager(org.apache.hadoop.hdds.conf.ConfigurationSource conf)
-
-
Method Details
-
getConf
public org.apache.hadoop.hdds.conf.ConfigurationSource getConf()Returns Config.- Returns:
- ozoneConfig.
-
getRpcTimeout
public int getRpcTimeout()Get RpcTimeout.- Returns:
- - Return RPC timeout.
-
readLock
public void readLock()Takes a read lock. -
readUnlock
public void readUnlock()Releases the read lock. -
writeLock
public void writeLock()Takes the write lock. -
writeUnlock
public void writeUnlock()Releases the write lock. -
addSCMServer
adds a new SCM machine to the target set.- Parameters:
address- - Address of the SCM machine to send heartbeat to.- Throws:
IOException
-
addReconServer
Adds a new Recon server to the set of endpoints.- Parameters:
address- Recon address.- Throws:
IOException
-
removeSCMServer
Removes a SCM machine for the target set.- Parameters:
address- - Address of the SCM machine to send heartbeat to.- Throws:
IOException
-
getValues
Returns all known RPCEndpoints.- Returns:
- - List of RPC Endpoints.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getSCMServers
- Specified by:
getSCMServersin interfaceSCMConnectionManagerMXBean
-