public abstract class MapReduce
extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
XNOCOMP
execution option: avoid compression of temporary databases
|
static int |
XNOLOCK
execution option: avoid locking against update operations
|
| Constructor and Description |
|---|
MapReduce() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
emit(byte[] key,
byte[] value)
Emit a record from the mapper.
|
boolean |
execute(DB db,
String tmppath,
int opts)
Execute the MapReduce process about a database.
|
boolean |
log(String name,
String message)
Process a log message.
|
abstract boolean |
map(byte[] key,
byte[] value)
Map a record data.
|
boolean |
midprocess()
Mediate between the map and the reduce phases.
|
boolean |
postprocess()
Postprocess the reduce operations.
|
boolean |
preprocess()
Preprocess the map operations.
|
abstract boolean |
reduce(byte[] key,
ValueIterator iter)
Reduce a record data.
|
public static final int XNOCOMP
public static final int XNOLOCK
protected boolean emit(byte[] key,
byte[] value)
key - specifies the key.value - specifies the value.public boolean execute(DB db, String tmppath, int opts)
db - the source database.tmppath - the path of a directory for the temporary data storage. If it is an empty
string, temporary data are handled on memory.opts - the optional features by bitwise-or: MapReduce::XNOLOCK to avoid locking
against update operations by other threads, MapReduce::XNOCOMP to avoid compression of
temporary databases.public boolean log(String name,
String message)
name - the name of the event.message - a supplement message.public abstract boolean map(byte[] key,
byte[] value)
key - specifies the key.value - specifies the value.public boolean midprocess()
public boolean postprocess()
public boolean preprocess()
public abstract boolean reduce(byte[] key,
ValueIterator iter)
key - specifies the key.iter - the iterator to get the values.