Package org.apache.solr.bench
Class Docs
- java.lang.Object
-
- org.apache.solr.bench.Docs
-
public class Docs extends Object
A tool to generate controlled random data for a benchmark.SolrInputDocuments are created based on supplied FieldDef definitions.You can call getDocument to build and retrieve one
SolrInputDocumentat a time, or you can callpreGenerate(int)to generate the given number of documents in RAM, and then retrieve them viageneratedDocsIterator().
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear.static Docsdocs()Docs docs.static Docsdocs(Long seed)Docs docs.org.apache.solr.common.SolrDocumentdocument()Document solr document.Docsfield(String name, org.quicktheories.core.Gen<?> generator)Field docs.Docsfield(SolrGen<?> generator)Field docs.CircularIterator<org.apache.solr.common.SolrInputDocument>generatedDocsCircularIterator()Generated docs circular iterator.Iterator<org.apache.solr.common.SolrInputDocument>generatedDocsIterator()Generated docs iterator.org.apache.solr.common.SolrInputDocumentinputDocument()Input document solr input document.Iterator<org.apache.solr.common.SolrInputDocument>preGenerate(int numDocs)Pre generate iterator.
-
-
-
Method Detail
-
docs
public static Docs docs()
Docs docs.- Returns:
- the docs
-
preGenerate
public Iterator<org.apache.solr.common.SolrInputDocument> preGenerate(int numDocs) throws InterruptedException
Pre generate iterator.- Parameters:
numDocs- the num docs- Returns:
- the iterator
- Throws:
InterruptedException- the interrupted exception
-
generatedDocsIterator
public Iterator<org.apache.solr.common.SolrInputDocument> generatedDocsIterator()
Generated docs iterator.- Returns:
- the iterator
-
generatedDocsCircularIterator
public CircularIterator<org.apache.solr.common.SolrInputDocument> generatedDocsCircularIterator()
Generated docs circular iterator.- Returns:
- the iterator that never ends
-
inputDocument
public org.apache.solr.common.SolrInputDocument inputDocument()
Input document solr input document.- Returns:
- the solr input document
-
document
public org.apache.solr.common.SolrDocument document()
Document solr document.- Returns:
- the solr document
-
field
public Docs field(String name, org.quicktheories.core.Gen<?> generator)
Field docs.- Parameters:
name- the namegenerator- the generator- Returns:
- the docs
-
field
public Docs field(SolrGen<?> generator)
Field docs.- Parameters:
generator- the generator- Returns:
- the docs
-
clear
public void clear()
Clear.
-
-