-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmapReduce.py
More file actions
31 lines (25 loc) · 1.15 KB
/
mapReduce.py
File metadata and controls
31 lines (25 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from master import Master
class MapReduce:
def __init__(self, mappers, reducers, filePaths, outputCountFilePath, outputInvertedIndexFilePath):
self.nMappers = mappers
self.nReducers = reducers
self.filePaths = filePaths
self.fileMaxSize = 10000
self.outputCountFile = outputCountFilePath
self.outputInvertedIndexFile = outputInvertedIndexFilePath
pass
def initialiseMaster(self):
master1 = Master(self.nMappers, self.nReducers, self.filePaths, self.fileMaxSize, self.outputCountFile, self.outputInvertedIndexFile)
master1.start()
master1.join()
pass
if __name__ == "__main__":
mappers = 10
reducers = 10
filePaths = ["/Users/tanukansal/Documents/distributedSystems/MapReduce-Distributed-Systems/input/file1.txt",
"/Users/tanukansal/Documents/distributedSystems/MapReduce-Distributed-Systems/input/file2.txt"
]
outputCountFilePath = 'count-output.txt'
outputInvertedIndexFilePath = 'inverted-index-output.txt'
mapReduce = MapReduce(mappers, reducers, filePaths, outputCountFilePath, outputInvertedIndexFilePath)
mapReduce.initialiseMaster()