Package org.apache.lucene.tests.util
Class LineFileDocs
- java.lang.Object
-
- org.apache.lucene.tests.util.LineFileDocs
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class LineFileDocs extends Object implements Closeable
Minimal port of benchmark's LneDocSource + DocMaker, so tests can enum docs from a line file created by benchmark's WriteLineDoc task
-
-
Constructor Summary
Constructors Constructor Description LineFileDocs(Random random)LineFileDocs(Random random, String path)If forever is true, we rewind the file at EOF (repeat the docs over and over)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()DocumentnextDoc()Note: Document instance is re-used per-threadvoidreset()
-
-
-
Constructor Detail
-
LineFileDocs
public LineFileDocs(Random random, String path) throws IOException
If forever is true, we rewind the file at EOF (repeat the docs over and over)- Throws:
IOException
-
LineFileDocs
public LineFileDocs(Random random) throws IOException
- Throws:
IOException
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
reset
public void reset() throws IOException- Throws:
IOException
-
nextDoc
public Document nextDoc() throws IOException
Note: Document instance is re-used per-thread- Throws:
IOException
-
-