Ejemplo n.º 1
0
    def _fetchNurseryConfig(self):
        (routing, cfgs) = self._keeperClient.getNurseryConfig()
        self._routing = routing
        logging.debug("Nursery client has routing: %s" % str(routing))
        for (clusterId, client) in self._clusterClients.iteritems():
            client.dropConnections()

        self._clusterClients = dict()
        logging.debug("Nursery contains %d clusters", len(cfgs))
        for (clusterId, cfg) in cfgs.iteritems():
            client = ArakoonClient(cfg)
            logging.debug("Adding client for cluster %s" % clusterId)
            self._clusterClients[clusterId] = client
Ejemplo n.º 2
0
 def __init__(self, clientConfig):
     self.nurseryClusterId = clientConfig.getClusterId()
     self._keeperClient = ArakoonClient(clientConfig)
     self._clusterClients = dict()
     self._fetchNurseryConfig()