MP7 MapReduce
|
#include <pthread.h>
#include "libdictionary.h"
Go to the source code of this file.
Data Structures | |
struct | mapreduce_t |
Functions | |
void | mapreduce_init (mapreduce_t *mr, void(*mymap)(int, const char *), const char *(*myreduce)(const char *, const char *)) |
This function will be the first call made to the libmapreduce library. | |
void | mapreduce_map_all (mapreduce_t *mr, const char **values) |
Main function of this MP. | |
void | mapreduce_reduce_all (mapreduce_t *mr) |
This function should block until all map()'ing and reduce()'ing has completed. | |
const char * | mapreduce_get_value (mapreduce_t *mr, const char *result_key) |
This function should return the current value of result_key. | |
void | mapreduce_destroy (mapreduce_t *mr) |
Free all your memory. |
void mapreduce_destroy | ( | mapreduce_t * | mr | ) |
Free all your memory.
:) Will always be called last.
const char* mapreduce_get_value | ( | mapreduce_t * | mr, |
const char * | result_key | ||
) |
This function should return the current value of result_key.
If the result_key does not exist, return NULL.
void mapreduce_init | ( | mapreduce_t * | mr, |
void(*)(int, const char *) | mymap, | ||
const char *(*)(const char *, const char *) | myreduce | ||
) |
This function will be the first call made to the libmapreduce library.
You should put any initialization logic here
mymap | map function |
myreduce | reduce function |
void mapreduce_map_all | ( | mapreduce_t * | mr, |
const char ** | values | ||
) |
Main function of this MP.
values | contains a NULL-terminated array of C-strings. |