@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.StateChangeRequestInfo
versionID
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
IOException
public HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr, Configuration conf, SocketFactory socketFactory, int timeout) throws IOException
IOException
public void monitorHealth() throws IOException
HAServiceProtocol
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.monitorHealth
in interface HAServiceProtocol
HealthCheckFailedException
- 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
HAServiceProtocol
transitionToActive
in interface HAServiceProtocol
ServiceFailedException
- if transition from standby to active fails.AccessControlException
- if access is denied.IOException
- if other errors happenpublic void transitionToStandby(HAServiceProtocol.StateChangeRequestInfo reqInfo) throws IOException
HAServiceProtocol
transitionToStandby
in interface HAServiceProtocol
ServiceFailedException
- if transition from active to standby fails.AccessControlException
- if access is denied.IOException
- if other errors happenpublic HAServiceStatus getServiceStatus() throws IOException
HAServiceProtocol
HAServiceStatus
getServiceStatus
in interface HAServiceProtocol
AccessControlException
- if access is denied.IOException
- if other errors happenpublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public Object getUnderlyingProxyObject()
ProtocolTranslator
getUnderlyingProxyObject
in interface ProtocolTranslator
Copyright © 2013 Apache Software Foundation. All rights reserved.