public class PriorityElectionFilter extends Object implements IActiveElectionDecisionFilter
isAcceptable(ActiveElectionState.State,
List)
returns true. The final Primary space status will be acquired only if ActiveElectionState.State.ACTIVE will be accepted.
NOTE: The member with ISpaceState.STARTED
of State
or with lower order memberID in
fail-over group is acceptable to advance to aquireState
.
Modifier and Type | Class and Description |
---|---|
class |
PriorityElectionFilter.CandidateEntry
Comparable class to sort candidate members according the
State and order ID in the
cluster. |
Constructor and Description |
---|
PriorityElectionFilter(String memberName,
FailOverPolicy failOverPolicy)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ServiceItem service1,
ServiceItem service2) |
ICandidateEntry |
getCandidateEntry(ServiceItem service) |
boolean |
isAcceptable(ActiveElectionState.State aquireState,
List<ServiceItem> candidateSrv)
This method provides the condition to advance the manage member to
aquireState
state. |
public PriorityElectionFilter(String memberName, FailOverPolicy failOverPolicy)
memberName
- the cluster member name.failOverPolicy
- the fail over policy.public boolean isAcceptable(ActiveElectionState.State aquireState, List<ServiceItem> candidateSrv)
aquireState
state.isAcceptable
in interface IActiveElectionDecisionFilter
candidateSrv
- the candidates to aquire desired state.aquireState
- the state to aquire.true
if the manage member is acceptable to aquire desired
aquireState
state.public int compareTo(ServiceItem service1, ServiceItem service2)
compareTo
in interface IActiveElectionDecisionFilter
public ICandidateEntry getCandidateEntry(ServiceItem service)
getCandidateEntry
in interface IActiveElectionDecisionFilter
Copyright © GigaSpaces.