Class MutableExecutionPlan
java.lang.Object
com.oracle.coherence.concurrent.executor.MutableExecutionPlan
- All Implemented Interfaces:
ExecutionPlan,ExternalizableLite,PortableObject,Serializable
A mutable implementation of
ExecutionPlan.- Since:
- 21.12
- Author:
- bo
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.oracle.coherence.concurrent.executor.ExecutionPlan
ExecutionPlan.Action -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe number of effective assignments in the past that failed (for some reason) that can be re-assigned in the future asExecutionPlan.Action.RECOVERactions.protected booleanIndicates when anExecutionPlanhas satisfied the requirements of the definingExecutionStrategy.protected LinkedHashMap<String, ExecutionPlan.Action> TheExecutionPlan.Actions byExecutoridentity. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty, unsatisfiedMutableExecutionPlan.MutableExecutionPlan(ExecutionPlan executionPlan) Constructs aMutableExecutionPlanbased on anotherExecutionPlan. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanintcount(Predicate<? super ExecutionPlan.Action> predicate) Determines the number of aExecutors whoseExecutionPlan.Actions satisfy the specifiedPredicatein theExecutionPlan.booleanObtains the proposedExecutionPlan.Actionfor the specifiedExecutor.getIds()Obtains the unique identities ofExecutors withExecutionPlan.Actions.intDetermines the current number of effective assignments of aTasktoExecutors that failed (for some reason), which could be re-assigned as aExecutionPlan.Action.RECOVERaction.inthashCode()booleanDetermines 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.voidRestore the contents of a user type instance by reading its state using the specified PofReader object.voidRestore the contents of this object by loading the object's state from the passed DataInput object.voidvoidbooleansetAction(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.toString()voidwriteExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object.voidwriteExternal(DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object.
-
Field Details
-
m_mapActions
TheExecutionPlan.Actions byExecutoridentity. -
m_fSatisfied
protected boolean m_fSatisfiedIndicates when anExecutionPlanhas satisfied the requirements of the definingExecutionStrategy. -
m_cPendingRecoveryCount
protected int m_cPendingRecoveryCountThe number of effective assignments in the past that failed (for some reason) that can be re-assigned in the future asExecutionPlan.Action.RECOVERactions.
-
-
Constructor Details
-
MutableExecutionPlan
public MutableExecutionPlan()Constructs an empty, unsatisfiedMutableExecutionPlan. -
MutableExecutionPlan
Constructs aMutableExecutionPlanbased on anotherExecutionPlan.- Parameters:
executionPlan- theExecutionPlan
-
-
Method Details
-
setPendingRecoveryCount
public void setPendingRecoveryCount(int cPendingRecoveryCount) Sets the number of recovery operations that should occur.- Parameters:
cPendingRecoveryCount- seegetPendingRecoveryCount()
-
assign
-
recover
-
release
-
contains
- 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
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
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
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
Description copied from interface:ExecutionPlanObtains the unique identities ofExecutors withExecutionPlan.Actions.- Specified by:
getIdsin interfaceExecutionPlan- Returns:
- the
Executoridentities.
-
toString
-
equals
-
hashCode
-
readExternal
Description copied from interface:ExternalizableLiteRestore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
readExternalin interfaceExternalizableLite- Parameters:
in- the DataInput stream to read data from in order to restore the state of this object- Throws:
IOException- if an I/O exception occurs
-
writeExternal
Description copied from interface:ExternalizableLiteSave the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
writeExternalin interfaceExternalizableLite- Parameters:
out- the DataOutput stream to write the state of this object to- Throws:
IOException- if an I/O exception occurs
-
readExternal
Description copied from interface:PortableObjectRestore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternalin interfacePortableObject- Parameters:
in- the PofReader from which to read the object's state- Throws:
IOException- if an I/O error occurs
-
writeExternal
Description copied from interface:PortableObjectSave the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternalin interfacePortableObject- Parameters:
out- the PofWriter to which to write the object's state- Throws:
IOException- if an I/O error occurs
-