Class CloudSolrStream
- java.lang.Object
- 
- org.apache.solr.client.solrj.io.stream.TupleStream
- 
- org.apache.solr.client.solrj.io.stream.CloudSolrStream
 
 
- 
- All Implemented Interfaces:
- Closeable,- Serializable,- AutoCloseable,- Expressible,- org.apache.solr.common.MapSerializable,- org.apache.solr.common.MapWriter,- org.apache.solr.common.NavigableObject,- org.noggit.JSONWriter.Writable
 - Direct Known Subclasses:
- DrillStream,- ParallelStream,- ShuffleStream,- TopicStream
 
 public class CloudSolrStream extends TupleStream implements Expressible Connects to Zookeeper to pick replicas from a specific collection to send the query to. Under the covers the SolrStream instances send the query to the replicas. SolrStreams are opened using a thread pool, but a single thread is used to iterate and merge Tuples from each SolrStream.- Since:
- 5.1.0
- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classCloudSolrStream.StreamOpenerprotected classCloudSolrStream.TupleWrapper- 
Nested classes/interfaces inherited from class org.apache.solr.client.solrj.io.stream.TupleStreamTupleStream.IgnoreException
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected Stringcollectionprotected StreamComparatorcompprotected Map<String,Tuple>eofTuplesprotected Map<String,String>fieldMappingsprotected org.apache.solr.common.params.ModifiableSolrParamsparamsprotected List<TupleStream>solrStreamsprotected StreamContextstreamContextprotected TreeSet<CloudSolrStream.TupleWrapper>tuplesprotected StringzkHost
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedCloudSolrStream()CloudSolrStream(String zkHost, String collectionName, org.apache.solr.common.params.SolrParams params)CloudSolrStream(StreamExpression expression, StreamFactory factory)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Tuple_read()protected org.apache.solr.common.params.ModifiableSolrParamsadjustParams(org.apache.solr.common.params.ModifiableSolrParams params)List<TupleStream>children()voidclose()Closes the CloudSolrStreamprotected voidconstructStreams()Map<String,Tuple>getEofTuples()static org.apache.solr.common.cloud.Slice[]getSlices(String collectionName, org.apache.solr.client.solrj.impl.CloudSolrClient cloudSolrClient, boolean checkAlias)StreamComparatorgetStreamSort()Return the stream sort - ie, the order in which records are returnedvoidopen()Opens the CloudSolrStreamTupleread()voidsetFieldMappings(Map<String,String> fieldMappings)voidsetStreamContext(StreamContext context)voidsetTrace(boolean trace)ExplanationtoExplanation(StreamFactory factory)Returns an explanation about the stream objectStreamExpressiontoExpression(StreamFactory factory)- 
Methods inherited from class org.apache.solr.client.solrj.io.stream.TupleStreamgetCost, getShards, getShards, getStreamNodeId, writeMap
 
- 
 
- 
- 
- 
Field Detail- 
zkHostprotected String zkHost 
 - 
collectionprotected String collection 
 - 
paramsprotected org.apache.solr.common.params.ModifiableSolrParams params 
 - 
compprotected StreamComparator comp 
 - 
solrStreamsprotected transient List<TupleStream> solrStreams 
 - 
tuplesprotected transient TreeSet<CloudSolrStream.TupleWrapper> tuples 
 - 
streamContextprotected transient StreamContext streamContext 
 
- 
 - 
Constructor Detail- 
CloudSolrStreamprotected CloudSolrStream() 
 - 
CloudSolrStreampublic CloudSolrStream(String zkHost, String collectionName, org.apache.solr.common.params.SolrParams params) throws IOException - Parameters:
- zkHost- Zookeeper ensemble connection string
- collectionName- Name of the collection to operate on
- params- Map<String, String[]> of parameter/value pairs
- Throws:
- IOException- Something went wrong
 
 - 
CloudSolrStreampublic CloudSolrStream(StreamExpression expression, StreamFactory factory) throws IOException - Throws:
- IOException
 
 
- 
 - 
Method Detail- 
toExpressionpublic StreamExpression toExpression(StreamFactory factory) throws IOException - Specified by:
- toExpressionin interface- Expressible
- Throws:
- IOException
 
 - 
toExplanationpublic Explanation toExplanation(StreamFactory factory) throws IOException Description copied from interface:ExpressibleReturns an explanation about the stream object- Specified by:
- toExplanationin interface- Expressible
- Specified by:
- toExplanationin class- TupleStream
- Parameters:
- factory- Stream factory for this, contains information about the function name
- Returns:
- Explanation about this stream object containing explanations of any child stream objects
- Throws:
- IOException- throw on any error
 
 - 
setTracepublic void setTrace(boolean trace) 
 - 
setStreamContextpublic void setStreamContext(StreamContext context) - Specified by:
- setStreamContextin class- TupleStream
 
 - 
openpublic void open() throws IOExceptionOpens the CloudSolrStream- Specified by:
- openin class- TupleStream
- Throws:
- IOException
 
 - 
childrenpublic List<TupleStream> children() - Specified by:
- childrenin class- TupleStream
 
 - 
getSlicespublic static org.apache.solr.common.cloud.Slice[] getSlices(String collectionName, org.apache.solr.client.solrj.impl.CloudSolrClient cloudSolrClient, boolean checkAlias) throws IOException - Throws:
- IOException
 
 - 
constructStreamsprotected void constructStreams() throws IOException- Throws:
- IOException
 
 - 
closepublic void close() throws IOExceptionCloses the CloudSolrStream- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein class- TupleStream
- Throws:
- IOException
 
 - 
getStreamSortpublic StreamComparator getStreamSort() Return the stream sort - ie, the order in which records are returned- Specified by:
- getStreamSortin class- TupleStream
 
 - 
readpublic Tuple read() throws IOException - Specified by:
- readin class- TupleStream
- Throws:
- IOException
 
 - 
_readprotected Tuple _read() throws IOException - Throws:
- IOException
 
 - 
adjustParamsprotected org.apache.solr.common.params.ModifiableSolrParams adjustParams(org.apache.solr.common.params.ModifiableSolrParams params) 
 
- 
 
-