patroni.dcs.exhibitor module
- class patroni.dcs.exhibitor.Exhibitor(config: Dict[str, Any], mpp: AbstractMPP)
Bases:
ZooKeeper- __init__(config: Dict[str, Any], mpp: AbstractMPP) None
Prepare DCS paths, MPP object, initial values for state information and processing dependencies.
- Parameters:
config –
dict, reference to config section of selected DCS. i.e.:zookeeperfor zookeeper,etcdfor etcd, etc…mpp – an object implementing
AbstractMPPinterface.
- _abc_impl = <_abc._abc_data object>
- _load_cluster(path: str, loader: Callable[[str], Cluster | Dict[int, Cluster]]) Cluster | Dict[int, Cluster]
Main abstract method that implements the loading of
Clusterinstance.Note
Internally this method should call the loader method that will build
Clusterobject which represents current state and topology of the cluster in DCS. This method supposed to be called only by theget_cluster()method.- Parameters:
path – the path in DCS where to load Cluster(s) from.
loader – one of
_postgresql_cluster_loader()or_mpp_cluster_loader().
- Raise:
DCSErrorin case of communication problems with DCS. If the current node was running as a primary and exception raised, instance would be demoted.
- class patroni.dcs.exhibitor.ExhibitorEnsembleProvider(hosts: List[str], port: int, uri_path: str = '/exhibitor/v1/cluster/list', poll_interval: int = 300)
Bases:
object- TIMEOUT = 3.1