public class LusBasedSelectorHandler extends LeaderSelectorHandler implements IActiveElectionListener
_lastError, _logger, _primarySpaceModeListeners, _space, _spaceMember, _spaceMode
Constructor and Description |
---|
LusBasedSelectorHandler(SpaceProxyImpl securedProxy) |
Modifier and Type | Method and Description |
---|---|
void |
forceMoveToPrimary()
Forcefully make this space to be primary
|
Throwable |
getLastError() |
String |
getPrimaryMemberName() |
void |
initialize(LeaderSelectorHandlerConfig config) |
boolean |
isPrimary() |
void |
onActive(ActiveElectionEvent theEvent)
Notification about new elected Active service.
|
void |
onExtraBackup(ActiveElectionEvent theEvent)
Notification that an extra-backup was resolved.
|
void |
onSplitBrain(ActiveElectionEvent theEvent)
Notification about split-brain.
|
void |
onSplitBrainActive(ActiveElectionEvent theEvent)
Notification that split-brain was resolved - current service remains primary.
|
void |
onSplitBrainBackup(ActiveElectionEvent theEvent)
Notification about a backup that it's primary has changed due to split-brain.
|
void |
select()
start the primary election manager
|
void |
setLastError(Throwable lastError) |
void |
terminate()
terminate the PrimarySpaceSelector
|
addListenerAndNotify, afterSpaceModeChange, beforeSpaceModeChange, compareAndRegister, dispatchBeforeEventToRemoteListeners, getSpaceMode, moveToBackup, moveToPrimary, moveToUnusable, removeListener, setSpaceMode
public LusBasedSelectorHandler(SpaceProxyImpl securedProxy)
public void initialize(LeaderSelectorHandlerConfig config) throws Exception
initialize
in class LeaderSelectorHandler
Exception
public boolean isPrimary()
isPrimary
in interface LeaderSelector
isPrimary
in class LeaderSelectorHandler
true
if the Space is primary, otherwise the space in backup mode.public String getPrimaryMemberName()
getPrimaryMemberName
in interface LeaderSelector
public void select() throws RemoteException
select
in interface LeaderSelector
RemoteException
public void onActive(ActiveElectionEvent theEvent)
IActiveElectionListener
onActive
in interface IActiveElectionListener
theEvent
- The election event with an Active service reference.IActiveElectionListener.onActive(ActiveElectionEvent)
public void onSplitBrain(ActiveElectionEvent theEvent)
IActiveElectionListener
onSplitBrain
in interface IActiveElectionListener
theEvent
- the active service (the new primary)IActiveElectionListener.onSplitBrain(ActiveElectionEvent)
public void onSplitBrainActive(ActiveElectionEvent theEvent)
IActiveElectionListener
onSplitBrainActive
in interface IActiveElectionListener
theEvent
- the active service (same as the current elected)public void onExtraBackup(ActiveElectionEvent theEvent)
IActiveElectionListener
onExtraBackup
in interface IActiveElectionListener
theEvent
- the active service used as reference for resolutionpublic void onSplitBrainBackup(ActiveElectionEvent theEvent)
IActiveElectionListener
onSplitBrainBackup
in interface IActiveElectionListener
theEvent
- the active service (the new primary)public void terminate()
terminate
in interface LeaderSelector
public void forceMoveToPrimary() throws RemoteException
forceMoveToPrimary
in class LeaderSelectorHandler
RemoteException
public Throwable getLastError()
getLastError
in interface LeaderSelector
getLastError
in class LeaderSelectorHandler
public void setLastError(Throwable lastError)
setLastError
in interface LeaderSelector
setLastError
in class LeaderSelectorHandler
Copyright © GigaSpaces.