Fennel: ExecStreamGovernor Class Reference (original) (raw)

ExecStreamGovernor defines an abstract base for determining resource allocation for an execution stream graph as well as the individual execution streams within the graph. More...

#include <[ExecStreamGovernor.h](ExecStreamGovernor%5F8h-source.html)>

Inheritance diagram for ExecStreamGovernor:

List of all members.

Public Member Functions
virtual ~ExecStreamGovernor ()
virtual bool setResourceKnob (ExecStreamResourceKnobs const &knob, ExecStreamResourceKnobType knobType)=0
Informs the resource governor of a new knob setting.
virtual bool setResourceAvailability (ExecStreamResourceQuantity const &available, ExecStreamResourceType resourceType)=0
Informs the resource governor of a new resource availablity.
virtual void requestResources (ExecStreamGraph &graph)=0
Requests resources for an exec stream graph and assigns resources to each exec stream in the graph.
virtual void returnResources (ExecStreamGraph &graph)=0
Returns to the available resource pool resources that have been assigned to an exec stream graph.
void writeStats (StatsTarget &target)
Writes a current stats snapshot to a StatsTarget.
virtual void initTraceSource (SharedTraceTarget pTraceTarget, std::string name)
For use when initialization has to be deferred until after construction.
void trace (TraceLevel level, std::string message) const
Records a trace message.
bool isTracing () const
**Returns:**true iff tracing is enabled for this source
bool isTracingLevel (TraceLevel level) const
Determines whether a particular level is being traced.
TraceTarget & getTraceTarget () const
**Returns:**the TraceTarget for this source
SharedTraceTarget getSharedTraceTarget () const
**Returns:**the SharedTraceTarget for this source
std::string getTraceSourceName () const
Gets the name of this source.
void setTraceSourceName (std::string const &n)
Sets the name of this source.
TraceLevel getMinimumTraceLevel () const
void disableTracing ()
Protected Types
typedef std::map< ExecStreamGraph *, SharedExecStreamResourceQuantity > ExecStreamGraphResourceMap
Protected Member Functions
ExecStreamGovernor (ExecStreamResourceKnobs const &knobSettings, ExecStreamResourceQuantity const &resourcesAvailable, SharedTraceTarget pTraceTarget, std::string name)
Initializes the resource governor object, including initializing current resource availability.
void traceCachePageRequest (uint assigned, ExecStreamResourceRequirements const &reqt, std::string const &name)
Traces the number of pages assigned to a stream, as well as its minimum and optimum requirements.
Protected Attributes
ExecStreamResourceKnobs knobSettings
Current resource knob settings.
ExecStreamResourceQuantity resourcesAvailable
Keeps track of the total resources that are currently available for assignment.
ExecStreamResourceQuantity resourcesAssigned
Keeps track of resources that have been assigned.
ExecStreamGraphResourceMap resourceMap
Used to keep track of how much resources have been assigned to each of the currently active exec stream graphs.
StrictMutex mutex
Used to synchronize access.

Detailed Description

ExecStreamGovernor defines an abstract base for determining resource allocation for an execution stream graph as well as the individual execution streams within the graph.

Version:

Id

//open/dev/fennel/exec/ExecStreamGovernor.h#9

Definition at line 89 of file ExecStreamGovernor.h.


Member Typedef Documentation


Constructor & Destructor Documentation

| ExecStreamGovernor::~ExecStreamGovernor | ( | | ) | [virtual] | | ---------------------------------------- | - | | - | ----------- |


Member Function Documentation

Traces the number of pages assigned to a stream, as well as its minimum and optimum requirements.

Parameters:

assigned number of cache pages assigned to the stream
reqt resource requirements for the stream
name name of the stream

Definition at line 53 of file ExecStreamGovernor.cpp.

References EXEC_RESOURCE_ACCURATE, EXEC_RESOURCE_ESTIMATE, EXEC_RESOURCE_UNBOUNDED, ExecStreamResourceRequirements::minReqt, ExecStreamResourceRequirements::optReqt, ExecStreamResourceRequirements::optType, and TRACE_FINER.

