Class MutableExecutionPlan
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.MutableExecutionPlan
-
- All Implemented Interfaces:
ExecutionPlan,com.tangosol.io.ExternalizableLite,com.tangosol.io.pof.PortableObject,Serializable
public class MutableExecutionPlan extends Object implements ExecutionPlan, com.tangosol.io.pof.PortableObject
A mutable implementation ofExecutionPlan.- Since:
- 21.12
- Author:
- bo
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.oracle.coherence.concurrent.executor.ExecutionPlan
ExecutionPlan.Action
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_cPendingRecoveryCountThe number of effective assignments in the past that failed (for some reason) that can be re-assigned in the future asExecutionPlan.Action.RECOVERactions.protected booleanm_fSatisfiedIndicates when anExecutionPlanhas satisfied the requirements of the definingExecutionStrategy.protected LinkedHashMap<String,ExecutionPlan.Action>m_mapActionsTheExecutionPlan.Actions byExecutoridentity.
-
Constructor Summary
Constructors Constructor Description MutableExecutionPlan()Constructs an empty, unsatisfiedMutableExecutionPlan.MutableExecutionPlan(ExecutionPlan executionPlan)Constructs aMutableExecutionPlanbased on anotherExecutionPlan.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(String sId)booleancontains(String sId)intcount(Predicate<? super ExecutionPlan.Action> predicate)Determines the number of aExecutors whoseExecutionPlan.Actions satisfy the specifiedPredicatein theExecutionPlan.booleanequals(Object other)ExecutionPlan.ActiongetAction(String sId)Obtains the proposedExecutionPlan.Actionfor the specifiedExecutor.Iterator<String>getIds()Obtains the unique identities ofExecutors withExecutionPlan.Actions.intgetPendingRecoveryCount()Determines the current number of effective assignments of aTasktoExecutors that failed (for some reason), which could be re-assigned as aExecutionPlan.Action.RECOVERaction.inthashCode()booleanisSatisfied()Determines if theExecutionPlanwill satisfy theExecutionStrategyconditions, including assigning the required number ofExecutors to aTaskfor execution.booleanoptimize()Optimizes theExecutionPlan, returning if there where any changes caused by the optimization.voidreadExternal(com.tangosol.io.pof.PofReader in)voidreadExternal(DataInput in)voidrecover(String sId)voidrelease(String sId)booleansetAction(String sId, ExecutionPlan.Action action)Sets the proposedExecutionPlan.Actionfor the specifiedExecutor.voidsetPendingRecoveryCount(int cPendingRecoveryCount)Sets the number of recovery operations that should occur.voidsetSatisfied(boolean fSatisfied)Sets if theExecutionPlanis satisfied.intsize()Obtains the number ofExecutionPlan.Actions for theExecutionPlan.StringtoString()voidwriteExternal(com.tangosol.io.pof.PofWriter out)voidwriteExternal(DataOutput out)
-
-
-
Field Detail
-
m_mapActions
protected LinkedHashMap<String,ExecutionPlan.Action> m_mapActions
TheExecutionPlan.Actions byExecutoridentity.
-
m_fSatisfied
protected boolean m_fSatisfied
Indicates when anExecutionPlanhas satisfied the requirements of the definingExecutionStrategy.
-
m_cPendingRecoveryCount
protected int m_cPendingRecoveryCount
The number of effective assignments in the past that failed (for some reason) that can be re-assigned in the future asExecutionPlan.Action.RECOVERactions.
-
-
Constructor Detail
-
MutableExecutionPlan
public MutableExecutionPlan()
Constructs an empty, unsatisfiedMutableExecutionPlan.
-
MutableExecutionPlan
public MutableExecutionPlan(ExecutionPlan executionPlan)
Constructs aMutableExecutionPlanbased on anotherExecutionPlan.- Parameters:
executionPlan- theExecutionPlan
-
-
Method Detail
-
setPendingRecoveryCount
public void setPendingRecoveryCount(int cPendingRecoveryCount)
Sets the number of recovery operations that should occur.- Parameters:
cPendingRecoveryCount- seegetPendingRecoveryCount()
-
contains
public boolean contains(String sId)
- Parameters:
sId- the identity of theExecutor- Returns:
trueif theExecutionStrategycontains anExecutionPlan.Actionfor the specifiedExecutor,falseotherwise
-
setSatisfied
public void setSatisfied(boolean fSatisfied)
Sets if theExecutionPlanis satisfied.- Parameters:
fSatisfied- is satisfied
-
getAction
public ExecutionPlan.Action getAction(String sId)
Description copied from interface:ExecutionPlanObtains the proposedExecutionPlan.Actionfor the specifiedExecutor.- Specified by:
getActionin interfaceExecutionPlan- Parameters:
sId- theExecutorid- Returns:
- an
ExecutionPlan.Actionornullif noExecutionPlan.Actionhas been defined
-
setAction
public boolean setAction(String sId, ExecutionPlan.Action action)
Description copied from interface:ExecutionPlanSets the proposedExecutionPlan.Actionfor the specifiedExecutor.- Specified by:
setActionin interfaceExecutionPlan- Parameters:
sId- theExecutoridaction- theExecutionPlan.Actionto set to- Returns:
- a boolean to indicate if the
ExecutionPlanwas changed as a result of setting an action
-
size
public int size()
Description copied from interface:ExecutionPlanObtains the number ofExecutionPlan.Actions for theExecutionPlan.- Specified by:
sizein interfaceExecutionPlan- Returns:
- the number of
ExecutionPlan.Actions
-
count
public int count(Predicate<? super ExecutionPlan.Action> predicate)
Description copied from interface:ExecutionPlanDetermines the number of aExecutors whoseExecutionPlan.Actions satisfy the specifiedPredicatein theExecutionPlan.- Specified by:
countin interfaceExecutionPlan- Parameters:
predicate- thePredicateto evaluate theExecutionPlan.Action- Returns:
- the number of
Executors that satisfy the specifiedPredicate
-
isSatisfied
public boolean isSatisfied()
Description copied from interface:ExecutionPlanDetermines if theExecutionPlanwill satisfy theExecutionStrategyconditions, including assigning the required number ofExecutors to aTaskfor execution.- Specified by:
isSatisfiedin interfaceExecutionPlan- Returns:
truewhen theExecutionPlansatisfies theExecutionStrategythat defined itfalseotherwise
-
getPendingRecoveryCount
public int getPendingRecoveryCount()
Description copied from interface:ExecutionPlanDetermines the current number of effective assignments of aTasktoExecutors that failed (for some reason), which could be re-assigned as aExecutionPlan.Action.RECOVERaction.- Specified by:
getPendingRecoveryCountin interfaceExecutionPlan- Returns:
- the pending recovery count
-
optimize
public boolean optimize()
Description copied from interface:ExecutionPlanOptimizes theExecutionPlan, returning if there where any changes caused by the optimization.- Specified by:
optimizein interfaceExecutionPlan- Returns:
trueif theExecutionPlanwas changed during optimization,falseotherwise
-
getIds
public Iterator<String> getIds()
Description copied from interface:ExecutionPlanObtains the unique identities ofExecutors withExecutionPlan.Actions.- Specified by:
getIdsin interfaceExecutionPlan- Returns:
- the
Executoridentities.
-
readExternal
public void readExternal(DataInput in) throws IOException
- Specified by:
readExternalin interfacecom.tangosol.io.ExternalizableLite- Throws:
IOException
-
writeExternal
public void writeExternal(DataOutput out) throws IOException
- Specified by:
writeExternalin interfacecom.tangosol.io.ExternalizableLite- Throws:
IOException
-
readExternal
public void readExternal(com.tangosol.io.pof.PofReader in) throws IOException- Specified by:
readExternalin interfacecom.tangosol.io.pof.PortableObject- Throws:
IOException
-
writeExternal
public void writeExternal(com.tangosol.io.pof.PofWriter out) throws IOException- Specified by:
writeExternalin interfacecom.tangosol.io.pof.PortableObject- Throws:
IOException
-
-