com.basho.riak.client.query
Class BucketMapReduce

java.lang.Object
  extended by com.basho.riak.client.query.MapReduce
      extended by com.basho.riak.client.query.BucketMapReduce
All Implemented Interfaces:
RiakOperation<MapReduceResult>, Iterable<KeyFilter>

public class BucketMapReduce
extends MapReduce
implements Iterable<KeyFilter>

Map/Reduce over a bucket, optionally add Key Filters to narrow the inputs.

Author:
russell
See Also:
IRiakClient.mapReduce(String)

Constructor Summary
BucketMapReduce(RawClient client, String bucket)
          Create a Map Reduce job over the specified bucket to be executed by the specified RawClient.
 
Method Summary
 BucketMapReduce addKeyFilter(KeyFilter keyFilter)
          Add a KeyFilter to the inputs for the Map/Reduce job
 BucketMapReduce addKeyFilters(KeyFilter... keyFilters)
          Add one or some KeyFilters to this map/reduce operations inputs
 String getBucket()
          Get the bucket input for the M/R job
 Iterator<KeyFilter> iterator()
          Unmodifiable copy iterator view of the list of KeyFilters for this M/R operation.
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, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BucketMapReduce

public BucketMapReduce(RawClient client,
                       String bucket)
Create a Map Reduce job over the specified bucket to be executed by the specified RawClient. Use IRiakClient.mapReduce(String) to create your BucketMapReduce

Parameters:
client - the RawClient to use
bucket - the input to the M/R job
Method Detail

getBucket

public String getBucket()
Get the bucket input for the M/R job

Returns:
the bucket

iterator

public Iterator<KeyFilter> iterator()
Unmodifiable copy iterator view of the list of KeyFilters for this M/R operation. Does not read or write through to internal BucketInput state.

Specified by:
iterator in interface Iterable<KeyFilter>

addKeyFilters

public BucketMapReduce addKeyFilters(KeyFilter... keyFilters)
Add one or some KeyFilters to this map/reduce operations inputs

Parameters:
keyFilters - var arg of KeyFilters
Returns:
this

addKeyFilter

public BucketMapReduce addKeyFilter(KeyFilter keyFilter)
Add a KeyFilter to the inputs for the Map/Reduce job

Parameters:
keyFilter - the KeyFilter to add
Returns:
this

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


Copyright © 2012. All Rights Reserved.