From 7f2f7f7c3e5d4c626d7e8d4d45fee2b11b6d5221 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Thu, 24 Sep 2020 07:24:19 -0500 Subject: rearrange --- P1/Template/include/mapper.h | 46 ------------------------------------ P1/Template/include/mapreduce.h | 6 ----- P1/Template/include/reducer.h | 24 ------------------- P1/Template/include/utils.h | 52 ----------------------------------------- 4 files changed, 128 deletions(-) delete mode 100644 P1/Template/include/mapper.h delete mode 100644 P1/Template/include/mapreduce.h delete mode 100644 P1/Template/include/reducer.h delete mode 100644 P1/Template/include/utils.h (limited to 'P1/Template/include') diff --git a/P1/Template/include/mapper.h b/P1/Template/include/mapper.h deleted file mode 100644 index 2e3693c..0000000 --- a/P1/Template/include/mapper.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef MAPPER_H -#define MAPPER_H - -#include "utils.h" - -// ###### DO NOT REMOVE ###### -#define MAXKEYSZ 100 -#define MAXVALUESZ 100 - -// ###### DO NOT REMOVE ###### -char *mapOutDir; -int mapperID; - - -// You are free to change the intermediate data structure as it suits you -// If you do so, ensure the provided utility functions are also changed -// 1 1 1... -typedef struct valueList { - // MAXVALUESZ can be reduced to a small value as you are only storing "1" - char value[MAXVALUESZ]; - struct valueList *next; -}valueList; - -// word 1 1 1... -typedef struct intermediateDS{ - char key[MAXKEYSZ]; - valueList *value; - struct intermediateDS *next; -}intermediateDS; - -// ###### DO NOT REMOVE ###### -valueList *createNewValueListNode(char *value); -valueList *insertNewValueToList(valueList *root, char *count); -void freeValueList(valueList *root); - -// ###### DO NOT REMOVE ###### -intermediateDS *createNewInterDSNode(char *word, char *count); -intermediateDS *insertPairToInterDS(intermediateDS *root, char *word, char *count); -void freeInterDS(intermediateDS *root); - -// ###### DO NOT REMOVE ###### -void emit(char *key, char *value); -void map(char *chunkData); -void writeIntermediateDS(); - -#endif \ No newline at end of file diff --git a/P1/Template/include/mapreduce.h b/P1/Template/include/mapreduce.h deleted file mode 100644 index 9b5950b..0000000 --- a/P1/Template/include/mapreduce.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef MAPREDUCE_H -#define MAPREDUCE_H - -#include "utils.h" //sendChunkData and shuffle - -#endif \ No newline at end of file diff --git a/P1/Template/include/reducer.h b/P1/Template/include/reducer.h deleted file mode 100644 index 79ea452..0000000 --- a/P1/Template/include/reducer.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef REDUCER_H -#define REDUCER_H - -#include "utils.h" - -#define MAXKEYSZ 50 - -// ###### DO NOT REMOVE ###### -typedef struct finalKeyValueDS { - char key[MAXKEYSZ]; - int value; - struct finalKeyValueDS *next; -} finalKeyValueDS; - -// ###### DO NOT REMOVE ###### -finalKeyValueDS *createFinalKeyValueNode(char *value, int count); -finalKeyValueDS *insertNewKeyValue(finalKeyValueDS *root, char *word, int count); -void freeFinalDS(finalKeyValueDS *root); - -// ###### DO NOT REMOVE ###### -void writeFinalDS(int reducerID); -void reduce(char *key); - -#endif \ No newline at end of file diff --git a/P1/Template/include/utils.h b/P1/Template/include/utils.h deleted file mode 100644 index cfe56f2..0000000 --- a/P1/Template/include/utils.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef UTILS_H -#define UTILS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define chunkSize 1024 -#define MSGSIZE 1100 -#define ENDTYPE 1000 -#define ACKTYPE 1100 - -struct msgBuffer { - long msgType; - char msgText[MSGSIZE]; -}; - -// mapper side -int validChar(char c); -// getWord usage - retrieves words from the chunk passed until it is fully traversed -// given a chunk of data chunkData, the call to getWord should look as below: -// int i = 0; -// char *buffer; -// while ((buffer = getWord(chunkData, &i)) != NULL){ -// your code -// } -char *getWord(char *chunk, int *i); -char *getChunkData(int mapperID); -void sendChunkData(char *inputFile, int nMappers); - - -// reducer side -int hashFunction(char* key, int reducers); -int getInterData(char *key, int reducerID); -void shuffle(int nMappers, int nReducers); - -// directory -void createOutputDir(); -char *createMapDir(int mapperID); -void removeOutputDir(); -void bookeepingCode(); - -#endif \ No newline at end of file -- cgit v1.2.3