def get_query_server_config(name='beeswax'): if name == 'impala': from impala.conf import SERVER_HOST, SERVER_PORT, IMPALA_PRINCIPAL, SERVER_INTERFACE as IMPALA_SERVER_INTERFACE # Backward compatibility until Hue 3.0 # If no interface specified and port is beeswax, switch port to HS2 default as we want to use HS2 from now on if IMPALA_SERVER_INTERFACE.get() == 'hiveserver2' and SERVER_PORT.get() == 21000: port = 21050 else: port = SERVER_PORT.get() query_server = { 'server_name': 'impala', 'server_host': SERVER_HOST.get(), 'server_port': port, 'server_interface': IMPALA_SERVER_INTERFACE.get(), 'principal': IMPALA_PRINCIPAL.get(), } else: if SERVER_INTERFACE.get() == 'hiveserver2': kerberos_principal = hive_site.get_hiveserver2_kerberos_principal() else: # Beeswaxd runs as 'hue' kerberos_principal = KERBEROS.HUE_PRINCIPAL.get() query_server = { 'server_name': 'beeswax', 'server_host': BEESWAX_SERVER_HOST.get(), 'server_port': BEESWAX_SERVER_PORT.get(), 'server_interface': SERVER_INTERFACE.get(), 'principal': kerberos_principal } LOG.debug("Query Server:\n\tName: %(server_name)s\n\tHost: %(server_host)s\n\tPort: %(server_port)s\n\tInterface: %(server_interface)s\n\tKerberos Principal: %(principal)s" % query_server) return query_server
def get_query_server_config(name="beeswax"): if name == "impala": from impala.conf import SERVER_HOST, SERVER_PORT, IMPALA_PRINCIPAL, SERVER_INTERFACE as IMPALA_SERVER_INTERFACE # Backward compatibility until Hue 3.0 # If no interface specified and port is beeswax, switch port to HS2 default as we want to use HS2 from now on if IMPALA_SERVER_INTERFACE.get() == "hiveserver2" and SERVER_PORT.get() == 21000: port = 21050 else: port = SERVER_PORT.get() query_server = { "server_name": "impala", "server_host": SERVER_HOST.get(), "server_port": port, "server_interface": IMPALA_SERVER_INTERFACE.get(), "principal": IMPALA_PRINCIPAL.get(), } else: if SERVER_INTERFACE.get() == "hiveserver2": kerberos_principal = hive_site.get_hiveserver2_kerberos_principal() else: # Beeswaxd runs as 'hue' kerberos_principal = KERBEROS.HUE_PRINCIPAL.get() query_server = { "server_name": "beeswax", # Aka HS2 too "server_host": BEESWAX_SERVER_HOST.get(), "server_port": BEESWAX_SERVER_PORT.get(), "server_interface": SERVER_INTERFACE.get(), "principal": kerberos_principal, } LOG.debug("Query Server: %s" % query_server) return query_server
def get_query_server_config(name='beeswax', requires_ddl=False): if name == 'impala' and not requires_ddl: query_server = { 'server_name': 'impala', 'server_host': SERVER_HOST.get(), 'server_port': SERVER_PORT.get(), 'support_ddl': False, } else: query_server = { 'server_name': 'beeswax', 'server_host': BEESWAX_SERVER_HOST.get(), 'server_port': BEESWAX_SERVER_PORT.get(), 'support_ddl': True, } return query_server
def get_query_server_config(name='beeswax', requires_ddl=False): if name == 'impala' and not requires_ddl: from impala.conf import SERVER_HOST, SERVER_PORT, IMPALA_PRINCIPAL query_server = { 'server_name': 'impala', 'server_host': SERVER_HOST.get(), 'server_port': SERVER_PORT.get(), 'support_ddl': False, 'principal': IMPALA_PRINCIPAL.get() } else: query_server = { 'server_name': 'beeswax', 'server_host': BEESWAX_SERVER_HOST.get(), 'server_port': BEESWAX_SERVER_PORT.get(), 'support_ddl': True, 'principal': KERBEROS.HUE_PRINCIPAL.get() } return query_server