You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by nd...@apache.org on 2015/04/24 04:03:38 UTC

phoenix git commit: PHOENIX-1909 queryserver.py accept PHOENIX_QUERYSERVER_OPTS

Repository: phoenix
Updated Branches:
  refs/heads/master ee5b6707b -> 80898c06b


PHOENIX-1909 queryserver.py accept PHOENIX_QUERYSERVER_OPTS


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

Branch: refs/heads/master
Commit: 80898c06bfb183bf889faad0a8bb5fad54770af6
Parents: ee5b670
Author: Nick Dimiduk <nd...@apache.org>
Authored: Thu Apr 23 13:54:56 2015 -0700
Committer: Nick Dimiduk <nd...@apache.org>
Committed: Thu Apr 23 19:03:30 2015 -0700

----------------------------------------------------------------------
 bin/queryserver.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/80898c06/bin/queryserver.py
----------------------------------------------------------------------
diff --git a/bin/queryserver.py b/bin/queryserver.py
index 5553567..4042f3c 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -68,6 +68,7 @@ phoenix_file_basename = 'phoenix-%s-server' % getpass.getuser()
 phoenix_log_file = '%s.log' % phoenix_file_basename
 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')
@@ -84,6 +85,8 @@ if hbase_env.has_key('HBASE_PID_DIR'):
     hbase_pid_dir = hbase_env['HBASE_PID_DIR']
 if hbase_env.has_key('HBASE_LOG_DIR'):
     phoenix_log_dir = hbase_env['HBASE_LOG_DIR']
+if hbase_env.has_key('PHOENIX_QUERYSERVER_OPTS'):
+    opts = hbase_env['PHOENIX_QUERYSERVER_OPTS']
 
 log_file_path = os.path.join(phoenix_log_dir, phoenix_log_file)
 out_file_path = os.path.join(phoenix_log_dir, phoenix_out_file)
@@ -102,6 +105,7 @@ java_cmd = '%(java)s -cp ' + hbase_config_path + os.pathsep + phoenix_utils.phoe
     " -Dpsql.root.logger=%(root_logger)s" + \
     " -Dpsql.log.dir=%(log_dir)s" + \
     " -Dpsql.log.file=%(log_file)s" + \
+    " " + opts + \
     " org.apache.phoenix.queryserver.server.Main " + args
 
 if command == 'start':
@@ -133,10 +137,14 @@ if command == 'start':
             sys.exit(child.wait())
 
 elif command == 'stop':
-    if not os.path.isfile(out_file_path):
+    if not os.path.exists(pid_file_path):
         print >> sys.stderr, "no Query Server to stop because PID file not found, %s" % pid_file_path
         sys.exit(0)
 
+    if not os.path.isfile(pid_file_path):
+        print >> sys.stderr, "PID path exists but is not a file! %s" % pid_file_path
+        sys.exit(1)
+
     pid = None
     with open(pid_file_path, 'r') as p:
         pid = int(p.read())