def __init__(self, solr, log):
        '''
        Helper class for working with Solr Zookeeper config and collections. 

        Still very experimental, I wouldn't even use it myself if I didn't like to live on the edge. 
        '''
        if not kz_imported:
            raise ImportError("To use the ZK Class you need to have Kazoo Client installed")
        self.solr = solr
        self.logger = log
        try:
            self.system_data = self.solr.transport.send_request(endpoint='admin/info/system', params={'wt':'json'})
            self.zk_hosts = self.system_data[0]['zkHost']
        except Exception as e:
            self.logger.error("Couldn't get System info From Solr or bad format.")
            self.logger.exception(e)
            raise
        try: 
            self.kz = KazooClient(hosts=self.zk_hosts)
            self.kz.start()
            if self.kz.state != 'CONNECTED':
                self.logger.error("Couldn't establish connection to Zookeeper")
        except Exception as e:
            self.logger.error("Couldn't Establish Connection To Zookeeper")
            raise(e)
def __init__ ( self , solr , log ) : if not kz_imported : raise ImportError ( "To use the ZK Class you need to have Kazoo Client installed" ) self . solr = solr self . logger = log try : self . system_data = self . solr . transport . send_request ( endpoint = 'admin/info/system' , params = { 'wt' : 'json' } ) self . zk_hosts = self . system_data [ 0 ] [ 'zkHost' ] except Exception as e : self . logger . error ( "Couldn't get System info From Solr or bad format." ) self . logger . exception ( e ) raise try : self . kz = KazooClient ( hosts = self . zk_hosts ) self . kz . start ( ) if self . kz . state != 'CONNECTED' : self . logger . error ( "Couldn't establish connection to Zookeeper" ) except Exception as e : self . logger . error ( "Couldn't Establish Connection To Zookeeper" ) raise ( e )
Helper class for working with Solr Zookeeper config and collections. 

        Still very experimental, I wouldn't even use it myself if I didn't like to live on the edge.