Class RandomFacetSource
java.lang.Object
org.apache.lucene.benchmark.byTask.feeds.ContentItemsSource
org.apache.lucene.benchmark.byTask.feeds.FacetSource
org.apache.lucene.benchmark.byTask.feeds.RandomFacetSource
- All Implemented Interfaces:
Closeable,AutoCloseable
Simple implementation of a random facet source
Supports the following parameters:
- rand.seed - defines the seed to initialize
Randomwith (default: 13). - max.doc.facet.dims - Max number of random dimensions to create (default: 5); actual number of dimensions would be anything between 1 and that number.
- max.doc.facets - maximal #facets per doc (default: 10). Actual number of facets in a certain doc would be anything between 1 and that number.
- max.facet.depth - maximal #components in a facet (default: 3). Actual number of components in a certain facet would be anything between 1 and that number.
-
Field Summary
Fields inherited from class org.apache.lucene.benchmark.byTask.feeds.ContentItemsSource
encoding, forever, logStep, verbose -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Called when reading from this content source is no longer required.voidconfigure(FacetsConfig config) voidgetNextFacets(List<FacetField> facets) Fills the next facets content items in the given list.voidSets theConfigfor this content source.Methods inherited from class org.apache.lucene.benchmark.byTask.feeds.FacetSource
resetInputsMethods inherited from class org.apache.lucene.benchmark.byTask.feeds.ContentItemsSource
addBytes, addItem, collectFiles, getBytesCount, getConfig, getItemsCount, getTotalBytesCount, getTotalItemsCount, printStatistics, shouldLog
-
Constructor Details
-
RandomFacetSource
public RandomFacetSource()
-
-
Method Details
-
getNextFacets
Description copied from class:FacetSourceFills the next facets content items in the given list. Implementations must account for multi-threading, as multiple threads can call this method simultaneously.- Specified by:
getNextFacetsin classFacetSource- Throws:
NoMoreDataExceptionIOException
-
configure
- Specified by:
configurein classFacetSource
-
close
Description copied from class:ContentItemsSourceCalled when reading from this content source is no longer required.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classContentItemsSource- Throws:
IOException
-
setConfig
Description copied from class:ContentItemsSourceSets theConfigfor this content source. If you override this method, you must call super.setConfig.- Overrides:
setConfigin classContentItemsSource
-