All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class magician.Node.ResourceMgr

java.lang.Object
   |
   +----magician.Node.ResourceMgr

public class ResourceMgr
extends Object
implements PerfConstants
Controls the resources of the active node such as cpu and memory. It is started up by the node manager during initial startup

See Also:
ActiveNodeManager, SPThread

Variable Index

 o MAX_CPU_TIME
Maximum execution time of a thread (in milliseconds)
 o maxSP
Maximum number of Smart Packet which can be processed simultaneously.
 o objectPerThread
Maximum number of objects which can be created by a thread
 o resMon
ResourceMonitor thread executes continuously to check on resource consumption of active threads
 o scheduler
Scheduler thread also executes continuously to schedule threads
 o smallStates
A table of reference to the small states managed by the ResourceMgr
 o threadgroup
All managed spThreads belong to "Smart Packets" ThreadGroup

Constructor Index

 o ResourceMgr(int, long, long)
initializes the ResourceMgr

Method Index

 o newStorage(String)
Allocate storage for new object
 o newThread(KUSmartPacketV2)
Allocates a new thread for the SmartPacket and schedules it for execution

Variables

 o resMon
 protected ResourceMonitor resMon
ResourceMonitor thread executes continuously to check on resource consumption of active threads

 o scheduler
 protected Scheduler scheduler
Scheduler thread also executes continuously to schedule threads

 o threadgroup
 protected ThreadGroup threadgroup
All managed spThreads belong to "Smart Packets" ThreadGroup

 o smallStates
 Vector smallStates
A table of reference to the small states managed by the ResourceMgr

 o objectPerThread
 protected static long objectPerThread
Maximum number of objects which can be created by a thread

 o MAX_CPU_TIME
 protected static final long MAX_CPU_TIME
Maximum execution time of a thread (in milliseconds)

 o maxSP
 protected int maxSP
Maximum number of Smart Packet which can be processed simultaneously. We may want to limit this to ensure timely execution of the threads

Constructors

 o ResourceMgr
 public ResourceMgr(int maxSP,
                    long maxObjects,
                    long execTime)
initializes the ResourceMgr

Parameters:
maxSP - the maximum number of Smartpacket threads that can run concurrently
maxObjects - the maximum number of objects that can be allocated by a Smartpacket
execTime - the maximum allowable execution time

Methods

 o newThread
 public void newThread(KUSmartPacketV2 sp)
Allocates a new thread for the SmartPacket and schedules it for execution

Parameters:
sp - the Smartpacket object that requires execution
 o newStorage
 public SPStorage newStorage(String className)
Allocate storage for new object

Parameters:
className - class of new object

All Packages  Class Hierarchy  This Package  Previous  Next  Index
1