phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndimi...@apache.org
Subject phoenix git commit: PHOENIX-1990 bin/queryserver makeWinServiceDesc doesn't actually work in Windows
Date Mon, 01 Jun 2015 18:53:03 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.1 cbf00bc2d -> 404419721


PHOENIX-1990 bin/queryserver makeWinServiceDesc doesn't actually work in Windows


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/40441972
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/40441972
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/40441972

Branch: refs/heads/4.4-HBase-1.1
Commit: 404419721579f51ce1d91b5afac6fa872cd32345
Parents: cbf00bc
Author: Nick Dimiduk <ndimiduk@apache.org>
Authored: Mon May 18 16:00:31 2015 -0700
Committer: Nick Dimiduk <ndimiduk@apache.org>
Committed: Mon Jun 1 11:50:40 2015 -0700

----------------------------------------------------------------------
 bin/queryserver.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/40441972/bin/queryserver.py
----------------------------------------------------------------------
diff --git a/bin/queryserver.py b/bin/queryserver.py
index 6a18741..7666246 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -78,11 +78,22 @@ phoenix_out_file = '%s.out' % phoenix_file_basename
 phoenix_pid_file = '%s.pid' % phoenix_file_basename
 opts = os.getenv('PHOENIX_QUERYSERVER_OPTS', '')
 
-# load hbase-env.sh to extract JAVA_HOME, HBASE_PID_DIR, HBASE_LOG_DIR
-hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.sh')
+# load hbase-env.??? to extract JAVA_HOME, HBASE_PID_DIR, HBASE_LOG_DIR
+hbase_env_path = None
+hbase_env_cmd  = None
+if os.name == 'posix':
+    hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.sh')
+    hbase_env_cmd = ['bash', '-c', 'source %s && env' % hbase_env_path]
+elif os.name == 'nt':
+    hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.cmd')
+    hbase_env_cmd = ['cmd.exe', '/c', 'call %s & set' % hbase_env_path]
+if not hbase_env_path or not hbase_env_cmd:
+    print >> sys.stderr, "hbase-env file unknown on platform %s" % os.name
+    sys.exit(-1)
+
 hbase_env = {}
 if os.path.isfile(hbase_env_path):
-    p = subprocess.Popen(['bash', '-c', 'source %s && env' % hbase_env_path], stdout
= subprocess.PIPE)
+    p = subprocess.Popen(hbase_env_cmd, stdout = subprocess.PIPE)
     for x in p.stdout:
         (k, _, v) = x.partition('=')
         hbase_env[k.strip()] = v.strip()


Mime
View raw message