header file

This commit is contained in:
Remzi Arpaci-Dusseau
2018-04-11 13:29:31 -05:00
parent 5cad27d789
commit b7eb7399b4
2 changed files with 22 additions and 2 deletions

View File

@@ -90,8 +90,9 @@ infrastructure does the rest.
## Code Overview
We give you here `mapreduce.h` file that specifies exactly what you must build
in your MapReduce library:
We give you here the
[`mapreduce.h`](https://github.com/remzi-arpacidusseau/ostep-projects/tree/master/concurrency-mapreduce/mapreduce.h)
header file that specifies exactly what you must build in your MapReduce library:
```
#ifndef __mapreduce_h__

View File

@@ -0,0 +1,19 @@
#ifndef __mapreduce_h__
#define __mapreduce_h__
typedef char *(*Getter)();
typedef void (*Mapper)(char *file_name);
typedef void (*Reducer)(char *key, Getter get_func, int partition_number);
typedef unsigned long (*Partitioner)(char *key, int num_buckets);
void MR_Emit(char *key, char *value);
unsigned long MR_DefaultHashPartition(char *key, int num_buckets);
void MR_Run(int argc, char *argv[],
Mapper map, int num_mappers,
Reducer reduce, int num_reducers,
Partitioner partition);
#endif // __mapreduce_h__