public abstract class MapReduce extends Object implements RiakOperation<MapReduceResult>
See Map/Reduce for details.
IRiakClient.mapReduce()
,
IRiakClient.mapReduce(String)
Constructor and Description |
---|
MapReduce(RawClient client)
Create the MapRedcue operation with the
RawClient to delegate to. |
Modifier and Type | Method and Description |
---|---|
MapReduce |
addLinkPhase(String bucket,
String tag)
Create a Link Phase that points to
bucket / tag
keep will be false |
MapReduce |
addLinkPhase(String bucket,
String tag,
boolean keep)
Add a Link Phase that points to
bucket / tag
. |
MapReduce |
addMapPhase(Function phaseFunction)
Add a MapPhase
|
MapReduce |
addMapPhase(Function phaseFunction,
boolean keep)
Add
MapPhase to the query |
MapReduce |
addMapPhase(Function phaseFunction,
Object arg)
Add a MapPhase
|
MapReduce |
addMapPhase(Function phaseFunction,
Object arg,
boolean keep)
Add a MapPhase
|
MapReduce |
addReducePhase(Function phaseFunction)
Add a
ReducePhase |
MapReduce |
addReducePhase(Function phaseFunction,
boolean keep)
Add
ReducePhase to the query |
MapReduce |
addReducePhase(Function phaseFunction,
Object arg)
Add a
ReducePhase |
MapReduce |
addReducePhase(Function phaseFunction,
Object arg,
boolean keep)
Add a
ReducePhase |
MapReduceResult |
execute()
Run the Map/Reduce job against the
RawClient the operation was
constructed with. |
MapReduce |
timeout(long timeout)
Set the operations timeout
|
protected void |
validate()
Check that this map/reduce job is valid
|
protected abstract void |
writeInput(com.fasterxml.jackson.core.JsonGenerator jsonGenerator)
Override to write the input specification of the M/R job.
|
public MapReduce(RawClient client)
RawClient
to delegate to.client
- a RawClient
IRiakClient.mapReduce()
,
IRiakClient.mapReduce(String)
public MapReduceResult execute() throws RiakException
RawClient
the operation was
constructed with.execute
in interface RiakOperation<MapReduceResult>
MapReduceResult
containing the results of the query.RiakException
InvalidMapReduceException
protected void validate()
InvalidMapReduceException
public MapReduce timeout(long timeout)
timeout
- public MapReduce addMapPhase(Function phaseFunction, boolean keep)
MapPhase
to the queryphaseFunction
- the Function
keep
- keep the results and return them with the query results?public MapReduce addMapPhase(Function phaseFunction, Object arg, boolean keep)
phaseFunction
- the Function
arg
- an argument that will be passed to the phase verbatim
(Object#toString)keep
- if the result should be returned or merely provide input for
the next phase.public MapReduce addMapPhase(Function phaseFunction, Object arg)
phaseFunction
- the Function
arg
- an argument that will be passed to the phase verbatim
(Object#toString)public MapReduce addMapPhase(Function phaseFunction)
phaseFunction
- the Function
public MapReduce addReducePhase(Function phaseFunction, boolean keep)
ReducePhase
to the queryphaseFunction
- the Function
keep
- keep the results and return them with the query results?public MapReduce addReducePhase(Function phaseFunction, Object arg, boolean keep)
ReducePhase
phaseFunction
- the Function
arg
- an argument that will be passed to the phase verbatim
(Object#toString)keep
- if the result should be returned or merely provide input for
the next phase.public MapReduce addReducePhase(Function phaseFunction, Object arg)
ReducePhase
phaseFunction
- the Function
arg
- an argument that will be passed to the phase verbatimpublic MapReduce addReducePhase(Function phaseFunction)
ReducePhase
phaseFunction
- public MapReduce addLinkPhase(String bucket, String tag, boolean keep)
bucket
/ tag
.bucket
- the bucket at the end of the link (or "_" or "" for wildcard)tag
- the tag (or ("_", or "" for wildcard)keep
- to keep the result of this phase and return it at the end of
the operationpublic MapReduce addLinkPhase(String bucket, String tag)
bucket
/ tag
keep
will be false
bucket
- the bucket at the end of the link (or "_" or "" for wildcard)tag
- the tag (or ("_", or "" for wildcard)protected abstract void writeInput(com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws IOException
jsonGenerator
- a Jackson JsonGenerator
to write the input spec toIOException
Copyright © 2013. All Rights Reserved.