@InterfaceAudience.Private @InterfaceStability.Stable public class HAServiceProtocolClientSideTranslatorPB extends Object implements HAServiceProtocol, Closeable, ProtocolTranslator
HAServiceProtocol interfaces to the RPC server implementing
HAServiceProtocolPB.HAServiceProtocol.HAServiceState, HAServiceProtocol.RequestSource, HAServiceProtocol.StateChangeRequestInfoversionID| Constructor and Description |
|---|
HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr,
Configuration conf) |
HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr,
Configuration conf,
SocketFactory socketFactory,
int timeout) |
| Modifier and Type | Method and 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 |
transitionToStandby(HAServiceProtocol.StateChangeRequestInfo reqInfo)
Request service to transition to standby state.
|
public HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr, Configuration conf) throws IOException
IOExceptionpublic HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr, Configuration conf, SocketFactory socketFactory, int timeout) throws IOException
IOExceptionpublic void monitorHealth()
throws IOException
HAServiceProtocolHealthCheckFailedException.
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.monitorHealth in interface HAServiceProtocolHealthCheckFailedException - if the health check of a service fails.AccessControlException - if access is denied.IOException - if other errors happenpublic void transitionToActive(HAServiceProtocol.StateChangeRequestInfo reqInfo) throws IOException
HAServiceProtocoltransitionToActive in interface HAServiceProtocolServiceFailedException - if transition from standby to active fails.AccessControlException - if access is denied.IOException - if other errors happenpublic void transitionToStandby(HAServiceProtocol.StateChangeRequestInfo reqInfo) throws IOException
HAServiceProtocoltransitionToStandby in interface HAServiceProtocolServiceFailedException - if transition from active to standby fails.AccessControlException - if access is denied.IOException - if other errors happenpublic HAServiceStatus getServiceStatus() throws IOException
HAServiceProtocolHAServiceStatusgetServiceStatus in interface HAServiceProtocolAccessControlException - if access is denied.IOException - if other errors happenpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic Object getUnderlyingProxyObject()
ProtocolTranslatorgetUnderlyingProxyObject in interface ProtocolTranslatorCopyright © 2013 Apache Software Foundation. All rights reserved.