From 5c11a1ee292f9d51d697910a95a2a93884ff8d0f Mon Sep 17 00:00:00 2001 From: Andrea Smith Date: Mon, 5 Oct 2020 20:47:49 -0500 Subject: Comments --- P1/src/reducer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/P1/src/reducer.c b/P1/src/reducer.c index 9519fa3..cf91e31 100644 --- a/P1/src/reducer.c +++ b/P1/src/reducer.c @@ -45,6 +45,10 @@ void freeFinalDS(finalKeyValueDS *root) { // reduce function void reduce(char *key) { + // Calculate the total count of values (1's) for the word from [the_word].txt + // Store the total count in finalKeyValueDS + // Lather, rinse, repeat for all the words + } @@ -60,11 +64,11 @@ void writeFinalDS(int reducerID){ char filename[BUFFSIZE] = ""; sprintf(filename, "output/ReduceOut/Reduce_%d.txt", reducerID); FILE* fptr = fopen(filename, "w"); - fprintf(fptr, "%s %s", tempNode -> key, tempNode -> value); + fprintf(fptr, "%s %d", tempNode -> key, tempNode -> value); fclose(fptr); tempNode = tempNode -> next; } - freeInterDS(root -> next); + freeFinalDS(root -> next); } int main(int argc, char *argv[]) { -- cgit v1.2.3