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

Add support to clear-buffer-cache.py for checking SPARK_HOME for slaves #342

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

rnowling
Copy link

clear-buffer-cache.py assumes the slaves file is located under /root/spark-ec2/slaves . This is not consistent with the Spark setup guide for custom deployments.

I added the ability to find the slaves file relative to the SPARK_HOME environmental variable, if set. If the slaves file cannot be found in either location, an error is raised.

…spark-ec2/slaves . This is not consistent with the Spark setup guide.

I added the ability to find the slaves file relative to the SPARK_HOME environmental variable, if set.  If the slaves file cannot be found
in either location, an error is raised.
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

machinesFile = spark_home + "/conf/slaves"
if not os.path.exists(machinesFile):
print "Could not find Spark slaves file. Based on SPARK_HOME, expected file to be located at %s" % machinesFile
sys.exit(1)
Copy link

Choose a reason for hiding this comment

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

suggested refactor - lift the test out of the if spark_home is None block, use a generic message

…anged variable names to camel case for consistency, and prioritized EC2 location to maintain compatibility with original script.
@rnowling
Copy link
Author

Incorporated mattf's suggestion. I also updated the variables to use camel case to be consistent with the rest of the script and prioritized the EC2 file location to maintain compatibility with original version of script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants