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
- 
- 
Field SummaryFields Modifier and Type Field Description static Function<String,LocalDateTime>DATE_FIELD_VALUE_TO_LOCALDATETIMEConverts date formats for europarl ("2023-02-23") and enwiki ("12-JAN-2010 12:32:45.000") intoLocalDateTime.
 - 
Constructor SummaryConstructors 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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()DocumentnextDoc()Note: Document instance is re-used per-threadvoidreset()
 
- 
- 
- 
Field Detail- 
DATE_FIELD_VALUE_TO_LOCALDATETIMEpublic static final Function<String,LocalDateTime> DATE_FIELD_VALUE_TO_LOCALDATETIME Converts date formats for europarl ("2023-02-23") and enwiki ("12-JAN-2010 12:32:45.000") intoLocalDateTime.
 
- 
 - 
Constructor Detail- 
LineFileDocspublic 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
 
 - 
LineFileDocspublic LineFileDocs(Random random) throws IOException - Throws:
- IOException
 
 
- 
 - 
Method Detail- 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 - 
resetpublic void reset() throws IOException- Throws:
- IOException
 
 - 
nextDocpublic Document nextDoc() throws IOException Note: Document instance is re-used per-thread- Throws:
- IOException
 
 
- 
 
-