Skip to content
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