Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.net
Class ConfigurableQuorumPolicy.ClusterQuorumPolicy

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.ConfigurableQuorumPolicy
          extended by com.tangosol.net.ConfigurableQuorumPolicy.ClusterQuorumPolicy

All Implemented Interfaces:
ActionPolicy
Enclosing class:
ConfigurableQuorumPolicy

public static class ConfigurableQuorumPolicy.ClusterQuorumPolicy
extends ConfigurableQuorumPolicy
implements ActionPolicy

ClusterQuorumPolicy defines an action policy that is applicable to the cluster.


Nested Class Summary

 

Nested classes/interfaces inherited from class com.tangosol.net.ConfigurableQuorumPolicy
ConfigurableQuorumPolicy.ClusterQuorumPolicy, ConfigurableQuorumPolicy.MembershipQuorumPolicy, ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy, ConfigurableQuorumPolicy.ProxyQuorumPolicy, ConfigurableQuorumPolicy.WrapperQuorumPolicy

 

Field Summary
protected  java.util.Map m_mapQuorumByRole
          The cluster membership quorum map, keyed by role name.
protected  Service m_service
          The cluster service.
static java.lang.String ROLE_ALL
          The role identifier to use for matching any cluster members.

 

Constructor Summary
protected ConfigurableQuorumPolicy.ClusterQuorumPolicy(java.util.Map mapQuorum)
          Construct a ClusterQuorumPolicy with the specified quorum map.

 

Method Summary
protected  boolean checkRoleQuorum(java.lang.String sRole, java.util.Set setMembers, java.util.Set setTimedOut, java.util.Set setHealthy, java.util.Set setAnnouncing)
          Check whether the cluster quorum for the specified role will be satisfied if the set of suspect members is disconnected from the cluster, given the sets of "healthy" and "announcing" members.
protected  java.util.Set ensureSet(java.util.Set set)
          Return the specified set, or an empty set if null.
protected  java.util.Map getClusterQuorumMap()
          Return the cluster quorum map, keyed by role name.
 Service getService()
          Return the Cluster service.
 java.lang.String getStatusDescription()
          Return a String that describes the current Quorum state.
protected  java.util.Map groupMembersByRole(java.util.Set setMembers)
          Group the specified set of Members by their roles.
 void init(Service service)
          Called when the specified service loads and configures this policy.
 boolean isAllowed(Service service, Action action)
          Evaluate if the specified action is currently allowed by this policy.
protected  void setClusterQuorumMap(java.util.Map mapQuorumByRole)
          Set the cluster quorum map, keyed by role name.
 void setService(Service service)
          Set the Cluster service.

 

Methods inherited from class com.tangosol.net.ConfigurableQuorumPolicy
instantiateClusterPolicy, instantiatePartitionedCachePolicy, instantiateProxyPolicy

 

Methods inherited from interface com.tangosol.net.ActionPolicy
toString

 

Field Detail

ROLE_ALL

public static final java.lang.String ROLE_ALL
The role identifier to use for matching any cluster members.
See Also:
Constant Field Values

m_service

protected Service m_service
The cluster service.

m_mapQuorumByRole

protected java.util.Map m_mapQuorumByRole
The cluster membership quorum map, keyed by role name.

Constructor Detail

ConfigurableQuorumPolicy.ClusterQuorumPolicy

protected ConfigurableQuorumPolicy.ClusterQuorumPolicy(java.util.Map mapQuorum)
Construct a ClusterQuorumPolicy with the specified quorum map.
Parameters:
mapQuorum - cluster quorum map

Method Detail

getClusterQuorumMap

protected java.util.Map getClusterQuorumMap()
Return the cluster quorum map, keyed by role name.
Returns:
the cluster quorum map

setClusterQuorumMap

protected void setClusterQuorumMap(java.util.Map mapQuorumByRole)
Set the cluster quorum map, keyed by role name.
Parameters:
mapQuorumByRole - the cluster quorum map

getService

public Service getService()
Return the Cluster service.
Returns:
the Cluster service

setService

public void setService(Service service)
Set the Cluster service.
Parameters:
service - the Cluster service

getStatusDescription

public java.lang.String getStatusDescription()
Return a String that describes the current Quorum state.
Specified by:
getStatusDescription in class ConfigurableQuorumPolicy
Returns:
a String describing the allowed actions in the current state

ensureSet

protected java.util.Set ensureSet(java.util.Set set)
Return the specified set, or an empty set if null.
Parameters:
set - the set to ensure, or null
Returns:
the specified set, or an empty set if null

groupMembersByRole

protected java.util.Map groupMembersByRole(java.util.Set setMembers)
Group the specified set of Members by their roles.
Parameters:
setMembers - the set of Members
Returns:
a map, keyed by role name, of the subsets of Members in that role

checkRoleQuorum

protected boolean checkRoleQuorum(java.lang.String sRole,
                                  java.util.Set setMembers,
                                  java.util.Set setTimedOut,
                                  java.util.Set setHealthy,
                                  java.util.Set setAnnouncing)
Check whether the cluster quorum for the specified role will be satisfied if the set of suspect members is disconnected from the cluster, given the sets of "healthy" and "announcing" members.
Parameters:
sRole - the configured role name, or ROLE_ANY if none was configured
setMembers - the set of cluster members in the specified role
setTimedOut - the subset of cluster members in the specified role that are timed-out. A member is considered timed-out if it has not responded to some network communications within the configured timeout, and it has been selected for termination
setHealthy - the subset of cluster members in the specified role that are known to be "healthy". A member is "healthy" if it has been "recently" heard from
setAnnouncing - the set of potential new cluster members in the specified role that are announcing their presence and waiting to join the cluster
Returns:
true iff the cluster quorum for the specified role would be preserved if the specified timed-out members were disconnected

init

public void init(Service service)
Called when the specified service loads and configures this policy.

Note: A policy could be applied to multiple services.

Specified by:
init in interface ActionPolicy
Parameters:
service - the service that this policy applies to

isAllowed

public boolean isAllowed(Service service,
                         Action action)
Evaluate if the specified action is currently allowed by this policy.

Note: for forward compatibility, implementations should generally return true for actions that are not recognized.

Specified by:
isAllowed in interface ActionPolicy
Parameters:
service - the service that is performing the action
action - the action that is being performed
Returns:
true iff the specified action is currently allowed by this policy

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.