HAServiceProtocolClientSideTranslatorPB (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.ha.protocolPB, class: HAServiceProtocolClientSideTranslatorPB

Package org.apache.hadoop.ha.protocolPB

# Class HAServiceProtocolClientSideTranslatorPB

java.lang.Object
org.apache.hadoop.ha.protocolPB.HAServiceProtocolClientSideTranslatorPB

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `HAServiceProtocol`, `ProtocolTranslator`

@Private @Stable public class HAServiceProtocolClientSideTranslatorPB extends Object implements HAServiceProtocol, Closeable, ProtocolTranslator
This class is the client side translator to translate the requests made on `HAServiceProtocol` interfaces to the RPC server implementing `HAServiceProtocolPB`.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.hadoop.ha.HAServiceProtocol

  `HAServiceProtocol.HAServiceState, HAServiceProtocol.RequestSource, HAServiceProtocol.StateChangeRequestInfo`

- ## Field Summary

  ### Fields inherited from interface org.apache.hadoop.ha.HAServiceProtocol

  `versionID`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr, Configuration conf)`
  `HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr, Configuration conf, SocketFactory socketFactory, int timeout)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `HAServiceStatus`
  `getServiceStatus()`
  Return the current status of the service.
  `Object`
  `getUnderlyingProxyObject()`
  Return the proxy object underlying this protocol translator.
  `void`
  `monitorHealth()`
  Monitor the health of service.
  `void`
  `transitionToActive(HAServiceProtocol.StateChangeRequestInfo reqInfo)`
  Request service to transition to active state.
  `void`
  `transitionToObserver(HAServiceProtocol.StateChangeRequestInfo reqInfo)`
  Request service to transition to observer state.
  `void`
  `transitionToStandby(HAServiceProtocol.StateChangeRequestInfo reqInfo)`
  Request service to transition to standby state.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### HAServiceProtocolClientSideTranslatorPB

    public HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr, Configuration conf) throws IOException
    Throws:
      `IOException`

  - ### HAServiceProtocolClientSideTranslatorPB

    public HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr, Configuration conf, SocketFactory socketFactory, int timeout) throws IOException
    Throws:
      `IOException`

- ## Method Details

  - ### monitorHealth

    public void monitorHealth() throws IOException
    Description copied from interface: `HAServiceProtocol`
    Monitor the health of service. This periodically called by the HA frameworks to monitor the health of the service. Service is expected to perform checks to ensure it is functional. If the service is not healthy due to failure or partial failure, it is expected to throw `HealthCheckFailedException`. The definition of service not healthy is left to the service. Note that when health check of an Active service fails, failover to standby may be done.
    Specified by:
      `monitorHealth` in interface `HAServiceProtocol`
    Throws:
      `HealthCheckFailedException` - if the health check of a service fails.
      `AccessControlException` - if access is denied.
      `IOException` - if other errors happen

  - ### transitionToActive

    public void transitionToActive(HAServiceProtocol.StateChangeRequestInfo reqInfo) throws IOException
    Description copied from interface: `HAServiceProtocol`
    Request service to transition to active state. No operation, if the service is already in active state.
    Specified by:
      `transitionToActive` in interface `HAServiceProtocol`
    Parameters:
      `reqInfo` - reqInfo.
    Throws:
      `ServiceFailedException` - if transition from standby to active fails.
      `AccessControlException` - if access is denied.
      `IOException` - if other errors happen

  - ### transitionToStandby

    public void transitionToStandby(HAServiceProtocol.StateChangeRequestInfo reqInfo) throws IOException
    Description copied from interface: `HAServiceProtocol`
    Request service to transition to standby state. No operation, if the service is already in standby state.
    Specified by:
      `transitionToStandby` in interface `HAServiceProtocol`
    Parameters:
      `reqInfo` - reqInfo.
    Throws:
      `ServiceFailedException` - if transition from active to standby fails.
      `AccessControlException` - if access is denied.
      `IOException` - if other errors happen

  - ### transitionToObserver

    public void transitionToObserver(HAServiceProtocol.StateChangeRequestInfo reqInfo) throws IOException
    Description copied from interface: `HAServiceProtocol`
    Request service to transition to observer state. No operation, if the service is already in observer state.
    Specified by:
      `transitionToObserver` in interface `HAServiceProtocol`
    Parameters:
      `reqInfo` - reqInfo.
    Throws:
      `ServiceFailedException` - if transition from standby to observer fails.
      `AccessControlException` - if access is denied.
      `IOException` - if other errors happen

  - ### getServiceStatus

    public HAServiceStatus getServiceStatus() throws IOException
    Description copied from interface: `HAServiceProtocol`
    Return the current status of the service. The status indicates the current state (e.g ACTIVE/STANDBY) as well as some additional information.
    Specified by:
      `getServiceStatus` in interface `HAServiceProtocol`
    Returns:
      HAServiceStatus.
    Throws:
      `AccessControlException` - if access is denied.
      `IOException` - if other errors happen
    See Also:
      - `HAServiceStatus`

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`

  - ### getUnderlyingProxyObject

    public Object getUnderlyingProxyObject()
    Description copied from interface: `ProtocolTranslator`
    Return the proxy object underlying this protocol translator.
    Specified by:
      `getUnderlyingProxyObject` in interface `ProtocolTranslator`
    Returns:
      the proxy object underlying this protocol translator.