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-1909 queryserver.py accept PHOENIX_QUERYSERVER_OPTS
Date Fri, 24 Apr 2015 02:04:04 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 03ea5fcc3 -> 030204b32


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 030204b329f7435faf4752691db892b40d6d055c
Parents: 03ea5fc
Author: Nick Dimiduk <ndimiduk@apache.org>
Authored: Thu Apr 23 13:54:56 2015 -0700
Committer: Nick Dimiduk <ndimiduk@apache.org>
Committed: Thu Apr 23 19:04:05 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/030204b3/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())


Mime
View raw message