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, 18 May 2015 23:45:42 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 fc19c0e7b -> 1b943dbf2


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/1b943dbf
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1b943dbf
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1b943dbf

Branch: refs/heads/4.x-HBase-0.98
Commit: 1b943dbf21d1bda56b21289218f6a2feb6903f59
Parents: fc19c0e
Author: Nick Dimiduk <ndimiduk@apache.org>
Authored: Mon May 18 16:00:31 2015 -0700
Committer: Nick Dimiduk <ndimiduk@apache.org>
Committed: Mon May 18 16:43:35 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1b943dbf/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