Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHOENIX-7145 Use embedded client in PQS startup script #158

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions bin/phoenix_queryserver_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def findClasspath(command_name):
return tryDecode(subprocess.Popen(command, shell=True, stdout=subprocess.PIPE).stdout.read())

def setPath():
PHOENIX_CLIENT_EMBEDDED_JAR_PATTERN = "phoenix-client-embedded*.jar"
PHOENIX_CLIENT_JAR_PATTERN = "phoenix-client-*.jar"
OLD_PHOENIX_CLIENT_JAR_PATTERN = "phoenix-*[!n]-client.jar"
PHOENIX_THIN_CLIENT_JAR_PATTERN = "phoenix-queryserver-client-*.jar"
Expand Down Expand Up @@ -131,11 +132,16 @@ def setPath():
phoenix_queryserver_classpath = os.path.join(current_dir, "../lib/*")

global phoenix_client_jar
phoenix_client_jar = find(PHOENIX_CLIENT_JAR_PATTERN, phoenix_class_path)
phoenix_client_jar = find(PHOENIX_CLIENT_EMBEDDED_JAR_PATTERN, phoenix_class_path)
if phoenix_client_jar == "":
phoenix_client_jar = find(OLD_PHOENIX_CLIENT_JAR_PATTERN, phoenix_class_path)
phoenix_client_jar = findFileInPathWithoutRecursion(PHOENIX_CLIENT_EMBEDDED_JAR_PATTERN, os.path.join(current_dir, ".."))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched the ordering around so that we search for the each pattern in both locations, instead of searching one location for each pattern, then searching the other one for each pattern.

if phoenix_client_jar == "":
print ("could not find embedded client jar, falling back to old client variants")
phoenix_client_jar = find(PHOENIX_CLIENT_JAR_PATTERN, phoenix_class_path)
if phoenix_client_jar == "":
phoenix_client_jar = findFileInPathWithoutRecursion(PHOENIX_CLIENT_JAR_PATTERN, os.path.join(current_dir, ".."))
if phoenix_client_jar == "":
phoenix_client_jar = find(OLD_PHOENIX_CLIENT_JAR_PATTERN, phoenix_class_path)
if phoenix_client_jar == "":
phoenix_client_jar = findFileInPathWithoutRecursion(OLD_PHOENIX_CLIENT_JAR_PATTERN, os.path.join(current_dir, ".."))

Expand Down
Loading