Package ganeti :: Package confd :: Module client :: Class ConfdFilterCallback
[hide private]
[frames] | no frames]

Class ConfdFilterCallback

source code


Callback that calls another callback, but filters duplicate results.

Instance Methods [hide private]
 
__init__(self, callback, logger=None)
Constructor for ConfdFilterCallback
source code
 
_LogFilter(self, salt, new_reply, old_reply) source code
 
_HandleExpire(self, up) source code
boolean
_HandleReply(self, up)
Handle a single confd reply, and decide whether to filter it.
source code
 
__call__(self, up)
Filtering callback
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  consistent
a dictionary indexed by salt; for each salt, if all responses ware identical, this will be True; this is the expected state on a healthy cluster; on inconsistent or partitioned clusters, this might be False, if we see answers with the same serial but different contents
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, callback, logger=None)
(Constructor)

source code 

Constructor for ConfdFilterCallback

Parameters:
  • callback (f(ConfdUpcallPayload)) - function to call when getting answers
  • logger (logging.Logger) - optional logger for internal conditions
Overrides: object.__init__

_HandleReply(self, up)

source code 

Handle a single confd reply, and decide whether to filter it.

Returns: boolean
True if the reply should be filtered, False if it should be passed on to the up-callback

__call__(self, up)
(Call operator)

source code 

Filtering callback

Parameters: