com.basho.riak.pbc
Class MapReduceResponseSource

java.lang.Object
  extended by com.basho.riak.pbc.MapReduceResponseSource
All Implemented Interfaces:
Iterable<MapReduceResponse>

public class MapReduceResponseSource
extends Object

Wraps a stream of m/r responses as an iterator.


Field Summary
protected  com.basho.riak.pbc.RiakConnection conn
           
 
Constructor Summary
protected MapReduceResponseSource(RiakClient client, com.basho.riak.pbc.RiakConnection conn, com.google.protobuf.ByteString contentType)
           
 
Method Summary
 void close()
           
 boolean hasNext()
           
 boolean isClosed()
           
 Iterator<T> iterator()
           
 MapReduceResponse next()
           
static JSONArray readAllResults(MapReduceResponseSource response)
          Buffer the full set of results into a JSONArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

protected com.basho.riak.pbc.RiakConnection conn
Constructor Detail

MapReduceResponseSource

protected MapReduceResponseSource(RiakClient client,
                                  com.basho.riak.pbc.RiakConnection conn,
                                  com.google.protobuf.ByteString contentType)
                           throws IOException
Throws:
IOException
Method Detail

hasNext

public boolean hasNext()
                throws IOException
Throws:
IOException

next

public MapReduceResponse next()
                       throws IOException
Throws:
IOException

readAllResults

public static JSONArray readAllResults(MapReduceResponseSource response)
                                throws IOException
Buffer the full set of results into a JSONArray

Parameters:
response - the MapReduceResponseSource
Returns:
a JSONArray with all phases and all results.
Throws:
IOException

close

public void close()

isClosed

public boolean isClosed()

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>


Copyright © 2012. All Rights Reserved.