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 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 Details

    • docs

      public static Docs docs()
      Docs docs.
      Returns:
      the docs
    • docs

      public static Docs docs(Long seed)
      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

      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 name
      generator - 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.