Package virtualization :: Module poller_state_cache :: Class PollerStateCache
[hide private]
[frames] | no frames]

Class PollerStateCache

source code

Instance Methods [hide private]
 
__init__(self, domain_data, debug=0)
This method creates a new poller state based on the provided domain list.
source code
 
save(self)
Updates the cache on disk with the latest domain data.
source code
 
is_expired(self)
Returns true if this cache is expired.
source code
 
is_changed(self) source code
 
get_added(self)
Returns a list of uuids for each domain that has been added since the last state poll.
source code
 
get_modified(self)
Returns a list of uuids for each domain that has been modified since the last state poll.
source code
 
get_removed(self)
Returns a list of uuids for each domain that has been removed since the last state poll.
source code
 
_load_state(self)
Loads the last hypervisor state from disk.
source code
 
_save_state(self)
Saves the given polling state to disk.
source code
 
_compare_domain_data(self)
Compares the old domain_data to the new domain_data.
source code
 
_log_debug(self, msg, include_trace=0) source code
Method Details [hide private]

__init__(self, domain_data, debug=0)
(Constructor)

source code 

This method creates a new poller state based on the provided domain
list.  The domain_data list should be in the form returned from
poller.poll_hypervisor.  That is,

     { uuid : { 'name'        : '...',
                'uuid'        : '...',
                'virt_type'   : '...',
                'memory_size' : '...',
                'vcpus'       : '...',
                'state'       : '...' }, ... }

_compare_domain_data(self)

source code 

Compares the old domain_data to the new domain_data.  Returns a tuple
of lists, relative to the new domain_data:

    (added, removed, modified)