Referenced by SimpleExecStreamGovernor::assignCachePages(), and SimpleExecStreamGovernor::distributeCachePages().

00057 { 00058 switch (reqt.optType) { 00059 case EXEC_RESOURCE_ACCURATE: 00060 FENNEL_TRACE( 00061 TRACE_FINER, 00062 "Stream " << name << " assigned " << assigned << 00063 " pages based on accurate (min,opt) request of " << "(" << 00064 reqt.minReqt << "," << reqt.optReqt << ") pages"); 00065 break; 00066 case EXEC_RESOURCE_ESTIMATE: 00067 FENNEL_TRACE( 00068 TRACE_FINER, 00069 "Stream " << name << " assigned " << assigned << 00070 " pages based on estimated (min,opt) request of " << "(" << 00071 reqt.minReqt << "," << reqt.optReqt << ") pages"); 00072 break; 00073 case EXEC_RESOURCE_UNBOUNDED: 00074 FENNEL_TRACE( 00075 TRACE_FINER, 00076 "Stream " << name << " assigned " << assigned << 00077 " pages based on an unbounded opt request with " << 00078 reqt.minReqt << " min pages"); 00079 } 00080 }

Informs the resource governor of a new knob setting.

Called by ALTER SYSTEM SET commands that dynamically modify parameters controlling resource allocation.

Parameters:

knob new resource knob setting
knobType indicates which knob setting to change

Returns:

true if possible to apply new setting; false if the setting is below current in-use threshholds. E.g., if modifying cacheReservePercentage, the new number of reserved pages must allow for pages already assigned.

Implemented in SimpleExecStreamGovernor.

Informs the resource governor of a new resource availablity.

Called by ALTER SYSTEM SET commands that dynamically modify resources available.

Parameters:

available amount of resources now available
resourceType type of resource to be set

Returns:

true if possible to apply new settings; false if the setting is below current in-use threshholds. E.g., if modifying cachePagesInit, the value needs to be >= current number of cache pages that have been assigned.

Implemented in SimpleExecStreamGovernor.

virtual void ExecStreamGovernor::requestResources ( ExecStreamGraph & graph ) [pure virtual]

Requests resources for an exec stream graph and assigns resources to each exec stream in the graph.

Parameters:

graph the exec stream graph for which resources are being requested

Implemented in SimpleExecStreamGovernor.

virtual void ExecStreamGovernor::returnResources ( ExecStreamGraph & graph ) [pure virtual]

Returns to the available resource pool resources that have been assigned to an exec stream graph.

Parameters:

graph the exec stream graph that is returning its resources

Implemented in SimpleExecStreamGovernor.

void ExecStreamGovernor::writeStats ( StatsTarget & target ) [virtual]
void TraceSource::initTraceSource ( SharedTraceTarget pTraceTarget,
std::string name
) [virtual, inherited]
void TraceSource::trace ( TraceLevel level,
std::string message
) const [inherited]

| bool TraceSource::isTracing | ( | | ) | const [inline, inherited] | | --------------------------- | - | | - | --------------------------- |

bool TraceSource::isTracingLevel ( TraceLevel level ) const [inline, inherited]

| TraceTarget& TraceSource::getTraceTarget | ( | | ) | const [inline, inherited] | | ----------------------------------------------------------------- | - | | - | --------------------------- |

| std::string TraceSource::getTraceSourceName | ( | | ) | const [inline, inherited] | | ------------------------------------------- | - | | - | --------------------------- |

void TraceSource::setTraceSourceName ( std::string const & n ) [inline, inherited]

Sets the name of this source.

Useful to construct dynamic names for fine-grained filtering.

Definition at line 136 of file TraceSource.h.

00137 { 00138 name = n; 00139 }

| TraceLevel TraceSource::getMinimumTraceLevel | ( | | ) | const [inline, inherited] | | ------------------------------------------------------------------------------------------------------ | - | | - | --------------------------- |

| void TraceSource::disableTracing | ( | | ) | [inherited] | | -------------------------------- | - | | - | ------------- |


Member Data Documentation


The documentation for this class was generated from the following files:


Generated on Mon Jun 22 04:00:30 2009 for Fennel by doxygen 1.5.1