MP7 MapReduce
libmapreduce.h File Reference
#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.

Detailed Description


Function Documentation

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

Parameters:
mymapmap function
myreducereduce function
Returns:
Void
void mapreduce_map_all ( mapreduce_t mr,
const char **  values 
)

Main function of this MP.

Parameters:
valuescontains a NULL-terminated array of C-strings.
Returns:
Void
 All Data Structures Files Functions