org.apache.solr.client.solrj.io.stream

## Class SolrStream

- java.lang.Object
- - org.apache.solr.client.solrj.io.stream.TupleStream
  - - org.apache.solr.client.solrj.io.stream.SolrStream

All Implemented Interfaces:
  Closeable, Serializable, AutoCloseable, MapSerializable, MapWriter, NavigableObject

    public class SolrStream
    extends TupleStream

Queries a single Solr instance and maps SolrDocs to a Stream of Tuples.

Since:
  5.1.0
See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `SolrStream.HandledException`

### Nested classes/interfaces inherited from class org.apache.solr.client.solrj.io.stream.TupleStream

`TupleStream.IgnoreException`

### Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

### Constructor Summary

Constructors
Constructor and Description
`SolrStream(String baseUrl, SolrParams params)`

### Method Summary

All Methods Instance Methods Concrete Methods
`List<TupleStream>` `children()`
`void` `close()` Closes the Stream to a single Solr Instance
`TupleStreamParser` `constructParser(SolrClient server, SolrParams requestParams)`
`String` `getBaseUrl()`
`StreamComparator` `getStreamSort()` There is no known sort applied to a SolrStream
`void` `open()` Opens the stream to a single Solr instance.
`Tuple` `read()` Reads a Tuple from the stream.
`void` `setCheckpoint(long checkpoint)`
`void` `setFieldMappings(Map<String,String> fieldMappings)`
`void` `setSlice(String slice)`
`void` `setStreamContext(StreamContext context)`
`void` `setTrace(boolean trace)` Setting trace to true will include the "_CORE_" field in each Tuple emitted by the stream.
`Explanation` `toExplanation(StreamFactory factory)`

### Methods inherited from class org.apache.solr.client.solrj.io.stream.TupleStream

`getCost, getShards, getStreamNodeId, writeMap`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.solr.common.MapWriter

`jsonStr, toMap`

### Methods inherited from interface org.apache.solr.common.NavigableObject

`_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr`

### Constructor Detail

#### SolrStream

    public SolrStream(String baseUrl,
                      SolrParams params)

Parameters:
  `baseUrl` - Base URL of the stream.
  `params` - Map<String, String> of parameters

### Method Detail

#### setFieldMappings

    public void setFieldMappings(Map<String,String> fieldMappings)

#### children

    public List<TupleStream> children()

Specified by:
  `children` in class `TupleStream`

#### getBaseUrl

    public String getBaseUrl()

#### setStreamContext

    public void setStreamContext(StreamContext context)

Specified by:
  `setStreamContext` in class `TupleStream`

#### open

    public void open()
              throws IOException

Opens the stream to a single Solr instance.

Specified by:
  `open` in class `TupleStream`
Throws:
  `IOException`

#### setTrace

    public void setTrace(boolean trace)

Setting trace to true will include the "_CORE_" field in each Tuple emitted by the stream.

#### setSlice

    public void setSlice(String slice)

#### setCheckpoint

    public void setCheckpoint(long checkpoint)

#### toExplanation

    public Explanation toExplanation(StreamFactory factory)
                              throws IOException

Specified by:
  `toExplanation` in class `TupleStream`
Throws:
  `IOException`

#### close

    public void close()
               throws IOException

Closes the Stream to a single Solr Instance

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in class `TupleStream`
Throws:
  `IOException`

#### read

    public Tuple read()
               throws IOException

Reads a Tuple from the stream. The Stream is completed when Tuple.EOF == true.

Specified by:
  `read` in class `TupleStream`
Throws:
  `IOException`

#### getStreamSort

    public StreamComparator getStreamSort()

There is no known sort applied to a SolrStream

Specified by:
  `getStreamSort` in class `TupleStream`

#### constructParser

    public TupleStreamParser constructParser(SolrClient server,
                                             SolrParams requestParams)
                                      throws IOException,
                                             SolrServerException

Throws:
  `IOException`
  `SolrServerException`