Fix argv handling in Python transitive closure example

This commit is contained in:
Jey Kottalam 2013-03-10 06:16:19 +00:00
Родитель 2be2295ff2
Коммит 20604001e2
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -24,7 +24,7 @@ if __name__ == "__main__":
"Usage: PythonTC <master> [<slices>]" "Usage: PythonTC <master> [<slices>]"
exit(-1) exit(-1)
sc = SparkContext(sys.argv[1], "PythonTC") sc = SparkContext(sys.argv[1], "PythonTC")
slices = sys.argv[2] if len(sys.argv) > 2 else 2 slices = int(sys.argv[2]) if len(sys.argv) > 2 else 2
tc = sc.parallelize(generateGraph(), slices).cache() tc = sc.parallelize(generateGraph(), slices).cache()
# Linear transitive closure: each round grows paths by one edge, # Linear transitive closure: each round grows paths by one edge,