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


Python conf.HIVE_SERVER_HOST类代码示例

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


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

  LOG.debug("Query Server: %s" % query_server)

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

示例3: test_dump_config

def test_dump_config():
  c = make_logged_in_client()

  CANARY = "abracadabra"

  # Depending on the order of the conf.initialize() in settings, the set_for_testing() are not seen in the global settings variable
  clear = HIVE_SERVER_HOST.set_for_testing(CANARY)

  response1 = c.get(reverse('desktop.views.dump_config'))
  assert_true(CANARY in response1.content, response1.content)

  response2 = c.get(reverse('desktop.views.dump_config'), dict(private="true"))
  assert_true(CANARY in response2.content)

  # There are more private variables...
  assert_true(len(response1.content) < len(response2.content))

  clear()

  CANARY = "(localhost|127\.0\.0\.1):(50030|50070|50060|50075)"
  clear = proxy.conf.WHITELIST.set_for_testing(CANARY)

  response1 = c.get(reverse('desktop.views.dump_config'))
  assert_true(CANARY in response1.content)

  clear()

  # Malformed port per HUE-674
  CANARY = "asdfoijaoidfjaosdjffjfjaoojosjfiojdosjoidjfoa"
  clear = HIVE_SERVER_HOST.set_for_testing(CANARY)

  response1 = c.get(reverse('desktop.views.dump_config'))
  assert_true(CANARY in response1.content, response1.content)

  clear()

  CANARY = '/tmp/spacé.dat'
  finish = proxy.conf.WHITELIST.set_for_testing(CANARY)
  try:
    response = c.get(reverse('desktop.views.dump_config'))
    assert_true(CANARY in response.content, response.content)
  finally:
    finish()

  # Not showing some passwords
  response = c.get(reverse('desktop.views.dump_config'))
  assert_false('bind_password' in response.content)

  # Login as someone else
  client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
  grant_access("not_me", "test", "desktop")

  response = client_not_me.get(reverse('desktop.views.dump_config'))
  assert_true("You must be a superuser" in response.content, response.content)

  os.environ["HUE_CONF_DIR"] = "/tmp/test_hue_conf_dir"
  resp = c.get(reverse('desktop.views.dump_config'))
  del os.environ["HUE_CONF_DIR"]
  assert_true('/tmp/test_hue_conf_dir' in resp.content, resp)
开发者ID:iAmGhost,项目名称:hue,代码行数:59,代码来源:tests.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,
        )

        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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

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