|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface ActiveStandbyElector.ActiveStandbyElectorCallback
Callback interface to interact with the ActiveStandbyElector object.
The application will be notified with a callback only on state changes
(i.e. there will never be successive calls to becomeActive without an
intermediate call to enterNeutralMode).
The callbacks will be running on Zookeeper client library threads. The
application should return from these callbacks quickly so as not to impede
Zookeeper client library performance and notifications. The app will
typically remember the state change and return from the callback. It will
then proceed with implementing actions around that state change. It is
possible to be called back again while these actions are in flight and the
app should handle this scenario.
Method Summary | |
---|---|
void |
becomeActive()
This method is called when the app becomes the active leader. |
void |
becomeStandby()
This method is called when the app becomes a standby |
void |
enterNeutralMode()
If the elector gets disconnected from Zookeeper and does not know about the lock state, then it will notify the service via the enterNeutralMode interface. |
void |
fenceOldActive(byte[] oldActiveData)
If an old active has failed, rather than exited gracefully, then the new active may need to take some fencing actions against it before proceeding with failover. |
void |
notifyFatalError(String errorMessage)
If there is any fatal error (e.g. |
Method Detail |
---|
void becomeActive() throws ServiceFailedException
ServiceFailedException
void becomeStandby()
void enterNeutralMode()
void notifyFatalError(String errorMessage)
void fenceOldActive(byte[] oldActiveData)
oldActiveData
- the application data provided by the prior active
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |