Skip to content

Commit

Permalink
Update phoenix command line classpath.
Browse files Browse the repository at this point in the history
  • Loading branch information
litao-buptsse committed Jul 19, 2016
1 parent 432f38c commit 9b6806b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions bin/phoenix_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def findClasspath(command_name):
return subprocess.Popen(command, shell=True, stdout=subprocess.PIPE).stdout.read()

def setPath():
PHOENIX_SERVER_JAR_PATTERN = "phoenix-*-server.jar"
PHOENIX_CLIENT_JAR_PATTERN = "phoenix-*-client.jar"
PHOENIX_THIN_CLIENT_JAR_PATTERN = "phoenix-*-thin-client.jar"
PHOENIX_QUERYSERVER_JAR_PATTERN = "phoenix-server-*-runnable.jar"
Expand Down Expand Up @@ -108,6 +109,13 @@ def setPath():

global phoenix_jar_path
phoenix_jar_path = os.path.join(current_dir, "..", "phoenix-assembly", "target","*")

global phoenix_server_jar
phoenix_server_jar = find(PHOENIX_SERVER_JAR_PATTERN, phoenix_jar_path)
if phoenix_server_jar == "":
phoenix_server_jar = findFileInPathWithoutRecursion(PHOENIX_SERVER_JAR_PATTERN, os.path.join(current_dir, ".."))
if phoenix_server_jar == "":
phoenix_server_jar = find(PHOENIX_SERVER_JAR_PATTERN, phoenix_class_path)

global phoenix_client_jar
phoenix_client_jar = find("phoenix-*-client.jar", phoenix_jar_path)
Expand All @@ -116,6 +124,11 @@ def setPath():
if phoenix_client_jar == "":
phoenix_client_jar = find(PHOENIX_CLIENT_JAR_PATTERN, phoenix_class_path)

global jline_jar
jline_jar = findFileInPathWithoutRecursion("jline-*.jar", os.path.join(current_dir, "..", "lib"))
global sqlline_jar
sqlline_jar = findFileInPathWithoutRecursion("sqlline-*.jar", os.path.join(current_dir, "..", "lib"))

global phoenix_test_jar_path
phoenix_test_jar_path = os.path.join(current_dir, "..", "phoenix-core", "target","*")

Expand Down Expand Up @@ -205,6 +218,7 @@ def shell_quote(args):
print "hbase_conf_path:", hbase_conf_path
print "current_dir:", current_dir
print "phoenix_jar_path:", phoenix_jar_path
print "phoenix_server_jar:", phoenix_server_jar
print "phoenix_client_jar:", phoenix_client_jar
print "phoenix_test_jar_path:", phoenix_test_jar_path
print "hadoop_common_jar_path:", hadoop_common_jar_path
Expand Down
2 changes: 1 addition & 1 deletion bin/sqlline.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def kill_child():
colorSetting = "false"

java_cmd = java + ' $PHOENIX_OPTS ' + \
' -cp "' + phoenix_utils.hbase_conf_dir + os.pathsep + phoenix_utils.phoenix_client_jar + os.pathsep + phoenix_utils.hadoop_common_jar + os.pathsep + phoenix_utils.hadoop_hdfs_jar + \
' -cp "' + phoenix_utils.hbase_conf_dir + os.pathsep + phoenix_utils.phoenix_server_jar + os.pathsep + phoenix_utils.jline_jar + os.pathsep + phoenix_utils.sqlline_jar + os.pathsep + phoenix_utils.hadoop_common_jar + os.pathsep + phoenix_utils.hadoop_hdfs_jar + \
os.pathsep + phoenix_utils.hadoop_conf + os.pathsep + phoenix_utils.hadoop_classpath + '" -Dlog4j.configuration=file:' + \
os.path.join(phoenix_utils.current_dir, "log4j.properties") + \
" sqlline.SqlLine -d org.apache.phoenix.jdbc.PhoenixDriver \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
<unpack>false</unpack>
<outputDirectory>/lib</outputDirectory>
<includes>
<include>jline:jline</include>
<include>sqlline:sqlline</include>
<include>commons-configuration:commons-configuration</include>
<include>commons-io:commons-io</include>
<include>commons-lang:commons-lang</include>
<include>commons-logging:commons-logging</include>
<include>org.apache.commons:commons-csv</include>
<include>com.google.guava:guava</include>
<include>org.apache.hadoop:hadoop*</include>
<!--<include>org.apache.hadoop:hadoop*</include>-->
<include>com.google.protobuf:protobuf-java</include>
<include>org.slf4j:slf4j-api</include>
<include>org.apache.zookeeper:zookeeper</include>
Expand Down

0 comments on commit 9b6806b

Please sign in to comment.