|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.net.partition.FailoverAccessPolicy
public class FailoverAccessPolicy
FailoverAccessPolicy is used to moderate the client request load during a failover event in order to allow cache servers adequate opportunity to re-establish partition backups.
While typically not necessary to ensure the timely recovery to a "safe" state, this access policy could be used in situations where a heavy load of of high-latency requests may prevent or significantly delay cache servers from successfully acquiring exclusive access to partitions needing to be transferred or backed up.
Nested Class Summary | |
---|---|
protected class |
FailoverAccessPolicy.MembershipListener The MemberListener is used to listen to service membership events to monitor the endangered status of the service. |
Field Summary | |
---|---|
long |
m_cLimitMillis The amount of time after being in an endangered state after which the quorum policy makes a maximal effort to hold client requests. |
long |
m_cMaxDelayMillis The maximum amount of time (in ms) that a request could be delayed by this quorum policy. |
long |
m_cThresholdMillis The amount of time after being in an endangered state before the quorum policy should start to hold client requests. |
long |
m_ldtEndangered The time at which the service most recently became endangered (or 0 if the service is in the "safe" state). |
int |
m_nState One of the STATE_* constants representing the current quorum state. |
protected PartitionedService |
m_service The PartitionedService that this quorum policy is bound to. |
static int |
STATE_ENDANGERED Constant used to indicate that the service is in an endangered state. |
static int |
STATE_SAFE Constant used to indicate that the service is "safe" (non-endangered). |
static int |
STATE_UNKNOWN Constant used to indicate that the service is in an unknown (possibly endangered) state. |
Constructor Summary | |
---|---|
FailoverAccessPolicy() Default constructor. |
|
FailoverAccessPolicy(long cThresholdMillis, long cLimitMillis, long cMaxDelayMillis) Construct a FailoverAccessPolicy according to the specified parameters. |
Method Summary | |
---|---|
protected long |
calculateWaitTime(long cMillisEndangered) Return the amount of time that a request should be delayed before being allowed to proceed. |
protected boolean |
checkEndangered() Check to see if the associated service is endangered. |
int |
getState() Return the current endangered state (one of the STATE_* constants). |
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 |
setState(int nState) Set the endangered state (one of the STATE_* constants). |
Methods inherited from interface com.tangosol.net.ActionPolicy |
---|
toString |
Field Detail |
---|
public static final int STATE_SAFE
public static final int STATE_UNKNOWN
public static final int STATE_ENDANGERED
public long m_cThresholdMillis
public long m_cLimitMillis
public long m_cMaxDelayMillis
public int m_nState
Note: this field is intentionally left non-volatile. The consequence of a "stale" read is that the first request per thread following a transition to endangered could be missed by this quorum (allowed to proceed). As this has no impact, we would rather avoid the additional volatile read on each "normal" operation.
public long m_ldtEndangered
protected PartitionedService m_service
Constructor Detail |
---|
public FailoverAccessPolicy()
public FailoverAccessPolicy(long cThresholdMillis, long cLimitMillis, long cMaxDelayMillis)
cThresholdMillis
- the delay before the policy should start holding requests (after becoming endangered)cLimitMillis
- the delay before the policy makes a maximal effort to hold requests (after becoming endangered)cMaxDelayMillis
- the maximum amount of time to hold a requestMethod Detail |
---|
public int getState()
protected void setState(int nState)
nState
- the new endangered statepublic void init(Service service)
Note: A policy could be applied to multiple services.
init
in interface ActionPolicy
service
- the service that this policy applies topublic boolean isAllowed(Service service, Action action)
Note: for forward compatibility, implementations should generally return true for actions that are not recognized.
isAllowed
in interface ActionPolicy
service
- the service that is performing the actionaction
- the action that is being performedprotected long calculateWaitTime(long cMillisEndangered)
cMillisEndangered
- the amount of time that the service has been endangeredprotected boolean checkEndangered()
Note: the caller must hold synchronization on this quorum policy.
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |