def make_connection(): print(ENV) ic = ibis.impala_connect(host=ENV.impala_host, port=ENV.impala_port, protocol=ENV.impala_protocol) hdfs = ibis.hdfs_connect(host=ENV.nn_host, port=ENV.webhdfs_port) client = ibis.make_client(ic, hdfs_client=hdfs) return client
def connect_test(env, with_hdfs=True): con = ibis.impala_connect(host=env.impala_host, protocol=env.impala_protocol, database=env.test_data_db, port=env.impala_port, use_kerberos=env.use_kerberos, pool_size=2) if with_hdfs: if env.use_kerberos: from hdfs.ext.kerberos import KerberosClient hdfs_client = KerberosClient(env.hdfs_url, mutual_auth='REQUIRED') else: from hdfs.client import InsecureClient hdfs_client = InsecureClient(env.hdfs_url) return ibis.make_client(con, hdfs_client) else: return ibis.make_client(con)
def make_ibis_client(): ic = ibis.impala.connect(host=ENV.impala_host, port=ENV.impala_port, protocol=ENV.impala_protocol, use_kerberos=ENV.use_kerberos) if ENV.use_kerberos: print("Warning: ignoring invalid Certificate Authority errors") hc = ibis.hdfs_connect(host=ENV.nn_host, port=ENV.webhdfs_port, use_kerberos=ENV.use_kerberos, verify=(not ENV.use_kerberos)) return ibis.make_client(ic, hdfs_client=hc)
def make_connection(): ic = ibis.impala_connect(host=ENV.impala_host, port=ENV.impala_port, protocol=ENV.impala_protocol, use_kerberos=ENV.use_kerberos) if ENV.use_kerberos: print("Warning: ignoring invalid Certificate Authority errors") hdfs = ibis.hdfs_connect(host=ENV.nn_host, port=ENV.webhdfs_port, use_kerberos=ENV.use_kerberos, verify=(not ENV.use_kerberos)) return ibis.make_client(ic, hdfs_client=hdfs)
def connect_test(env, with_hdfs=True): con = ibis.impala_connect(host=env.impala_host, protocol=env.impala_protocol, database=env.test_data_db, port=env.impala_port, use_kerberos=env.use_kerberos, pool_size=2) if with_hdfs: if env.use_kerberos: print("Warning: ignoring invalid Certificate Authority errors") hdfs_client = ibis.hdfs_connect(host=env.nn_host, port=env.webhdfs_port, use_kerberos=env.use_kerberos, verify=(not env.use_kerberos)) else: hdfs_client = None return ibis.make_client(con, hdfs_client)