Package flumotion :: Package manager :: Module depgraph :: Class DepGraph
[hide private]

Class DepGraph

source code

common.log.Loggable --+
                      |
                     DepGraph

I am a dependency graph for components. I also maintain boolean state for each of the nodes.

I contain a DAG to help with resolving dependencies.

Instance Methods [hide private]
 
__init__(self) source code
 
_addNode(self, component, type) source code
 
_removeNode(self, component, type) source code
 
_addEdge(self, parent, child, parentType, childType) source code
 
_removeEdge(self, parent, child, parentType, childType) source code
 
addClockMaster(self, component)
I set a component to be the clock master in the dependency graph.
source code
 
addComponent(self, component)
I add a component to the dependency graph.
source code
 
addWorker(self, worker)
I add a worker to the dependency graph.
source code
 
removeComponent(self, component)
I remove a component in the dependency graph, this includes removing the JOB, COMPONENTSETUP, COMPONENTSTART, CLOCKMASTER.
source code
 
removeWorker(self, worker)
I remove a worker from the dependency graph.
source code
 
setComponentWorker(self, component, worker)
I assign a component to a specific worker.
source code
 
mapEatersToFeeders(self)
I am called once a piece of configuration has been added, so I can add edges to the DAG for each feed from the feeding component to the eating component.
source code
list of (object, str)
whatShouldBeStarted(self)
I return a list of things that can and should be started now.
source code
 
_setState(self, object, type, value) source code
 
setComponentStarted(self, component)
Set a COMPONENTSTART node to have state of True
source code
 
setComponentNotStarted(self, component)
Set a COMPONENTSTART node to have state of False
source code
 
setComponentSetup(self, component)
Set a COMPONENTSETUP node to have state of True
source code
 
setComponentNotSetup(self, component)
Set a COMPONENTSETUP node to have state of False
source code
 
setJobStarted(self, component)
Set a JOB node to have state of True
source code
 
setJobStopped(self, component)
Set a JOB node to have state of False
source code
 
setWorkerStarted(self, worker)
Set a WORKER node to have state of True
source code
 
setWorkerStopped(self, worker)
Set a WORKER node to have state of False
source code
 
setClockMasterStarted(self, component)
Set a CLOCKMASTER node to have state of True
source code
 
setClockMasterStopped(self, component)
Set a CLOCKMASTER node to have state of False
source code
 
isAClockMaster(self, component)
Checks if component has a CLOCKMASTER node
source code

Inherited from common.log.Loggable: __providedBy__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Class Variables [hide private]
  logCategory = 'depgraph'
Implementors can provide a category to log their messages under.
  typeNames = ('WORKER', 'JOB', 'COMPONENTSETUP', 'CLOCKMASTER',...

Inherited from common.log.Loggable: __implemented__, __provides__

Method Details [hide private]

addClockMaster(self, component)

source code 

I set a component to be the clock master in the dependency graph. This component must have already been added to the dependency graph.

Parameters:

addComponent(self, component)

source code 

I add a component to the dependency graph. This includes adding the worker (if not already added), the job, the feeders and the eaters.

Requirement: worker must already be assigned to component

Parameters:

addWorker(self, worker)

source code 

I add a worker to the dependency graph.

Parameters:
  • worker (str) - the worker to add

removeComponent(self, component)

source code 

I remove a component in the dependency graph, this includes removing the JOB, COMPONENTSETUP, COMPONENTSTART, CLOCKMASTER.

Parameters:

removeWorker(self, worker)

source code 

I remove a worker from the dependency graph.

Parameters:
  • worker (str) - the worker to remove

setComponentWorker(self, component, worker)

source code 

I assign a component to a specific worker.

Parameters:

mapEatersToFeeders(self)

source code 

I am called once a piece of configuration has been added, so I can add edges to the DAG for each feed from the feeding component to the eating component.

Raises:

whatShouldBeStarted(self)

source code 

I return a list of things that can and should be started now.

Returns: list of (object, str)
a list of nodes that should be started, in order

setComponentStarted(self, component)

source code 

Set a COMPONENTSTART node to have state of True

Parameters:

setComponentNotStarted(self, component)

source code 

Set a COMPONENTSTART node to have state of False

Parameters:

setComponentSetup(self, component)

source code 

Set a COMPONENTSETUP node to have state of True

Parameters:

setComponentNotSetup(self, component)

source code 

Set a COMPONENTSETUP node to have state of False

Parameters:

setJobStarted(self, component)

source code 

Set a JOB node to have state of True

Parameters:

setJobStopped(self, component)

source code 

Set a JOB node to have state of False

Parameters:

setWorkerStarted(self, worker)

source code 

Set a WORKER node to have state of True

Parameters:
  • worker (str) - the component to set WORKER to True for

setWorkerStopped(self, worker)

source code 

Set a WORKER node to have state of False

Parameters:
  • worker (str) - the component to set WORKER to False for

setClockMasterStarted(self, component)

source code 

Set a CLOCKMASTER node to have state of True

Parameters:
  • component ({flumotion.common.planet.ManagerComponentState}) - the component to set CLOCKMASTER to True for

setClockMasterStopped(self, component)

source code 

Set a CLOCKMASTER node to have state of False

Parameters:
  • component ({flumotion.common.planet.ManagerComponentState}) - the component to set CLOCKMASTER to True for

isAClockMaster(self, component)

source code 

Checks if component has a CLOCKMASTER node

Parameters:
  • component ({flumotion.common.planet.ManagerComponentState}) - the component to check if CLOCKMASTER node exists

Class Variable Details [hide private]

typeNames

Value:
('WORKER', 'JOB', 'COMPONENTSETUP', 'CLOCKMASTER', 'COMPONENTSTART')