def get_children_data(ensemble, namespace, read_only=True): hdfs = cluster.get_hdfs() if hdfs is None: raise PopupException(_('No [hdfs] configured in hue.ini.')) if hdfs.security_enabled: sasl_server_principal = PRINCIPAL_NAME.get() else: sasl_server_principal = None zk = KazooClient(hosts=ensemble, read_only=read_only, sasl_server_principal=sasl_server_principal) zk.start() children_data = [] children = zk.get_children(namespace) for node in children: data, stat = zk.get("%s/%s" % (namespace, node)) children_data.append(data) zk.stop() return children_data
def get_children_data(ensemble, namespace, read_only=True): zk = KazooClient(hosts=ensemble, read_only=read_only, sasl_server_principal=PRINCIPAL_NAME.get()) zk.start() children_data = [] children = zk.get_children(namespace) for node in children: data, stat = zk.get("%s/%s" % (namespace, node)) children_data.append(data) zk.stop() return children_data
def __init__(self, hosts=None, read_only=True): self.hosts = hosts if hosts else ENSEMBLE.get() self.read_only = read_only hdfs = cluster.get_hdfs() if hdfs is None: raise ZookeeperConfigurationException('No [hdfs] configured in hue.ini.') if hdfs.security_enabled: self.sasl_server_principal = PRINCIPAL_NAME.get() else: self.sasl_server_principal = None self.zk = KazooClient(hosts=self.hosts, read_only=self.read_only, sasl_server_principal=self.sasl_server_principal)