Class SCMConnectionManager

java.lang.Object
org.apache.hadoop.ozone.container.common.statemachine.SCMConnectionManager
All Implemented Interfaces:
Closeable, AutoCloseable, SCMConnectionManagerMXBean

public class SCMConnectionManager extends Object implements Closeable, SCMConnectionManagerMXBean
SCMConnectionManager - Acts as a class that manages the membership information of the SCMs that we are working with.
  • 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

      public void addSCMServer(InetSocketAddress address, String threadNamePrefix) throws IOException
      adds a new SCM machine to the target set.
      Parameters:
      address - - Address of the SCM machine to send heartbeat to.
      Throws:
      IOException
    • addReconServer

      public void addReconServer(InetSocketAddress address, String threadNamePrefix) throws IOException
      Adds a new Recon server to the set of endpoints.
      Parameters:
      address - Recon address.
      Throws:
      IOException
    • removeSCMServer

      public void removeSCMServer(InetSocketAddress address) throws IOException
      Removes a SCM machine for the target set.
      Parameters:
      address - - Address of the SCM machine to send heartbeat to.
      Throws:
      IOException
    • getValues

      public Collection<EndpointStateMachine> getValues()
      Returns all known RPCEndpoints.
      Returns:
      - List of RPC Endpoints.
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getSCMServers

      public List<EndpointStateMachineMBean> getSCMServers()
      Specified by:
      getSCMServers in interface SCMConnectionManagerMXBean