Repository: phoenix
Updated Branches:
  refs/heads/4.0 a1cd9f575 -> 2c4831bd9


PHOENIX-1072: Fast fail sqlline.py when pass wrong quorum string or hbase 
cluster hasnt' started yet


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

Branch: refs/heads/4.0
Commit: 2c4831bd9eb7c816ac96fad8002de18da10089b2
Parents: a1cd9f5
Author: Jeffrey Zhong <jeffr...@apache.org>
Authored: Wed Jul 16 17:27:14 2014 -0700
Committer: Jeffrey Zhong <jeffr...@apache.org>
Committed: Wed Jul 16 17:29:41 2014 -0700

----------------------------------------------------------------------
 bin/log4j.properties |  4 +++-
 bin/sqlline.py       | 14 +++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2c4831bd/bin/log4j.properties
----------------------------------------------------------------------
diff --git a/bin/log4j.properties b/bin/log4j.properties
index 30119bc..47d45e8 100644
--- a/bin/log4j.properties
+++ b/bin/log4j.properties
@@ -65,5 +65,7 @@ log4j.appender.console.layout=org.apache.log4j.PatternLayout
 log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p 
%c{2}: %m%n
 
 # Custom Logging levels
-log4j.logger.org.apache.zookeeper=WARN
+log4j.logger.org.apache.zookeeper=ERROR
+log4j.logger.org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper=ERROR
+log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=ERROR
 log4j.logger.org.apache.hadoop.hbase.HBaseConfiguration=ERROR

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2c4831bd/bin/sqlline.py
----------------------------------------------------------------------
diff --git a/bin/sqlline.py b/bin/sqlline.py
index 00fccdb..d42be07 100755
--- a/bin/sqlline.py
+++ b/bin/sqlline.py
@@ -23,6 +23,15 @@ import os
 import subprocess
 import sys
 import phoenix_utils
+import atexit
+
+global childProc
+childProc = None
+def kill_child():
+    if childProc is not None:
+        childProc.terminate()
+        childProc.kill()
+atexit.register(kill_child)
 
 phoenix_utils.setPath()
 
@@ -50,4 +59,7 @@ java_cmd = 'java -cp ".' + os.pathsep + 
phoenix_utils.phoenix_client_jar + \
     " -n none -p none --color=" + colorSetting + " --fastConnect=false 
--verbose=true \
 --isolation=TRANSACTION_READ_COMMITTED " + sqlfile
 
-subprocess.call(java_cmd, shell=True)
+childProc = subprocess.Popen(java_cmd, shell=True)
+#Wait for child process exit
+(output, error) = childProc.communicate()
+childProc = None

Reply via email to