org.apache.lucene.benchmark.byTask.feeds

Class BasicDocMaker

Implemented Interfaces:
DocMaker
Known Direct Subclasses:
ReutersDocMaker, SimpleDocMaker, TrecDocMaker

public abstract class BasicDocMaker
extends Object
implements DocMaker

Create documents for the test. Maintains counters of chars etc. so that sub-classes just need to provide textual content, and the create-by-size is handled here.

Field Summary

protected Config
config
protected Field.Index
indexVal
protected Field.Store
storeVal
protected Field.TermVector
termVecVal

Method Summary

protected void
addBytes(long n)
protected void
addUniqueBytes(long n)
protected void
collectFiles(File f, ArrayList inputFiles)
long
getByteCount()
Return total byte size of docs made since last reset.
int
getCount()
Return number of docs made since last reset.
protected abstract org.apache.lucene.benchmark.byTask.feeds.BasicDocMaker.DocData
getNextDocData()
Return the data of the next document.
Document
makeDocument()
Create the next document.
Document
makeDocument(int size)
Create the next document, of the given size by input bytes.
long
numUniqueBytes()
Return total bytes of all available unique texts, 0 if not applicable
void
printDocStatistics()
Print some statistics on docs available/added/etc.
void
resetInputs()
Reset inputs so that the test run would behave, input wise, as if it just started.
void
setConfig(Config config)
Set the properties

Field Details

config

protected Config config

indexVal

protected Field.Index indexVal

storeVal

protected Field.Store storeVal

termVecVal

protected Field.TermVector termVecVal

Method Details

addBytes

protected void addBytes(long n)

addUniqueBytes

protected void addUniqueBytes(long n)

collectFiles

protected void collectFiles(File f,
                            ArrayList inputFiles)

getByteCount

public long getByteCount()
Return total byte size of docs made since last reset.
Specified by:
getByteCount in interface DocMaker

getCount

public int getCount()
Return number of docs made since last reset.
Specified by:
getCount in interface DocMaker

getNextDocData

protected abstract org.apache.lucene.benchmark.byTask.feeds.BasicDocMaker.DocData getNextDocData()
            throws Exception
Return the data of the next document.
Returns:
data of the next document.

makeDocument

public Document makeDocument()
            throws Exception
Create the next document.
Specified by:
makeDocument in interface DocMaker

makeDocument

public Document makeDocument(int size)
            throws Exception
Create the next document, of the given size by input bytes. If the implementation does not support control over size, an exception is thrown.
Specified by:
makeDocument in interface DocMaker
Parameters:
size - size of document, or 0 if there is no size requirement.

numUniqueBytes

public long numUniqueBytes()
Return total bytes of all available unique texts, 0 if not applicable
Specified by:
numUniqueBytes in interface DocMaker

printDocStatistics

public void printDocStatistics()
Print some statistics on docs available/added/etc.
Specified by:
printDocStatistics in interface DocMaker

resetInputs

public void resetInputs()
Reset inputs so that the test run would behave, input wise, as if it just started.
Specified by:
resetInputs in interface DocMaker

setConfig

public void setConfig(Config config)
Set the properties
Specified by:
setConfig in interface DocMaker

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