org.apache.lucene.benchmark.byTask.feeds
Class DocMaker

java.lang.Object
  extended by org.apache.lucene.benchmark.byTask.feeds.DocMaker
Direct Known Subclasses:
EnwikiDocMaker, LineDocMaker

public class DocMaker
extends java.lang.Object

Creates Document objects. Uses a ContentSource to generate DocData objects. Supports the following parameters:


Field Summary
static java.lang.String BODY_FIELD
           
protected  Field.Index bodyIndexVal
           
static java.lang.String BYTES_FIELD
           
protected  Config config
           
static java.lang.String DATE_FIELD
           
static java.lang.String ID_FIELD
           
protected  boolean indexProperties
           
protected  Field.Index indexVal
           
static java.lang.String NAME_FIELD
           
protected  boolean reuseFields
           
protected  ContentSource source
           
protected  Field.Store storeVal
           
protected  Field.TermVector termVecVal
           
static java.lang.String TITLE_FIELD
           
 
Constructor Summary
DocMaker()
           
 
Method Summary
 void close()
          Closes the DocMaker.
 long getBytesCount()
          Returns the number of bytes generated by the content source since last reset.
protected  org.apache.lucene.benchmark.byTask.feeds.DocMaker.DocState getDocState()
           
 long getTotalBytesCount()
          Returns the total number of bytes that were generated by the content source defined to that doc maker.
protected  int incrNumDocsCreated()
           
 Document makeDocument()
          Creates a Document object ready for indexing.
 Document makeDocument(int size)
          Same as makeDocument(), only this method creates a document of the given size input by size.
 void printDocStatistics()
           
 void resetInputs()
          Reset inputs so that the test run would behave, input wise, as if it just started.
 void setConfig(Config config)
          Set the configuration parameters of this doc maker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BODY_FIELD

public static final java.lang.String BODY_FIELD
See Also:
Constant Field Values

TITLE_FIELD

public static final java.lang.String TITLE_FIELD
See Also:
Constant Field Values

DATE_FIELD

public static final java.lang.String DATE_FIELD
See Also:
Constant Field Values

ID_FIELD

public static final java.lang.String ID_FIELD
See Also:
Constant Field Values

BYTES_FIELD

public static final java.lang.String BYTES_FIELD
See Also:
Constant Field Values

NAME_FIELD

public static final java.lang.String NAME_FIELD
See Also:
Constant Field Values

config

protected Config config

storeVal

protected Field.Store storeVal

indexVal

protected Field.Index indexVal

bodyIndexVal

protected Field.Index bodyIndexVal

termVecVal

protected Field.TermVector termVecVal

source

protected ContentSource source

reuseFields

protected boolean reuseFields

indexProperties

protected boolean indexProperties
Constructor Detail

DocMaker

public DocMaker()
Method Detail

getDocState

protected org.apache.lucene.benchmark.byTask.feeds.DocMaker.DocState getDocState()

incrNumDocsCreated

protected int incrNumDocsCreated()

close

public void close()
           throws java.io.IOException
Closes the DocMaker. The base implementation closes the ContentSource, and it can be overridden to do more work (but make sure to call super.close()).

Throws:
java.io.IOException

getBytesCount

public long getBytesCount()
Returns the number of bytes generated by the content source since last reset.


getTotalBytesCount

public long getTotalBytesCount()
Returns the total number of bytes that were generated by the content source defined to that doc maker.


makeDocument

public Document makeDocument()
                      throws java.lang.Exception
Creates a Document object ready for indexing. This method uses the ContentSource to get the next document from the source, and creates a Document object from the returned fields. If reuseFields was set to true, it will reuse Document and Field instances.

Throws:
java.lang.Exception

makeDocument

public Document makeDocument(int size)
                      throws java.lang.Exception
Same as makeDocument(), only this method creates a document of the given size input by size.

Throws:
java.lang.Exception

printDocStatistics

public void printDocStatistics()

resetInputs

public void resetInputs()
                 throws java.io.IOException
Reset inputs so that the test run would behave, input wise, as if it just started.

Throws:
java.io.IOException

setConfig

public void setConfig(Config config)
Set the configuration parameters of this doc maker.



Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.