本文整理汇总了Python中beeswax.conf.HIVE_SERVER_PORT.get方法的典型用法代码示例。如果您正苦于以下问题:Python HIVE_SERVER_PORT.get方法的具体用法?Python HIVE_SERVER_PORT.get怎么用?Python HIVE_SERVER_PORT.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类beeswax.conf.HIVE_SERVER_PORT
的用法示例。
在下文中一共展示了HIVE_SERVER_PORT.get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name='beeswax', server=None):
if name == 'impala':
from impala.conf import SERVER_HOST as IMPALA_SERVER_HOST, SERVER_PORT as IMPALA_SERVER_PORT, \
IMPALA_PRINCIPAL, IMPERSONATION_ENABLED, QUERYCACHE_ROWS, QUERY_TIMEOUT_S
query_server = {
'server_name': 'impala',
'server_host': IMPALA_SERVER_HOST.get(),
'server_port': IMPALA_SERVER_PORT.get(),
'principal': IMPALA_PRINCIPAL.get(),
'impersonation_enabled': IMPERSONATION_ENABLED.get(),
'querycache_rows': QUERYCACHE_ROWS.get(),
'QUERY_TIMEOUT_S': QUERY_TIMEOUT_S.get(),
}
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
'server_name': 'beeswax', # Aka HiveServer2 now
'server_host': HIVE_SERVER_HOST.get(),
'server_port': HIVE_SERVER_PORT.get(),
'principal': kerberos_principal,
'http_url': '%(protocol)s://%(host)s:%(port)s/%(end_point)s' % {
'protocol': 'https' if hiveserver2_use_ssl() else 'http',
'host': HIVE_SERVER_HOST.get(),
'port': hive_site.hiveserver2_thrift_http_port(),
'end_point': hive_site.hiveserver2_thrift_http_path()
},
'transport_mode': 'http' if hive_site.hiveserver2_transport_mode() == 'HTTP' else 'socket',
}
LOG.debug("Query Server: %s" % query_server)
return query_server
示例2: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name='beeswax', server=None):
if name == 'impala':
from impala.conf import SERVER_HOST as IMPALA_SERVER_HOST, SERVER_PORT as IMPALA_SERVER_PORT, \
IMPALA_PRINCIPAL, IMPERSONATION_ENABLED, QUERYCACHE_ROWS, QUERY_TIMEOUT_S
query_server = {
'server_name': 'impala',
'server_host': IMPALA_SERVER_HOST.get(),
'server_port': IMPALA_SERVER_PORT.get(),
'principal': IMPALA_PRINCIPAL.get(),
'impersonation_enabled': IMPERSONATION_ENABLED.get(),
'querycache_rows': QUERYCACHE_ROWS.get(),
'QUERY_TIMEOUT_S': QUERY_TIMEOUT_S.get(),
}
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
'server_name': 'beeswax', # Aka HiveServer2 now
'server_host': HIVE_SERVER_HOST.get(),
'server_port': HIVE_SERVER_PORT.get(),
'principal': kerberos_principal
}
LOG.debug("Query Server: %s" % query_server)
return query_server
示例3: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name="beeswax", server=None):
if name == "impala":
from impala.conf import (
SERVER_HOST as IMPALA_SERVER_HOST,
SERVER_PORT as IMPALA_SERVER_PORT,
IMPALA_PRINCIPAL,
IMPERSONATION_ENABLED,
QUERYCACHE_ROWS,
QUERY_TIMEOUT_S,
AUTH_USERNAME as IMPALA_AUTH_USERNAME,
AUTH_PASSWORD as IMPALA_AUTH_PASSWORD,
)
query_server = {
"server_name": "impala",
"server_host": IMPALA_SERVER_HOST.get(),
"server_port": IMPALA_SERVER_PORT.get(),
"principal": IMPALA_PRINCIPAL.get(),
"impersonation_enabled": IMPERSONATION_ENABLED.get(),
"querycache_rows": QUERYCACHE_ROWS.get(),
"QUERY_TIMEOUT_S": QUERY_TIMEOUT_S.get(),
"auth_username": IMPALA_AUTH_USERNAME.get(),
"auth_password": IMPALA_AUTH_PASSWORD.get(),
}
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
"server_name": "beeswax", # Aka HiveServer2 now
"server_host": HIVE_SERVER_HOST.get(),
"server_port": HIVE_SERVER_PORT.get(),
"principal": kerberos_principal,
"http_url": "%(protocol)s://%(host)s:%(port)s/%(end_point)s"
% {
"protocol": "https" if hiveserver2_use_ssl() else "http",
"host": HIVE_SERVER_HOST.get(),
"port": hive_site.hiveserver2_thrift_http_port(),
"end_point": hive_site.hiveserver2_thrift_http_path(),
},
"transport_mode": "http" if hive_site.hiveserver2_transport_mode() == "HTTP" else "socket",
"auth_username": AUTH_USERNAME.get(),
"auth_password": AUTH_PASSWORD.get(),
}
if name == "sparksql": # Spark SQL is almost the same as Hive
from spark.conf import SQL_SERVER_HOST as SPARK_SERVER_HOST, SQL_SERVER_PORT as SPARK_SERVER_PORT
query_server.update(
{"server_name": "sparksql", "server_host": SPARK_SERVER_HOST.get(), "server_port": SPARK_SERVER_PORT.get()}
)
debug_query_server = query_server.copy()
debug_query_server["auth_password_used"] = bool(debug_query_server.pop("auth_password"))
LOG.debug("Query Server: %s" % debug_query_server)
return query_server
示例4: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name='beeswax', server=None):
if name == 'impala':
from impala.conf import SERVER_HOST as IMPALA_SERVER_HOST, SERVER_PORT as IMPALA_SERVER_PORT, \
IMPALA_PRINCIPAL, IMPERSONATION_ENABLED, QUERYCACHE_ROWS, QUERY_TIMEOUT_S, AUTH_USERNAME as IMPALA_AUTH_USERNAME, AUTH_PASSWORD as IMPALA_AUTH_PASSWORD, \
SESSION_TIMEOUT_S
query_server = {
'server_name': 'impala',
'server_host': IMPALA_SERVER_HOST.get(),
'server_port': IMPALA_SERVER_PORT.get(),
'principal': IMPALA_PRINCIPAL.get(),
'impersonation_enabled': IMPERSONATION_ENABLED.get(),
'querycache_rows': QUERYCACHE_ROWS.get(),
'QUERY_TIMEOUT_S': QUERY_TIMEOUT_S.get(),
'SESSION_TIMEOUT_S': SESSION_TIMEOUT_S.get(),
'auth_username': IMPALA_AUTH_USERNAME.get(),
'auth_password': IMPALA_AUTH_PASSWORD.get()
}
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
'server_name': 'beeswax', # Aka HiveServer2 now
'server_host': HIVE_SERVER_HOST.get(),
'server_port': HIVE_SERVER_PORT.get(),
'principal': kerberos_principal,
'http_url': '%(protocol)s://%(host)s:%(port)s/%(end_point)s' % {
'protocol': 'https' if hiveserver2_use_ssl() else 'http',
'host': HIVE_SERVER_HOST.get(),
'port': hive_site.hiveserver2_thrift_http_port(),
'end_point': hive_site.hiveserver2_thrift_http_path()
},
'transport_mode': 'http' if hive_site.hiveserver2_transport_mode() == 'HTTP' else 'socket',
'auth_username': AUTH_USERNAME.get(),
'auth_password': AUTH_PASSWORD.get()
}
if name == 'sparksql': # Spark SQL is almost the same as Hive
from spark.conf import SQL_SERVER_HOST as SPARK_SERVER_HOST, SQL_SERVER_PORT as SPARK_SERVER_PORT
query_server.update({
'server_name': 'sparksql',
'server_host': SPARK_SERVER_HOST.get(),
'server_port': SPARK_SERVER_PORT.get()
})
debug_query_server = query_server.copy()
debug_query_server['auth_password_used'] = bool(debug_query_server.pop('auth_password'))
LOG.debug("Query Server: %s" % debug_query_server)
return query_server
示例5: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name='beeswax', server=None, cluster=None):
LOG.debug("Query cluster %s: %s" % (name, cluster))
cluster_config = get_cluster_config(cluster)
if name == 'impala':
from impala.dbms import get_query_server_config as impala_query_server_config
query_server = impala_query_server_config(cluster_config=cluster_config)
elif name == 'hms':
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
'server_name': 'hms',
'server_host': HIVE_METASTORE_HOST.get() if not cluster_config else cluster_config.get('server_host'),
'server_port': HIVE_METASTORE_PORT.get(),
'principal': kerberos_principal,
'transport_mode': 'http' if hive_site.hiveserver2_transport_mode() == 'HTTP' else 'socket',
'auth_username': AUTH_USERNAME.get(),
'auth_password': AUTH_PASSWORD.get()
}
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
'server_name': 'beeswax',
'server_host': HIVE_SERVER_HOST.get() if not cluster_config else cluster_config.get('server_host'),
'server_port': HIVE_SERVER_PORT.get(),
'principal': kerberos_principal,
'http_url': '%(protocol)s://%(host)s:%(port)s/%(end_point)s' % {
'protocol': 'https' if hiveserver2_use_ssl() else 'http',
'host': HIVE_SERVER_HOST.get(),
'port': hive_site.hiveserver2_thrift_http_port(),
'end_point': hive_site.hiveserver2_thrift_http_path()
},
'transport_mode': 'http' if hive_site.hiveserver2_transport_mode() == 'HTTP' else 'socket',
'auth_username': AUTH_USERNAME.get(),
'auth_password': AUTH_PASSWORD.get()
}
if name == 'sparksql': # Spark SQL is almost the same as Hive
from spark.conf import SQL_SERVER_HOST as SPARK_SERVER_HOST, SQL_SERVER_PORT as SPARK_SERVER_PORT
query_server.update({
'server_name': 'sparksql',
'server_host': SPARK_SERVER_HOST.get(),
'server_port': SPARK_SERVER_PORT.get()
})
debug_query_server = query_server.copy()
debug_query_server['auth_password_used'] = bool(debug_query_server.pop('auth_password'))
LOG.debug("Query Server: %s" % debug_query_server)
return query_server
示例6: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name='beeswax', server=None):
if name == 'impala':
from impala.conf import SERVER_HOST as IMPALA_SERVER_HOST, SERVER_PORT as IMPALA_SERVER_PORT, \
IMPALA_PRINCIPAL, IMPERSONATION_ENABLED
query_server = {
'server_name': 'impala',
'server_host': IMPALA_SERVER_HOST.get(),
'server_port': IMPALA_SERVER_PORT.get(),
'principal': IMPALA_PRINCIPAL.get(),
'impersonation_enabled': IMPERSONATION_ENABLED.get()
}
elif name == 'rdbms':
from rdbms.conf import RDBMS
if not server or server not in RDBMS:
keys = RDBMS.keys()
name = keys and keys[0] or None
else:
name = server
if name:
query_server = {
'server_name': RDBMS[name].ENGINE.get().split('.')[-1],
'server_host': RDBMS[name].HOST.get(),
'server_port': RDBMS[name].PORT.get(),
'username': RDBMS[name].USER.get(),
'password': RDBMS[name].PASSWORD.get(),
'password': RDBMS[name].PASSWORD.get(),
'alias': name
}
else:
query_server = {}
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
'server_name': 'beeswax', # Aka HiveServer2 now
'server_host': HIVE_SERVER_HOST.get(),
'server_port': HIVE_SERVER_PORT.get(),
'principal': kerberos_principal
}
LOG.debug("Query Server: %s" % query_server)
return query_server
示例7: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name='beeswax', server=None):
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
'server_name': 'beeswax', # Aka HiveServer2 now
'server_host': HIVE_SERVER_HOST.get(),
'server_port': HIVE_SERVER_PORT.get(),
'principal': kerberos_principal,
'http_url': '%(protocol)s://%(host)s:%(port)s/%(end_point)s' % {
'protocol': 'https' if SSL.ENABLED.get() else 'http',
'host': HIVE_SERVER_HOST.get(),
'port': hive_site.hiveserver2_thrift_http_port(),
'end_point': hive_site.hiveserver2_thrift_http_path()
},
'transport_mode': hive_site.hiveserver2_transport_mode(),
}
LOG.debug("Query Server: %s" % query_server)
return query_server
示例8: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name="beeswax", server=None):
if name == "impala":
from impala.conf import (
SERVER_HOST as IMPALA_SERVER_HOST,
SERVER_PORT as IMPALA_SERVER_PORT,
IMPALA_PRINCIPAL,
IMPERSONATION_ENABLED,
QUERYCACHE_ROWS,
QUERY_TIMEOUT_S,
)
query_server = {
"server_name": "impala",
"server_host": IMPALA_SERVER_HOST.get(),
"server_port": IMPALA_SERVER_PORT.get(),
"principal": IMPALA_PRINCIPAL.get(),
"impersonation_enabled": IMPERSONATION_ENABLED.get(),
"querycache_rows": QUERYCACHE_ROWS.get(),
"QUERY_TIMEOUT_S": QUERY_TIMEOUT_S.get(),
}
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
"server_name": "beeswax", # Aka HiveServer2 now
"server_host": HIVE_SERVER_HOST.get(),
"server_port": HIVE_SERVER_PORT.get(),
"principal": kerberos_principal,
"http_url": "%(protocol)s://%(host)s:%(port)s/%(end_point)s"
% {
"protocol": "https" if hiveserver2_use_ssl() else "http",
"host": HIVE_SERVER_HOST.get(),
"port": hive_site.hiveserver2_thrift_http_port(),
"end_point": hive_site.hiveserver2_thrift_http_path(),
},
"transport_mode": "http" if hive_site.hiveserver2_transport_mode() == "HTTP" else "socket",
}
LOG.debug("Query Server: %s" % query_server)
return query_server
示例9: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name='beeswax'):
if name == 'impala':
from impala.conf import SERVER_HOST as IMPALA_SERVER_HOST, SERVER_PORT as IMPALA_SERVER_PORT, IMPALA_PRINCIPAL
query_server = {
'server_name': 'impala',
'server_host': IMPALA_SERVER_HOST.get(),
'server_port': IMPALA_SERVER_PORT.get(),
'principal': IMPALA_PRINCIPAL.get(),
}
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
'server_name': 'beeswax', # Aka HiveServer2 now
'server_host': HIVE_SERVER_HOST.get(),
'server_port': HIVE_SERVER_PORT.get(),
'principal': kerberos_principal
}
LOG.debug("Query Server: %s" % query_server)
return query_server
示例10: get_query_server_config
# 需要导入模块: from beeswax.conf import HIVE_SERVER_PORT [as 别名]
# 或者: from beeswax.conf.HIVE_SERVER_PORT import get [as 别名]
def get_query_server_config(name="beeswax", server=None):
if name == "impala":
from impala.dbms import get_query_server_config as impala_query_server_config
query_server = impala_query_server_config()
else:
kerberos_principal = hive_site.get_hiveserver2_kerberos_principal(HIVE_SERVER_HOST.get())
query_server = {
"server_name": "beeswax", # Aka HiveServer2 now
"server_host": HIVE_SERVER_HOST.get(),
"server_port": HIVE_SERVER_PORT.get(),
"principal": kerberos_principal,
"http_url": "%(protocol)s://%(host)s:%(port)s/%(end_point)s"
% {
"protocol": "https" if hiveserver2_use_ssl() else "http",
"host": HIVE_SERVER_HOST.get(),
"port": hive_site.hiveserver2_thrift_http_port(),
"end_point": hive_site.hiveserver2_thrift_http_path(),
},
"transport_mode": "http" if hive_site.hiveserver2_transport_mode() == "HTTP" else "socket",
"auth_username": AUTH_USERNAME.get(),
"auth_password": AUTH_PASSWORD.get(),
}
if name == "sparksql": # Spark SQL is almost the same as Hive
from spark.conf import SQL_SERVER_HOST as SPARK_SERVER_HOST, SQL_SERVER_PORT as SPARK_SERVER_PORT
query_server.update(
{"server_name": "sparksql", "server_host": SPARK_SERVER_HOST.get(), "server_port": SPARK_SERVER_PORT.get()}
)
debug_query_server = query_server.copy()
debug_query_server["auth_password_used"] = bool(debug_query_server.pop("auth_password"))
LOG.debug("Query Server: %s" % debug_query_server)
return query_server