Package flumotion :: Package manager :: Module worker :: Class WorkerAvatar
[hide private]

Class WorkerAvatar

source code

twisted.spread.pb.Avatar --+            
                           |            
 extern.log.log.Loggable --+            
                           |            
           twisted.pb.Avatar --+        
                               |        
       twisted.pb.PingableAvatar --+    
                                   |    
         extern.log.log.Loggable --+    
                                   |    
                  base.ManagerAvatar --+
                                       |
                                      WorkerAvatar

I am an avatar created for a worker. A reference to me is given when logging in and requesting a worker avatar. I live in the manager.

Instance Methods [hide private]
 
__init__(self, heaven, avatarId, remoteIdentity, mind, feedServerPort, ports, randomPorts) source code
 
getName(self) source code
 
onShutdown(self) source code
 
reservePorts(self, numPorts)
Reserve the given number of ports on the worker.
source code
 
releasePorts(self, ports)
Release the given list of ports on the worker.
source code
 
createComponent(self, avatarId, type, nice, conf)
Create a component of the given type with the given nice level.
source code
 
getComponents(self)
Get a list of components that the worker is running.
source code
 
perspective_componentAddMessage(self, avatarId, message)
Called by the worker to tell the manager to add a given message to the given component.
source code

Inherited from base.ManagerAvatar: getClientAddress, mindCallRemote, perspective_authenticate, perspective_getBundleSums, perspective_getBundleSumsByFile, perspective_getBundleZips, perspective_getKeycardClasses, perspective_keepAlive, perspective_writeFluDebugMarker

Inherited from twisted.pb.PingableAvatar: perspective_ping, setMind, startPingChecking, stopPingChecking

Inherited from twisted.pb.PingableAvatar (private): _pingCheck

Inherited from twisted.pb.Avatar: disconnect, mindCallRemoteLogging, perspectiveMessageReceived, perspectiveMessageReceivedUnserialised

Inherited from twisted.spread.pb.Avatar: __providedBy__

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Methods [hide private]
 
makeAvatarInitArgs(klass, heaven, avatarId, remoteIdentity, mind) source code

Inherited from base.ManagerAvatar: makeAvatar

Class Variables [hide private]
  logCategory = 'worker-avatar'
Implementors can provide a category to log their messages under.
  _portSet = None

Inherited from base.ManagerAvatar: remoteLogName

Inherited from twisted.pb.PingableAvatar (private): _pingCheckInterval

Inherited from twisted.spread.pb.Avatar: __implemented__, __provides__

Instance Variables [hide private]
int feedServerPort = None
TCP port the feed server is listening on

Inherited from base.ManagerAvatar: avatarId, heaven, mind, vishnu

Method Details [hide private]

__init__(self, heaven, avatarId, remoteIdentity, mind, feedServerPort, ports, randomPorts)
(Constructor)

source code 
Parameters:
  • heaven - the heaven this avatar is part of
  • avatarId - id of the avatar to create
  • remoteIdentity - manager-assigned identity object for this avatar
  • mind - a remote reference to the client-side Medium
Overrides: twisted.pb.Avatar.__init__

makeAvatarInitArgs(klass, heaven, avatarId, remoteIdentity, mind)
Class Method

source code 
Overrides: base.ManagerAvatar.makeAvatarInitArgs

onShutdown(self)

source code 
Overrides: base.ManagerAvatar.onShutdown

reservePorts(self, numPorts)

source code 

Reserve the given number of ports on the worker.

Parameters:
  • numPorts (int) - how many ports to reserve

releasePorts(self, ports)

source code 

Release the given list of ports on the worker.

Parameters:
  • ports (list of int) - list of ports to release

createComponent(self, avatarId, type, nice, conf)

source code 

Create a component of the given type with the given nice level.

Parameters:
  • avatarId (str) - avatarId the component should use to log in
  • type (str) - type of the component to create
  • nice (int) - the nice level to create the component at
  • conf (dict) - the component's config dict
Returns:
a deferred that will give the avatarId the component will use to log in to the manager

getComponents(self)

source code 

Get a list of components that the worker is running.

Returns:
a deferred that will give the avatarIds running on the worker

perspective_componentAddMessage(self, avatarId, message)

source code 

Called by the worker to tell the manager to add a given message to the given component.

Useful in cases where the component can't report messages itself, for example because it crashed.

Parameters: