You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by je...@apache.org on 2014/03/05 23:55:36 UTC
[50/50] [abbrv] git commit: allow client script to use cosutom class
path
allow client script to use cosutom class path
Project: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/commit/90c7e8b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/tree/90c7e8b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/diff/90c7e8b3
Branch: refs/heads/4.0
Commit: 90c7e8b3e3feed4ee45d7d94a70ed22b2ca39497
Parents: 456cfa3
Author: Jeffrey Zhong <jz...@JZhongs-MacBook-Pro.local>
Authored: Wed Mar 5 14:47:21 2014 -0800
Committer: Jeffrey Zhong <jz...@JZhongs-MacBook-Pro.local>
Committed: Wed Mar 5 14:47:21 2014 -0800
----------------------------------------------------------------------
bin/performance.py | 14 ++++++++++----
bin/psql.py | 9 +++++++--
bin/sqlline.py | 9 +++++++--
3 files changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/90c7e8b3/bin/performance.py
----------------------------------------------------------------------
diff --git a/bin/performance.py b/bin/performance.py
index 9ebb5bf..8361b05 100755
--- a/bin/performance.py
+++ b/bin/performance.py
@@ -26,6 +26,10 @@ import sys
def find(pattern, path):
+ # remove * if it's at the end of path
+ if ((path is not None) and (len(path) > 0) and (path[-1] == '*')) :
+ path = path[:-1]
+
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
@@ -70,11 +74,13 @@ qry = "query.sql"
statements = ""
current_dir = os.path.dirname(os.path.abspath(__file__))
-phoenix_jar_path = os.path.join(current_dir, "..", "phoenix-assembly",
- "target")
+phoenix_jar_path = os.getenv('PHOENIX_LIB_DIR',
+ os.path.join(current_dir, "..", "phoenix-assembly",
+ "target"))
phoenix_client_jar = find("phoenix-*-client.jar", phoenix_jar_path)
-phoenix_test_jar_path = os.path.join(current_dir, "..", "phoenix-core",
- "target")
+phoenix_test_jar_path = os.getenv('PHOENIX_LIB_DIR',
+ os.path.join(current_dir, "..", "phoenix-core",
+ "target"))
testjar = find("phoenix-*-tests.jar", phoenix_test_jar_path)
http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/90c7e8b3/bin/psql.py
----------------------------------------------------------------------
diff --git a/bin/psql.py b/bin/psql.py
index 372a2ed..b84e090 100755
--- a/bin/psql.py
+++ b/bin/psql.py
@@ -26,6 +26,10 @@ import sys
def find(pattern, path):
+ # remove * if it's at the end of path
+ if ((path is not None) and (len(path) > 0) and (path[-1] == '*')) :
+ path = path[:-1]
+
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
@@ -33,8 +37,9 @@ def find(pattern, path):
return ""
current_dir = os.path.dirname(os.path.abspath(__file__))
-phoenix_jar_path = os.path.join(current_dir, "..", "phoenix-assembly",
- "target")
+phoenix_jar_path = os.getenv('PHOENIX_LIB_DIR',
+ os.path.join(current_dir, "..", "phoenix-assembly",
+ "target"))
phoenix_client_jar = find("phoenix-*-client.jar", phoenix_jar_path)
# HBase configuration folder path (where hbase-site.xml reside) for
http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/90c7e8b3/bin/sqlline.py
----------------------------------------------------------------------
diff --git a/bin/sqlline.py b/bin/sqlline.py
index 097861c..381595f 100755
--- a/bin/sqlline.py
+++ b/bin/sqlline.py
@@ -26,6 +26,10 @@ import sys
def find(pattern, path):
+ # remove * if it's at the end of path
+ if ((path is not None) and (len(path) > 0) and (path[-1] == '*')) :
+ path = path[:-1]
+
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
@@ -33,8 +37,9 @@ def find(pattern, path):
return ""
current_dir = os.path.dirname(os.path.abspath(__file__))
-phoenix_jar_path = os.path.join(current_dir, "..", "phoenix-assembly",
- "target")
+phoenix_jar_path = os.getenv('PHOENIX_LIB_DIR',
+ os.path.join(current_dir, "..", "phoenix-assembly",
+ "target"))
phoenix_client_jar = find("phoenix-*-client.jar", phoenix_jar_path)
if len(sys.argv) < 2: