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,org.apache.solr.common.MapWriter,org.apache.solr.common.NavigableObject,org.noggit.JSONWriter.Writable
Queries a single Solr instance and maps SolrDocs to a Stream of Tuples.
- Since:
- 5.1.0
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.solr.client.solrj.io.stream.TupleStream
TupleStream.IgnoreExceptionNested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
org.apache.solr.common.MapWriter.EntryWriter -
Constructor Summary
ConstructorsConstructorDescriptionSolrStream(String baseUrl, String core, String path, org.apache.solr.common.params.SolrParams params) SolrStream(String collectionOrCoreUrl, String path, org.apache.solr.common.params.SolrParams params) Deprecated.Use base URL constructor instead.SolrStream(String collectionOrCoreUrl, org.apache.solr.common.params.SolrParams params) Deprecated.Use base URL constructor instead.SolrStream(String baseUrl, org.apache.solr.common.params.SolrParams params, String core) -
Method Summary
Modifier and TypeMethodDescriptionchildren()voidclose()Closes the Stream to a single Solr InstancebooleanThere is no known sort applied to a SolrStreamvoidopen()Opens the stream to a single Solr instance.read()Reads a Tuple from the stream.voidsetCheckpoint(long checkpoint) voidsetCredentials(String user, String password) voidsetDistrib(boolean distrib) voidsetFieldMappings(Map<String, String> fieldMappings) voidvoidsetStreamContext(StreamContext context) voidsetTrace(boolean trace) Setting trace to true will include the "_CORE_" field in each Tuple emitted by the stream.toExplanation(StreamFactory factory) Methods inherited from class org.apache.solr.client.solrj.io.stream.TupleStream
buildSolrParamsExcept, getCost, getShards, getShards, getStreamNodeId, writeMapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.common.MapWriter
jsonStr, writeMethods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
-
Constructor Details
-
SolrStream
@Deprecated(since="10.1") public SolrStream(String collectionOrCoreUrl, org.apache.solr.common.params.SolrParams params) Deprecated.Use base URL constructor instead.- Parameters:
collectionOrCoreUrl- URL of the Solr core or collection to query, typically of the form "http://host:8983/solr/myCore".params- query-parameters sent with the streaming request
-
SolrStream
@Deprecated(since="10.1") public SolrStream(String collectionOrCoreUrl, String path, org.apache.solr.common.params.SolrParams params) Deprecated.Use base URL constructor instead.- Parameters:
collectionOrCoreUrl- URL of the Solr core or collection to query, typically of the form "http://host:8983/solr/myCore".path- the request handler path to query (e.g. "/export"). If not provided, defaults to "/select".params- query-parameters sent with the streaming request
-
SolrStream
- Parameters:
baseUrl- the Solr node's "base" URL (i.e. no core or collection in the pathparams- query-parameters sent with the streaming requestcore- the name of the collection or core to query; must be hosted atbaseUrl
-
SolrStream
public SolrStream(String baseUrl, String core, String path, org.apache.solr.common.params.SolrParams params) - Parameters:
baseUrl- the Solr node's "base" URL (i.e. no core or collection in the pathcore- the name of the collection or core to query; must be hosted atbaseUrlpath- the request handler path to query (e.g. "/export"). If not provided (i.e.null), the handler is instead resolved from a "qt" param embedded inparams, or defaults to "/select" if no such param is present.params- query-parameters sent with the streaming request
-
-
Method Details
-
setFieldMappings
-
children
- Specified by:
childrenin classTupleStream
-
getBaseUrl
-
setStreamContext
- Specified by:
setStreamContextin classTupleStream
-
setCredentials
-
open
Opens the stream to a single Solr instance.- Specified by:
openin classTupleStream- 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
-
setCheckpoint
public void setCheckpoint(long checkpoint) -
toExplanation
- Specified by:
toExplanationin classTupleStream- Throws:
IOException
-
close
Closes the Stream to a single Solr Instance- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classTupleStream- Throws:
IOException
-
read
Reads a Tuple from the stream. The Stream is completed when Tuple.EOF == true.- Specified by:
readin classTupleStream- Throws:
IOException
-
setDistrib
public void setDistrib(boolean distrib) -
getDistrib
public boolean getDistrib() -
getStreamSort
There is no known sort applied to a SolrStream- Specified by:
getStreamSortin classTupleStream
-