当前位置: 首页>>代码示例>>Python>>正文


Python conf.HIVE_SERVER_PORT类代码示例

本文整理汇总了Python中beeswax.conf.HIVE_SERVER_PORT的典型用法代码示例。如果您正苦于以下问题:Python HIVE_SERVER_PORT类的具体用法?Python HIVE_SERVER_PORT怎么用?Python HIVE_SERVER_PORT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HIVE_SERVER_PORT类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_query_server_config

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
开发者ID:jounex,项目名称:hue,代码行数:34,代码来源:dbms.py

示例2: get_query_server_config

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
开发者ID:9629831527,项目名称:hue,代码行数:27,代码来源:dbms.py

示例3: get_query_server_config

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
开发者ID:RoxC,项目名称:hue,代码行数:56,代码来源:dbms.py

示例4: get_query_server_config

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
开发者ID:rhmiller47,项目名称:hue,代码行数:51,代码来源:dbms.py

示例5: get_query_server_config

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
开发者ID:cloudera,项目名称:hue,代码行数:51,代码来源:dbms.py

示例6: get_query_server_config

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
开发者ID:jackesh,项目名称:hue,代码行数:47,代码来源:dbms.py

示例7: get_query_server_config

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
开发者ID:OpenPOWER-BigData,项目名称:HDP-hue,代码行数:20,代码来源:dbms.py

示例8: get_query_server_config

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
开发者ID:cyc821211,项目名称:hue,代码行数:41,代码来源:dbms.py

示例9: get_query_server_config

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
开发者ID:altoplano,项目名称:hue,代码行数:22,代码来源:dbms.py

示例10: get_query_server_config

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
开发者ID:fnerdwq,项目名称:hue,代码行数:37,代码来源:dbms.py


注:本文中的beeswax.conf.HIVE_SERVER_PORT类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。