Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (19 sloc) 756 Bytes
#-*-coding: utf-8 -*-
import sys
from movies_count import MoviesCount
from moviesSimilarities import MoviesSimilarities
writer = open('teste.txt', 'w')
mr_job = MoviesCount(args=[sys.argv[1], '-r', 'emr'])
with mr_job.make_runner() as runner:
runner.run()
for line in runner.stream_output():
key, value = mr_job.parse_output_line(line)
writer.write(key.encode('utf-8') + '\n')
writer.close()
mr_job2 = MoviesSimilarities(args=['teste.txt', '--num-ec2-instances', '5', '-r', 'emr'])
#'--python-archive', 'Documents/Projects/articles/mapreduce/metrics.tar.gz'])
with mr_job2.make_runner() as runner:
runner.run()
for line in runner.stream_output():
key, value = mr_job2.parse_output_line(line)
print key