Skip to content

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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 16 additions & 1 deletion bin/dev/clear-buffer-cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,23 @@
import os
import thread
import time
import sys

machinesFile = "/root/spark-ec2/slaves"
EC2_MACHINES_FILE = "/root/spark-ec2/slaves"

sparkHome = os.getenv("SPARK_HOME")

machinesFile = None
if os.path.exists(EC2_MACHINES_FILE):
machinesFile = EC2_MACHINES_FILE
elif sparkHome is not None and os.path.exists(sparkHome + "/conf/slaves"):
machinesFile = sparkHome + "/conf/slaves"

if machinesFile is None:
print "Could not find Spark slaves file."
sys.exit(1)


machs = open(machinesFile).readlines()
machs = map(lambda s: s.strip(),machs)
machCount = len(machs)
Expand Down