Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

LrmImpl Class Reference

#include <LrmImpl.hpp>

Collaboration diagram for LrmImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void updateLoop ()
void setSampleInterval (long seconds)
void setKeepAliveInterval (long seconds)
void remoteExecutionRequest (ExecutionSpecs execSpecs)
AppInfoHolder appInfo (const string &appId)
void removeAppInfo (const string &appId)
void kill (const string &appId)

Static Public Member Functions

LrmImplinit (const Config &config)

Private Member Functions

void copyFile (const string &srcPath, const string &dstPath)
 LrmImpl (const Config &config)
void notifyStatus ()
void cleanup ()

Static Private Member Functions

void * notifyStatus (void *ptr)
void * notifyStatusWrapper (void *ptr)

Private Attributes

string grmIor
string appReposIor
GuardedVariable< long > sampleInterval
GuardedVariable< long > keepAliveInterval
float threshold
string orbPath
string appReposIdlPath
string resourceManagementIdlPath
GuardedVariable< int > appId
lua_State * clientSideState
map< string, AppInfoHolderlaunchedAppsInfo
map< string, AppInfoHolderfinishedAppsInfo
pthread_mutex_t launchedAppsInfoLock
pthread_mutex_t finishedAppsInfoLock

Static Private Attributes

LrmImplsingleInstance_ = NULL

Detailed Description

LrmImpl - Implementation of the LRM IDL interface.

LrmImpl implements LRM interface. It also hosts methods for setting up the server side of the LRM service (tasks such as ORB instantiation, proxy creation, etc). Finally, LRM periodically uploads resource information of a given node to the GRM.

LRM is a sigleton, because we are using threads and the only way to launch threads are via static methods. We could use other mechanisms to do that, but since we don't need more than one LRM object, this solution is ok for now.

Author:
Andrei Goldchleger

Todo:
This class was heavily refectored, but maybe further refctoring is possible. Some possibilities include extracting part of the functionality to other classes.


Constructor & Destructor Documentation

LrmImpl::LrmImpl const Config config  )  [private]
 


Member Function Documentation

AppInfoHolder LrmImpl::appInfo const string &  appId  )  [inline]
 

void LrmImpl::cleanup  )  [private]
 

void LrmImpl::copyFile const string &  srcPath,
const string &  dstPath
[private]
 

Copies a file from srcPath to dstPath

Parameters:
srcPath - source path to the file being copied
dstPath - destination path

LrmImpl & LrmImpl::init const Config config  )  [static]
 

void LrmImpl::kill const string &  appId  ) 
 

void LrmImpl::notifyStatus  )  [private]
 

void* LrmImpl::notifyStatus void *  ptr  )  [static, private]
 

void * LrmImpl::notifyStatusWrapper void *  ptr  )  [static, private]
 

void LrmImpl::remoteExecutionRequest ExecutionSpecs  execSpecs  ) 
 

Called by a GRM asking if we can host a determined application.

Parameters:
execSpecs - Data associated with the request(Requirements, preferences...)

void LrmImpl::removeAppInfo const string &  appId  )  [inline]
 

void LrmImpl::setKeepAliveInterval long  seconds  )  [inline]
 

Allows a remote caller to modify the keep-alive interval.

The keep-alive interval defines the maximum time that the LRM can spend without uploading information to the GRM. Even if the system is almost idle and there are no significant changes in resource availability, the LRM uploads resource availability information to the GRM at least every X seconds. This acts as a keep-alive which teels the GRM that a given LRM is still working.

Parameters:
seconds - the new keep-alive interval (in seconds).

void LrmImpl::setSampleInterval long  seconds  )  [inline]
 

Allows a remote caller to modify the sample interval.

The sample interval defines how many time the system 'sleeps' between two queries about resource utilization made to the OS.

Parameters:
seconds - the new sample interval (in seconds).

void LrmImpl::updateLoop  ) 
 

Periodically upload system information to a remote GRM. This method does not return.


Member Data Documentation

GuardedVariable<int> LrmImpl::appId [private]
 

Holds last used local application Id. Used to rename applications downloaded from the Application Repository, making sure that there is no naming conflicts between multiple applications that might be running

string LrmImpl::appReposIdlPath [private]
 

Path to the Application Repository IDL

string LrmImpl::appReposIor [private]
 

The IOR of the Application Repository we will contact

struct lua_State* LrmImpl::clientSideState [private]
 

Lua state representing LrmImpl's client side

map<string, AppInfoHolder> LrmImpl::finishedAppsInfo [private]
 

pthread_mutex_t LrmImpl::finishedAppsInfoLock [private]
 

string LrmImpl::grmIor [private]
 

The IOR of the GRM we will contact

GuardedVariable<long> LrmImpl::keepAliveInterval [private]
 

Maximun interval, in seconds, before LRM sends an update to the GRM, even without significat changes in resource availability

map<string, AppInfoHolder> LrmImpl::launchedAppsInfo [private]
 

pthread_mutex_t LrmImpl::launchedAppsInfoLock [private]
 

string LrmImpl::orbPath [private]
 

Path to the O2 files. MUST end with /?. Example: /usr/local/o2/?

string LrmImpl::resourceManagementIdlPath [private]
 

Path to the Resorce Management IDL. Contains Lrm, Grm and Asct definitions

GuardedVariable<long> LrmImpl::sampleInterval [private]
 

Amount of time, in seconds, between queries about resource availability

LrmImpl * LrmImpl::singleInstance_ = NULL [static, private]
 

float LrmImpl::threshold [private]
 

A percentage that indicates how much resource availability must change in order to be considered significant


The documentation for this class was generated from the following files:
Generated on Mon Sep 6 16:13:18 2004 by doxygen 1.3.3