Research Article
Performance Comparison of OpenMP, MPI, and MapReduce in Practical Problems
Algorithm 7
MapReduce pseudocode for the join problem.
MAP for Korean Wikipedia: | Input Korean Wikipedia XML File | MAP(Object key = null, Page input = Korean Wikipedia file) | line input.readLine() | title searchTitle(line) | content searchContent(line) | wordListEngKeyword(content) | for all word wordList do | write(word, input) | MAP for English Wikipedia File | Input: English Wikipedia XML File | MAP(Object key = null, Page input = English Wikipedia file) | line input.readLine() | Title(line) | url searchUrl(line) | Page out(title:title, url:url) | write(title, out) | REDUCE(Text key, Page , , …) | | | list new List<Page> | for all , , … do | if IsEnglish() then | word .getTitle() | url .getUrl() | else | list.add() | for all koreanPage list do | koreanPage.setWord(word) | koreanPage.setUrl(url) | write(key, koreanPage) |
|