public class MapReduce extends Object
MongoCollection.mapReduce(com.allanbank.mongodb.builder.MapReduce)
command.
Objects of this class are created using the nested MapReduce.Builder
.Modifier and Type | Class and Description |
---|---|
static class |
MapReduce.Builder
Helper for creating immutable
MapReduce commands. |
static class |
MapReduce.OutputType
Enumeration of the possible output types.
|
Modifier and Type | Field and Description |
---|---|
static Version |
MAX_TIMEOUT_VERSION
The first version of MongoDB to support the
mapreduce command
with the ability to limit the execution time on the server. |
Modifier | Constructor and Description |
---|---|
protected |
MapReduce(MapReduce.Builder builder)
Create a new MapReduce.
|
Modifier and Type | Method and Description |
---|---|
static MapReduce.Builder |
builder()
Creates a new builder for a
MapReduce . |
String |
getFinalizeFunction()
Returns the finalize function to apply to the final results of the reduce
function.
|
int |
getLimit()
Returns the limit for the number of objects to be used as input to the
map/reduce.
|
String |
getMapFunction()
Returns the map functions to apply to each selected document.
|
long |
getMaximumTimeMilliseconds()
Returns the maximum amount of time to allow the command to run on the
Server before it is aborted.
|
String |
getOutputDatabase()
Returns the name of the output database if the output type is One of
MapReduce.OutputType.REPLACE , MapReduce.OutputType.MERGE , or
MapReduce.OutputType.REDUCE . |
String |
getOutputName()
Returns the name of the output collection if the output type is One of
MapReduce.OutputType.REPLACE , MapReduce.OutputType.MERGE , or
MapReduce.OutputType.REDUCE . |
MapReduce.OutputType |
getOutputType()
Returns the handling for the output of the map/reduce.
|
Document |
getQuery()
Returns the query to select the documents to run the map/reduce against.
|
ReadPreference |
getReadPreference()
Returns the
ReadPreference specifying which servers may be used
to execute the MapReduce command. |
String |
getReduceFunction()
Returns the reduce function to apply to the emitted output of the map
function.
|
Document |
getScope()
Returns the scoped values to expose to the map/reduce/finalize functions.
|
Document |
getSort()
Returns the sort to apply to the input objects.
|
boolean |
isJsMode()
Returns true to limit the translation of the documents to an from
BSON/JavaScript.
|
boolean |
isKeepTemp()
Returns true to drop the temporary collections created during the
map/reduce.
|
boolean |
isVerbose()
Returns true to emit progress messages in the server logs.
|
public static final Version MAX_TIMEOUT_VERSION
mapreduce
command
with the ability to limit the execution time on the server.protected MapReduce(MapReduce.Builder builder)
builder
- The builder to copy state from.public static MapReduce.Builder builder()
MapReduce
.MapReduce
.public String getFinalizeFunction()
public int getLimit()
public String getMapFunction()
public long getMaximumTimeMilliseconds()
public String getOutputDatabase()
MapReduce.OutputType.REPLACE
, MapReduce.OutputType.MERGE
, or
MapReduce.OutputType.REDUCE
.MapReduce.OutputType.REPLACE
, MapReduce.OutputType.MERGE
, or
MapReduce.OutputType.REDUCE
.public String getOutputName()
MapReduce.OutputType.REPLACE
, MapReduce.OutputType.MERGE
, or
MapReduce.OutputType.REDUCE
.MapReduce.OutputType.REPLACE
, MapReduce.OutputType.MERGE
, or
MapReduce.OutputType.REDUCE
.public MapReduce.OutputType getOutputType()
public Document getQuery()
public ReadPreference getReadPreference()
ReadPreference
specifying which servers may be used
to execute the MapReduce
command.
If null
then the MongoCollection
instance's
ReadPreference
will be used.
NOTE: Passing of read preferences to a mongos
does not
work in a sharded configuration. The query will always be run on the
primary members of all shards.
MongoCollection.getReadPreference()
public String getReduceFunction()
public Document getScope()
public Document getSort()
public boolean isJsMode()
public boolean isKeepTemp()
public boolean isVerbose()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.