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 RawClientIRiakClient.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.RiakExceptionInvalidMapReduceExceptionprotected void validate()
InvalidMapReduceExceptionpublic MapReduce timeout(long timeout)
timeout - public MapReduce addMapPhase(Function phaseFunction, boolean keep)
MapPhase to the queryphaseFunction - the Functionkeep - keep the results and return them with the query results?public MapReduce addMapPhase(Function phaseFunction, Object arg, boolean keep)
phaseFunction - the Functionarg - 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 Functionarg - an argument that will be passed to the phase verbatim
(Object#toString)public MapReduce addMapPhase(Function phaseFunction)
phaseFunction - the Functionpublic MapReduce addReducePhase(Function phaseFunction, boolean keep)
ReducePhase to the queryphaseFunction - the Functionkeep - keep the results and return them with the query results?public MapReduce addReducePhase(Function phaseFunction, Object arg, boolean keep)
ReducePhasephaseFunction - the Functionarg - 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)
ReducePhasephaseFunction - the Functionarg - an argument that will be passed to the phase verbatimpublic MapReduce addReducePhase(Function phaseFunction)
ReducePhasephaseFunction - 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 falsebucket - 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 toIOExceptionCopyright © 2014. All Rights Reserved.