phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeffr...@apache.org
Subject [40/50] git commit: allow client script to use cosutom class path
Date Mon, 10 Mar 2014 06:20:57 GMT
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/master
Commit: 90c7e8b3e3feed4ee45d7d94a70ed22b2ca39497
Parents: 456cfa3
Author: Jeffrey Zhong <jzhong@JZhongs-MacBook-Pro.local>
Authored: Wed Mar 5 14:47:21 2014 -0800
Committer: Jeffrey Zhong <jzhong@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:


Mime
View raw message