|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.cod.NodeGroup
public class NodeGroup
ConcreteSet resource set implementation for sets of nodes (e.g., for COD Authority or Service Manager/VCM).
These methods are called from mapper classes and the slices ResourceSet class through the ConcreteSet interface. See note on synchronization at slices.ConcreteSet interface.
At this level we deal with sets of nodes that may be linked onto various ResourceSets/ConcreteSets. The underlying Resource Abstraction Layer (RAL/database) is authoritative for node state; state cached in these node sets is always subject to change at the level below us.
The size() of a NodeGroup depends on whether the NodeGroup has flavor standard, virtual, or VMM.
- A "standard" NodeGroup is a set of nodes. Whether the nodes are virtual or physical, the size is the number of nodes.
- A "virtual" NodeGroup consists entirely of virtual nodes. Its size is the sum of computons allocated to its nodes.
- A "VMM" NodeGroup consists entirely of physical nodes capable of hosting virtual machines. Its size is the total number of computons available in the pool.
This distinction affects only how size() is reported, and does not affect any other aspects of NodeGroup.
| Field Summary | |
|---|---|
protected int |
closing
How many nodes are closing in this group |
protected int |
computonsPerNode
Number of computons per node |
protected boolean |
isModified
Scratch field that does not need to be saved/restored. |
static int |
LocationTransferIn
|
protected LoggingTool |
logger
The logger |
protected NodeSet |
modified
Modified nodes from this group |
protected int |
modifying
How many nodes are in the process of being modified |
protected int |
opening
How many nodes are opening in this group |
protected boolean |
pendingChange
Indicates that this NodeGroup is about to undergo some modifications. |
protected IShirakoPlugin |
plugin
The slices plugin |
static java.lang.String |
PropertyComputons
|
static java.lang.String |
PropertyVirtual
|
static java.lang.String |
PropertyVmm
|
protected ResourceReservation |
reservation
The reservation these concrete resources belong to |
protected boolean |
virtual
True if the nodes in this NodeGroup represent a VM pool |
protected boolean |
vmm
True if the nodes in this NodeGroup represent a VMM pool |
| Constructor Summary | |
|---|---|
NodeGroup()
Creates a default node group: standard |
|
NodeGroup(IShirakoPlugin plugin)
Instantiates an empty standard node group using the specified slices plugin. |
|
NodeGroup(NodeGroup cset,
IShirakoPlugin plugin)
Create a standard clone of the node group using the specified plugin |
|
NodeGroup(NodeSet nodes,
IShirakoPlugin plugin)
Creates a standard node group using the specified nodes and plugin |
|
| Method Summary | |
|---|---|
void |
add(IConcreteSet concrete,
boolean configure)
Merges another NodeGroup into this NodeGroup. |
void |
add(Node n)
Adds a node to a NodeGroup. |
protected void |
addModifiedNode(Node node)
Adds a node to the modified set |
void |
addToPool(BinPool pool)
Adds VMM free set to a pool of "bins" for computons. |
void |
change(IConcreteSet concrete,
Term term,
boolean configure)
Make changes to the resources committed to this concrete set. |
protected boolean |
checkClosing(Node n)
Updates status of a node with a pending close. |
protected boolean |
checkModifying(Node n)
Updates status of a node with a pending modify. |
protected boolean |
checkOpening(Node n)
Updates the status of a node with a pending open. |
IConcreteSet |
clone()
Makes a clone of the concrete set. |
IConcreteSet |
cloneEmpty()
Makes an "empty" clone of this concrete set. |
void |
close()
Initiates close (transferOut) on all nodes in this group. |
IConcreteSet |
collectReleased()
Collects closed and failed nodes from this set. |
protected void |
completeClose(Node n)
Records that a node close is complete. |
protected void |
completeModify(Node n)
Records that a node modify is complete. |
protected void |
completeOpen(Node n)
Records that a node open is complete. |
void |
destroy()
Destroys a closed resource set and reservation (remove from database). |
protected void |
error(java.lang.String err)
Report an error and throw an exception |
void |
extend(Term term)
Informs the concrete set that its term has been extended. |
IConcreteSet |
extract(int count)
Extract the specified number of nodes from this node group. |
IConcreteSet |
extract(int count,
Term term,
java.util.Properties properties,
AuthToken client)
Extracts the specified units of resources for the given period of time. |
protected void |
failNode(Node n,
java.lang.String prefix)
Transitions a node to failed and adds it to the failed set. |
NodeSet |
getClosed()
Returns the closed node set. |
NodeSet |
getFailed()
Returns the failed node set. |
Node |
getNode(NodeID nid)
|
java.util.Iterator |
getNodes()
Returns an iterator for the nodes in this NodeGroup. |
NodeSet |
getNodeSet()
Returns the underlying NodeSet (for use by the RAL.resetFree). |
Node[] |
getNodesLocked()
Returns the nodes in this node group. |
java.lang.String |
getNotices()
Reports the error messages |
IShirakoPlugin |
getPlugin()
Returns the slices plugin |
IAuthorityProxy |
getSiteProxy()
ConcreteSet method that is a no-op for NodeGroup. |
int |
getUnits()
Returns the number of nodes in the node group. |
int |
holding(java.util.Date slotDate)
Returns how many units are in the set at the given time instance. |
int |
holding(Term t)
Returns how many units will be in the set for the given period of time. |
protected void |
inheritFlavor(NodeGroup parent)
Inherits the flavor of this NodeGroup from its parent. |
boolean |
isActive()
A NodeGroup is considered "active" if it is bound to a reservation and it has no nodes with pending operations. |
boolean |
isModified()
Returns the value of the modified flag |
protected boolean |
isOnReservation()
Is this NodeGroup bound to a reservation? |
boolean |
isStandard()
Is this a "standard" NodeGroup (physical machines). |
boolean |
isVirtual()
|
boolean |
isVMM()
|
void |
modify(IConcreteSet set,
boolean configure)
Updates the units in the current set with information contained in the passed set. |
protected void |
notify(int id,
IReservation r)
Raises the specified event |
void |
probe()
Probes all nodes and refreshes node state from RAL. |
void |
releaseToPool(BinPool pool)
Releases a group of virtual nodes, restoring the computons to their hosting VMMs. |
void |
remove(IConcreteSet concrete,
boolean configure)
Removes the passed set from the current set. |
void |
remove(Node n)
Removes the node from the node group |
void |
reset(java.util.Properties p)
De-serializes the object from the given properties list. |
void |
revisit()
Revisits all nodes for reset/recovery. |
void |
revisit(IActor actor,
java.util.Properties p)
Recovers state of the component using a previously saved properties list and a references to the actor this component belongs to. |
protected void |
revisit(Node node)
Revisits a node for reset/recovery. |
void |
revisitAtPool(BinPool pool,
NodeGroup igroup)
Revisits a group of virtual nodes, re-reserving the computons from their hosting VMMs. |
protected boolean |
sameFlavor(NodeGroup that)
Compares flavor of the passed NodeGroup to this. |
java.util.Properties |
save()
Serializes the object into a properties list. |
void |
save(java.util.Properties p)
Serializes the object into the given properties list. |
IConcreteSet |
selectExtract(int count,
java.util.Properties p)
|
void |
setComputonsPerNode(int cpn)
Sets #computons per node, and marks the NodeGroup as a "VMM" flavored node pool, i.e., a group of nodes that can host virtual machines. |
void |
setLogger(LoggingTool logger)
Sets the logger for this NodeGroup. |
void |
setModified(boolean isModified)
Sets the modified flag |
void |
setReservation(ResourceReservation reservation)
Sets the reservation this node group belongs to |
void |
setShirakoPlugin(IShirakoPlugin plugin)
Sets the plugin |
void |
setSiteProxy(IAuthorityProxy auth)
ConcreteSet method that is a no-op for NodeGroup. |
void |
setup(ResourceReservation reservation)
Initializes the concrete set with information about the containing reservation. |
void |
setVMM()
|
protected void |
startClose(Node n)
Records that a node is closing. |
protected void |
startModify(Node n)
Records that a node is modifying. |
protected void |
startOpen(Node n)
Records that a node is opening. |
Node |
takeAnyNode()
Extract and return one node from the group. |
java.lang.String |
toString()
|
void |
transferOut(Node node)
|
void |
transferOutNodes()
|
void |
validateConcrete(ResourceType type,
int units,
Term t)
Currently unused. |
void |
validateIncoming()
Currently no-op. |
void |
validateOutgoing()
Currently no-op. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PropertyVmm
public static final java.lang.String PropertyVirtual
public static final java.lang.String PropertyComputons
public static final int LocationTransferIn
protected NodeSet modified
protected int opening
protected int closing
protected int modifying
protected IShirakoPlugin plugin
protected LoggingTool logger
protected ResourceReservation reservation
protected boolean vmm
protected boolean virtual
protected int computonsPerNode
protected boolean isModified
protected boolean pendingChange
| Constructor Detail |
|---|
public NodeGroup()
public NodeGroup(IShirakoPlugin plugin)
plugin - The slices plugin
public NodeGroup(NodeSet nodes,
IShirakoPlugin plugin)
nodes - Nodesplugin - Slices plugin
public NodeGroup(NodeGroup cset,
IShirakoPlugin plugin)
cset - The node group to cloneplugin - The slices plugin to use| Method Detail |
|---|
public IConcreteSet cloneEmpty()
IConcreteSet
cloneEmpty in interface IConcreteSetpublic IConcreteSet clone()
IConcreteSetIConcreteSet.cloneEmpty(), this
method preserves the set: the set elements are the same objects as the
original IConcreteSet, but the indexing structures are different. That
is, adding/removing units to the original should not affect the clone.
But modifications to an individual unit should be visible form the
original and the clone.
clone in interface IConcreteSetclone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public IConcreteSet extract(int count,
Term term,
java.util.Properties properties,
AuthToken client)
throws java.lang.Exception
The concrete set is not required to maintain bookkeeping to verify if the extract operation can actually be completed successfully. The caller is responsible for all bookkeeping and ensuring that the concrete set has sufficient units to satisfy this request. Extract should not decrement the available units from the concrete set.
This method will typically be called with the kernel lock on.
extract in interface IConcreteSetcount - number of units to extractterm - the term for extractionproperties - properties to attach to the extracted resources. If
any, these properties will replace any properties contained in
the set the resources are being extracted from.client - the client to extract resources to
java.lang.Exception
public IConcreteSet extract(int count)
throws java.lang.Exception
count -
java.lang.Exceptionpublic Node takeAnyNode()
public IConcreteSet selectExtract(int count,
java.util.Properties p)
throws java.lang.Exception
java.lang.Exceptionpublic void add(Node n)
public void remove(Node n)
n - Node to remove
public IConcreteSet collectReleased()
throws java.lang.Exception
collectReleased in interface IConcreteSetjava.lang.Exceptionprotected boolean isOnReservation()
public boolean isActive()
isActive in interface IConcreteSetpublic int getUnits()
getUnits in interface IConcreteSetpublic int holding(Term t)
holding in interface IConcreteSett - period of time
public int holding(java.util.Date slotDate)
holding in interface IConcreteSetslotDate - time instance
protected void startOpen(Node n)
n - the nodeprotected boolean checkOpening(Node n)
n - the node
protected void completeOpen(Node n)
n - the nodeprotected void startModify(Node n)
n - nodeprotected boolean checkModifying(Node n)
n - the node
protected void completeModify(Node n)
n - the nodeprotected void startClose(Node n)
n - the nodeprotected boolean checkClosing(Node n)
n - the node
protected void completeClose(Node n)
n - the nodeprotected void addModifiedNode(Node node)
node -
protected void failNode(Node n,
java.lang.String prefix)
n - the node
public void revisit(IActor actor,
java.util.Properties p)
throws java.lang.Exception
revisit in interface IRecoveractor - actor object the component belongs top - properties list containing configuration data about the
component
java.lang.Exceptionpublic void revisit()
protected void revisit(Node node)
n - the nodepublic void setup(ResourceReservation reservation)
setup in interface IConcreteSetreservation - reservation this concrete set belongs to
public void modify(IConcreteSet set,
boolean configure)
throws java.lang.Exception
IConcreteSet.extend(Term).
modify in interface IConcreteSetset - set containing the update dataconfigure - if true, configuration actions will be triggered for all
modified units
java.lang.Exception
public void add(IConcreteSet concrete,
boolean configure)
throws java.lang.Exception
add in interface IConcreteSetconcrete - the NodeGroup (ConcreteSet) to addconfigure - if true, configuration actions will be triggered for all
added units
java.lang.Exception - unidentified rare error case
public void remove(IConcreteSet concrete,
boolean configure)
throws java.lang.Exception
IConcreteSetIConcreteSet.extend(Term).
remove in interface IConcreteSetconcrete - set to removeconfigure - if true, configuration actions will be triggered for all
removed units
java.lang.Exception
public void change(IConcreteSet concrete,
Term term,
boolean configure)
throws java.lang.Exception
change in interface IConcreteSetconcrete - NodeGroup of nodes in updated leaseterm - current reservation term; may have been modifiedproperties - current reservation properties; may have been modified
java.lang.Exception - if something is wrong
public void extend(Term term)
throws java.lang.Exception
extend in interface IConcreteSetterm - new term
java.lang.Exception
public void probe()
throws java.lang.Exception
probe in interface IConcreteSetjava.lang.Exception
public void close()
throws java.lang.Exception
close in interface IConcreteSetjava.lang.Exception
public void destroy()
throws java.lang.Exception
destroy in interface IConcreteSetjava.lang.Exceptionpublic void transferOutNodes()
public void transferOut(Node node)
public void setComputonsPerNode(int cpn)
cpn - computons per host VMM in this grouppublic void addToPool(BinPool pool)
pool - the pool of host VMMspublic void releaseToPool(BinPool pool)
pool - the pool of host VMMs
public void revisitAtPool(BinPool pool,
NodeGroup igroup)
pool - the pool of host VMMsigroup - the NodeGroup for the pool (for indexing)
public void validateIncoming()
throws java.lang.Exception
validateIncoming in interface IConcreteSetjava.lang.Exception - if validation fails
public void validateOutgoing()
throws java.lang.Exception
validateOutgoing in interface IConcreteSetjava.lang.Exception - if validation fails
public void validateConcrete(ResourceType type,
int units,
Term t)
throws java.lang.Exception
validateConcrete in interface IConcreteSettype - abstract resources resource typeunits - abstract resources unitst - abstract resources term
java.lang.Exception
public java.util.Properties save()
throws java.lang.Exception
save in interface ISerializejava.lang.Exception
public void save(java.util.Properties p)
throws java.lang.Exception
save in interface ISerializep - properties list to serialize the object into
java.lang.Exception
public void reset(java.util.Properties p)
throws java.lang.Exception
reset in interface ISerializep - properties list containing the serialized version of
the object
java.lang.Exception
protected void notify(int id,
IReservation r)
id - event idr - reservation this event is associated with
java.lang.Exception
protected void error(java.lang.String err)
throws java.lang.Exception
java.lang.Exceptionprotected void inheritFlavor(NodeGroup parent)
protected boolean sameFlavor(NodeGroup that)
that - NodeGroup for comparison to this
public boolean isStandard()
public boolean isVirtual()
public boolean isVMM()
public void setVMM()
public IAuthorityProxy getSiteProxy()
throws java.lang.Exception
getSiteProxy in interface IConcreteSetjava.lang.Exception
public void setSiteProxy(IAuthorityProxy auth)
throws java.lang.Exception
setSiteProxy in interface IConcreteSetjava.lang.Exception - if calledpublic NodeSet getNodeSet()
public java.util.Iterator getNodes()
public Node[] getNodesLocked()
public java.lang.String getNotices()
getNotices in interface IConcreteSetpublic void setLogger(LoggingTool logger)
public void setShirakoPlugin(IShirakoPlugin plugin)
setShirakoPlugin in interface IConcreteSetplugin - The slices pluginpublic void setReservation(ResourceReservation reservation)
reservation - public NodeSet getClosed()
public NodeSet getFailed()
public boolean isModified()
public void setModified(boolean isModified)
isModified - public IShirakoPlugin getPlugin()
public Node getNode(NodeID nid)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||