Class DeepRandomStream
- java.lang.Object
- 
- org.apache.solr.client.solrj.io.stream.TupleStream
- 
- org.apache.solr.client.solrj.io.stream.DeepRandomStream
 
 
- 
- 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
 
 public class DeepRandomStream 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 classDeepRandomStream.StreamOpenerprotected classDeepRandomStream.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 Deque<DeepRandomStream.TupleWrapper>tuplesprotected StringzkHost
 - 
Constructor SummaryConstructors Constructor Description DeepRandomStream()DeepRandomStream(String zkHost, String collectionName, org.apache.solr.common.params.SolrParams params)DeepRandomStream(StreamExpression expression, StreamFactory factory)
 - 
Method SummaryAll 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()protected voidconstructStreams()StreamComparatorgetStreamSort()Return the stream sort - ie, the order in which records are returnedvoidopen()Tupleread()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 Deque<DeepRandomStream.TupleWrapper> tuples 
 - 
streamContextprotected transient StreamContext streamContext 
 
- 
 - 
Constructor Detail- 
DeepRandomStreampublic DeepRandomStream() 
 - 
DeepRandomStreampublic DeepRandomStream(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
 
 - 
DeepRandomStreampublic DeepRandomStream(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 IOException- Specified by:
- openin class- TupleStream
- Throws:
- IOException
 
 - 
childrenpublic List<TupleStream> children() - Specified by:
- childrenin class- TupleStream
 
 - 
constructStreamsprotected void constructStreams() throws IOException- Throws:
- IOException
 
 - 
closepublic void close() throws IOException- 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) 
 
- 
 
-