Class LineDocSource
A ContentSource reading one line at a time as a Lucene.Net.Documents.Document from a single file. This saves IO cost (over DirContentSource) of recursing through a directory and opening a new file for every document.
Implements
Inherited Members
Namespace: Lucene.Net.Benchmarks.ByTask.Feeds
Assembly: Lucene.Net.Benchmark.dll
Syntax
public class LineDocSource : ContentSource, IDisposable
Remarks
The expected format of each line is (arguments are separated by <TAB>): title, date, body. If a line is read in a different format, a Exception will be thrown. In general, you should use this content source for files that were created with WriteLineDocTask.
Methods
Dispose(bool)
Called when reading from this content source is no longer required.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
Remarks
The expected format of each line is (arguments are separated by <TAB>): title, date, body. If a line is read in a different format, a Exception will be thrown. In general, you should use this content source for files that were created with WriteLineDocTask.
GetNextDocData(DocData)
Returns the next DocData from the content source. Implementations must account for multi-threading, as multiple threads can call this method simultaneously.
Declaration
public override DocData GetNextDocData(DocData docData)
Parameters
Type | Name | Description |
---|---|---|
DocData | docData |
Returns
Type | Description |
---|---|
DocData |
Overrides
Remarks
The expected format of each line is (arguments are separated by <TAB>): title, date, body. If a line is read in a different format, a Exception will be thrown. In general, you should use this content source for files that were created with WriteLineDocTask.
ResetInputs()
Resets the input for this content source, so that the test would behave as if it was just started, input-wise.
NOTE: the default implementation resets the number of bytes and items generated since the last reset, so it's important to callbase.ResetInputs()
in case you override this method.
Declaration
public override void ResetInputs()
Overrides
Remarks
The expected format of each line is (arguments are separated by <TAB>): title, date, body. If a line is read in a different format, a Exception will be thrown. In general, you should use this content source for files that were created with WriteLineDocTask.
SetConfig(Config)
Sets the Config for this content source. If you override this
method, you must call base.SetConfig(config)
.
Declaration
public override void SetConfig(Config config)
Parameters
Type | Name | Description |
---|---|---|
Config | config |
Overrides
Remarks
The expected format of each line is (arguments are separated by <TAB>): title, date, body. If a line is read in a different format, a Exception will be thrown. In general, you should use this content source for files that were created with WriteLineDocTask.