Package org.apache.solr.bench
Class Docs
java.lang.Object
org.apache.solr.bench.Docs
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 SolrInputDocument at a time, or you
can call preGenerate(int) to generate the given number of documents in RAM, and then retrieve
them via generatedDocsIterator().
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear.static Docsdocs()Docs docs.static DocsDocs docs.org.apache.solr.common.SolrDocumentdocument()Document solr document.Field docs.Field docs.CircularIterator<org.apache.solr.common.SolrInputDocument> Generated docs circular iterator.Iterator<org.apache.solr.common.SolrInputDocument> Generated docs iterator.org.apache.solr.common.SolrInputDocumentInput document solr input document.Iterator<org.apache.solr.common.SolrInputDocument> preGenerate(int numDocs) Pre generate iterator.
-
Method Details
-
docs
Docs docs.- Returns:
- the docs
-
docs
Docs docs.- Parameters:
seed- the seed- 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
Generated docs iterator.- Returns:
- the iterator
-
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
Field docs.- Parameters:
name- the namegenerator- the generator- Returns:
- the docs
-
field
Field docs.- Parameters:
generator- the generator- Returns:
- the docs
-
clear
public void clear()Clear.
-