org.apache.hadoop.ha.protocolPB
Class ZKFCProtocolClientSideTranslatorPB
java.lang.Object
org.apache.hadoop.ha.protocolPB.ZKFCProtocolClientSideTranslatorPB
- All Implemented Interfaces:
- Closeable, org.apache.hadoop.ha.ZKFCProtocol, org.apache.hadoop.ipc.ProtocolTranslator
public class ZKFCProtocolClientSideTranslatorPB
- extends Object
- implements org.apache.hadoop.ha.ZKFCProtocol, Closeable, org.apache.hadoop.ipc.ProtocolTranslator
Fields inherited from interface org.apache.hadoop.ha.ZKFCProtocol |
versionID |
Method Summary |
void |
cedeActive(int millisToCede)
Request that this service yield from the active node election for the
specified time period. |
void |
close()
|
Object |
getUnderlyingProxyObject()
Return the proxy object underlying this protocol translator. |
void |
gracefulFailover()
Request that this node try to become active through a graceful failover. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZKFCProtocolClientSideTranslatorPB
public ZKFCProtocolClientSideTranslatorPB(InetSocketAddress addr,
Configuration conf,
SocketFactory socketFactory,
int timeout)
throws IOException
- Throws:
IOException
cedeActive
public void cedeActive(int millisToCede)
throws IOException,
org.apache.hadoop.security.AccessControlException
- Description copied from interface:
org.apache.hadoop.ha.ZKFCProtocol
- Request that this service yield from the active node election for the
specified time period.
If the node is not currently active, it simply prevents any attempts
to become active for the specified time period. Otherwise, it first
tries to transition the local service to standby state, and then quits
the election.
If the attempt to transition to standby succeeds, then the ZKFC receiving
this RPC will delete its own breadcrumb node in ZooKeeper. Thus, the
next node to become active will not run any fencing process. Otherwise,
the breadcrumb will be left, such that the next active will fence this
node.
After the specified time period elapses, the node will attempt to re-join
the election, provided that its service is healthy.
If the node has previously been instructed to cede active, and is still
within the specified time period, the later command's time period will
take precedence, resetting the timer.
A call to cedeActive which specifies a 0 or negative time period will
allow the target node to immediately rejoin the election, so long as
it is healthy.
- Specified by:
cedeActive
in interface org.apache.hadoop.ha.ZKFCProtocol
- Parameters:
millisToCede
- period for which the node should not attempt to
become active
- Throws:
IOException
- if the operation fails
org.apache.hadoop.security.AccessControlException
- if the operation is disallowed
gracefulFailover
public void gracefulFailover()
throws IOException,
org.apache.hadoop.security.AccessControlException
- Description copied from interface:
org.apache.hadoop.ha.ZKFCProtocol
- Request that this node try to become active through a graceful failover.
If the node is already active, this is a no-op and simply returns success
without taking any further action.
If the node is not healthy, it will throw an exception indicating that it
is not able to become active.
If the node is healthy and not active, it will try to initiate a graceful
failover to become active, returning only when it has successfully become
active. See
ZKFailoverController.gracefulFailoverToYou()
for the
implementation details.
If the node fails to successfully coordinate the failover, throws an
exception indicating the reason for failure.
- Specified by:
gracefulFailover
in interface org.apache.hadoop.ha.ZKFCProtocol
- Throws:
IOException
- if graceful failover fails
org.apache.hadoop.security.AccessControlException
- if the operation is disallowed
close
public void close()
- Specified by:
close
in interface Closeable
getUnderlyingProxyObject
public Object getUnderlyingProxyObject()
- Description copied from interface:
org.apache.hadoop.ipc.ProtocolTranslator
- Return the proxy object underlying this protocol translator.
- Specified by:
getUnderlyingProxyObject
in interface org.apache.hadoop.ipc.ProtocolTranslator
- Returns:
- the proxy object underlying this protocol translator.
Copyright © 2013 Apache Software Foundation. All Rights Reserved.