You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jb...@apache.org on 2018/11/19 18:47:29 UTC
impala git commit: IMPALA-7585: support LDAP in run-workload.py
Repository: impala
Updated Branches:
refs/heads/master 2a4835cfb -> e1c9cbd07
IMPALA-7585: support LDAP in run-workload.py
This patch just threads through the user, password, and ssl settings
all the way back to the ImpalaBeeswaxClient.
Change-Id: Ibfa987d8a027f50bc1ba3db5aa355331442a74ba
Reviewed-on: http://gerrit.cloudera.org:8080/11938
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: David Knupp <dk...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/e1c9cbd0
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/e1c9cbd0
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/e1c9cbd0
Branch: refs/heads/master
Commit: e1c9cbd0771cd01776c2db79cf753bf73d786e5a
Parents: 2a4835c
Author: Jim Apple <jb...@apache.org>
Authored: Thu Nov 15 15:50:47 2018 -0800
Committer: Jim Apple <jb...@apache.org>
Committed: Mon Nov 19 18:46:38 2018 +0000
----------------------------------------------------------------------
bin/run-workload.py | 9 +++++++++
tests/performance/query_exec_functions.py | 6 +++++-
tests/performance/query_executor.py | 5 ++++-
tests/performance/workload_runner.py | 3 +++
4 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/impala/blob/e1c9cbd0/bin/run-workload.py
----------------------------------------------------------------------
diff --git a/bin/run-workload.py b/bin/run-workload.py
index 9fd677d..d21dfe4 100755
--- a/bin/run-workload.py
+++ b/bin/run-workload.py
@@ -107,9 +107,18 @@ parser.add_option("--hiveserver", dest="hiveserver", default="localhost",
help=("Host that has HiveServers2 service running"))
parser.add_option("--user", dest="user", default=getpass.getuser(),
help=("User account under which workload/query will run"))
+parser.add_option("--get_password", dest="get_password", default=False,
+ action="store_true", help=("Prompt for password for user account"))
+parser.add_option("--use_ssl", dest="use_ssl", action="store_true", default=False,
+ help=("Whether to use SSL or not"))
options, args = parser.parse_args()
+options.password = None
+if options.get_password:
+ options.password = getpass.getpass()
+ options.get_password = None
+
logging.basicConfig(level=logging.INFO, format='[%(name)s]: %(message)s')
LOG = logging.getLogger('run-workload')
http://git-wip-us.apache.org/repos/asf/impala/blob/e1c9cbd0/tests/performance/query_exec_functions.py
----------------------------------------------------------------------
diff --git a/tests/performance/query_exec_functions.py b/tests/performance/query_exec_functions.py
index 0366291..1c144bd 100644
--- a/tests/performance/query_exec_functions.py
+++ b/tests/performance/query_exec_functions.py
@@ -149,13 +149,17 @@ def establish_beeswax_connection(query_config):
ImpalaBeeswaxClient is the connection suceeds, None otherwise.
"""
use_kerberos = query_config.use_kerberos
+ user = query_config.user
+ password = query_config.password
+ use_ssl = query_config.use_ssl
# If the impalad is for the form host, convert it to host:port that the Impala beeswax
# client accepts.
if len(query_config.impalad.split(":")) == 1:
query_config.impalad = "{0}:{1}".format(query_config.impalad, DEFAULT_BEESWAX_PORT)
client = None
try:
- client = ImpalaBeeswaxClient(query_config.impalad, use_kerberos=use_kerberos)
+ client = ImpalaBeeswaxClient(query_config.impalad, use_kerberos=use_kerberos,
+ user=user, password=password, use_ssl=use_ssl)
# Try connect
client.connect()
# Set the exec options.
http://git-wip-us.apache.org/repos/asf/impala/blob/e1c9cbd0/tests/performance/query_executor.py
----------------------------------------------------------------------
diff --git a/tests/performance/query_executor.py b/tests/performance/query_executor.py
index 501f34a..344ebbf 100644
--- a/tests/performance/query_executor.py
+++ b/tests/performance/query_executor.py
@@ -157,12 +157,15 @@ class BeeswaxQueryExecConfig(ImpalaQueryExecConfig):
"""
def __init__(self, use_kerberos=False, exec_options=None, impalad='localhost:21000',
- plugin_runner=None):
+ plugin_runner=None, user=None, password=None, use_ssl=False):
super(BeeswaxQueryExecConfig, self).__init__(plugin_runner=plugin_runner,
impalad=impalad)
self.use_kerberos = use_kerberos
self.exec_options = dict()
self._build_options(exec_options)
+ self.user = user
+ self.password = password
+ self.use_ssl = use_ssl
def _build_options(self, exec_options):
"""Read the exec_options into self.exec_options
http://git-wip-us.apache.org/repos/asf/impala/blob/e1c9cbd0/tests/performance/workload_runner.py
----------------------------------------------------------------------
diff --git a/tests/performance/workload_runner.py b/tests/performance/workload_runner.py
index 9cee7e0..24b353f 100644
--- a/tests/performance/workload_runner.py
+++ b/tests/performance/workload_runner.py
@@ -97,6 +97,9 @@ class WorkloadRunner(object):
BeeswaxQueryExecConfig(plugin_runner=self.config.plugin_runner,
exec_options=self.config.exec_options,
use_kerberos=self.config.use_kerberos,
+ user=self.config.user if self.config.password else None,
+ password=self.config.password,
+ use_ssl=self.config.use_ssl
)),
'impala_jdbc': lambda: (execute_using_jdbc,
JdbcQueryExecConfig(plugin_runner=self.config.plugin_runner)