com.basho.riak.client.query
Class BucketKeyMapReduce

java.lang.Object
  extended by com.basho.riak.client.query.MapReduce
      extended by com.basho.riak.client.query.BucketKeyMapReduce
All Implemented Interfaces:
RiakOperation<MapReduceResult>, Iterable<String[]>

public class BucketKeyMapReduce
extends MapReduce
implements Iterable<String[]>

Map/Reduce over a set of bucket/key/keydata inputs.

Author:
russell
See Also:
IRiakClient.mapReduce()

Constructor Summary
BucketKeyMapReduce(RawClient client)
          The RawClient to execute the Map/Reduce query Use IRiakClient.mapReduce() as a factory to create your map/reduce operation.
 
Method Summary
 BucketKeyMapReduce addInput(String bucket, String key)
          Add a bucket, key input to the query
 BucketKeyMapReduce addInput(String bucket, String key, String keyData)
          Add a bucket, key, keydata to the list of inputs for the m/r query
 Iterator<String[]> iterator()
          An UnmodifiableIterator view of the inputs for this Map/Reduce job.
protected  void validate()
          Check that this map/reduce job is valid
protected  void writeInput(org.codehaus.jackson.JsonGenerator jsonGenerator)
          Override to write the input specification of the M/R job.
 
Methods inherited from class com.basho.riak.client.query.MapReduce
addLinkPhase, addLinkPhase, addMapPhase, addMapPhase, addMapPhase, addMapPhase, addReducePhase, addReducePhase, addReducePhase, addReducePhase, execute, timeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BucketKeyMapReduce

public BucketKeyMapReduce(RawClient client)
The RawClient to execute the Map/Reduce query Use IRiakClient.mapReduce() as a factory to create your map/reduce operation.

Parameters:
client -
Method Detail

addInput

public BucketKeyMapReduce addInput(String bucket,
                                   String key,
                                   String keyData)
Add a bucket, key, keydata to the list of inputs for the m/r query

Parameters:
bucket -
key -
keyData -
Returns:
this

addInput

public BucketKeyMapReduce addInput(String bucket,
                                   String key)
Add a bucket, key input to the query

Parameters:
bucket -
key -
Returns:

iterator

public Iterator<String[]> iterator()
An UnmodifiableIterator view of the inputs for this Map/Reduce job.

Specified by:
iterator in interface Iterable<String[]>

writeInput

protected void writeInput(org.codehaus.jackson.JsonGenerator jsonGenerator)
                   throws IOException
Description copied from class: MapReduce
Override to write the input specification of the M/R job.

Specified by:
writeInput in class MapReduce
Parameters:
jsonGenerator - a Jackson JsonGenerator to write the input spec to
Throws:
IOException

validate

protected void validate()
Description copied from class: MapReduce
Check that this map/reduce job is valid

Overrides:
validate in class MapReduce


Copyright © 2012. All Rights Reserved.