-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapred.h
More file actions
59 lines (43 loc) · 1.12 KB
/
Copy pathmapred.h
File metadata and controls
59 lines (43 loc) · 1.12 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// struct for the ut hashmap
struct
wordDictionary
{
char* key; // using the word as the key
int value; // number of occurrence of the word
UT_hash_handle hh;
}; typedef struct wordDictionary *wordDictionaryPtr;
// struct for sorting thread information
typedef struct
{
int id;
char* file;
wordDictionaryPtr wdptr;
} _thread_id;
void
addWordReduce(char* word, wordDictionaryPtr* wdptr,int count);
void
addWord(char* word, wordDictionaryPtr* wdptr);
void
deleteGeneratedFiles(char* file);
void
free_uthash(wordDictionaryPtr wdptr);
void
mapFile(char* infile, int fileNum, wordDictionaryPtr *holder);
void*
mapperController(void *arg);
void
masterReduce(wordDictionaryPtr *master,wordDictionaryPtr *wdptr);
void
print_words(wordDictionaryPtr* wdptr);
void
readFile(char* name, wordDictionaryPtr* wdptr);
void
runTheMappers(int numberOfMappers, char* baseFileName, int numberOfReducers);
int
sortWord(wordDictionaryPtr ptr1, wordDictionaryPtr ptr2);
void
splitFile(char* fileName, char* numberOfPieces);
void
writeWordCount(char* file, wordDictionaryPtr* wdptr);
void
writeWordSort(char* file, wordDictionaryPtr* wdptr);