stoty commented on a change in pull request #20: PHOENIX-5772 Streamline the
kerberos logic in thin client java code
URL: https://github.com/apache/phoenix-queryserver/pull/20#discussion_r392210969
##########
File path: bin/sqlline-thin.py
##########
@@ -92,25 +100,34 @@ def get_serialization():
hbase_cmd = phoenix_utils.which(hbase_exec_name)
if hbase_cmd is None:
- print 'Failed to find hbase executable on PATH, defaulting
serialization to %s.' % default_serialization
- return default_serialization
+ print 'Failed to find hbase executable on PATH, defaulting %s to %s.'
% key, default
+ return default
env['HBASE_CONF_DIR'] = phoenix_utils.hbase_conf_dir
- proc = subprocess.Popen([hbase_cmd,
'org.apache.hadoop.hbase.util.HBaseConfTool', serialization_key],
+ proc = subprocess.Popen([hbase_cmd,
'org.apache.hadoop.hbase.util.HBaseConfTool', key],
env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdout, stderr) = proc.communicate()
if proc.returncode != 0:
- print 'Failed to extract serialization from hbase-site.xml, defaulting
to %s.' % default_serialization
- return default_serialization
+ print 'Failed to extract %s from hbase-site.xml, defaulting to %s.' %
key, default
+ return default
# Don't expect this to happen, but give a default value just in case
if stdout is None:
- return default_serialization
+ return default
stdout = stdout.strip()
if stdout == 'null':
- return default_serialization
+ return default
return stdout
+def get_serialization():
+ return get_hbase_param(serialization_key, default_serialization)
Review comment:
We only call these methods once, so there is no point.
Pulling a full effective config, and then parsing all options from there
would save us noticeable startup time, but I could not find a way to do that.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services