## org.apache.lucene.benchmark.byTask.feeds
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

    public class RandomFacetSource

extends FacetSource

Simple implementation of a random facet source

Supports the following parameters:

- rand.seed - defines the seed to initialize Random with (default: 13).
- 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
`RandomFacetSource()`

Method Summary
`void` `close()` Called when reading from this content source is no longer required.
`CategoryContainer` `getNextFacets(CategoryContainer facets)` Returns the next `facets content item`.
`void` `setConfig(Config config)` Sets the `Config` for this content source.

Methods inherited from class org.apache.lucene.benchmark.byTask.feeds.FacetSource
`resetInputs`

Methods inherited from class org.apache.lucene.benchmark.byTask.feeds.ContentItemsSource
`addBytes, addItem, collectFiles, getBytesCount, getConfig, getItemsCount, getTotalBytesCount, getTotalItemsCount, printStatistics, shouldLog`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RandomFacetSource

    public RandomFacetSource()

Method Detail

### getNextFacets

    public CategoryContainer getNextFacets(CategoryContainer facets)
                                    throws NoMoreDataException,
                                           IOException

  Description copied from class: `FacetSource`
  Returns the next `facets content item`. Implementations must account for multi-threading, as multiple threads can call this method simultaneously.

  Specified by:
    `getNextFacets` in class `FacetSource`
  Throws:
    `NoMoreDataException`
    `IOException`

### close

    public void close()
               throws IOException

  Description copied from class: `ContentItemsSource`
  Called when reading from this content source is no longer required.

  Specified by:
    `close` in interface `Closeable`
  Specified by:
    `close` in class `ContentItemsSource`
  Throws:
    `IOException`

### setConfig

    public void setConfig(Config config)

  Description copied from class: `ContentItemsSource`
  Sets the `Config` for this content source. If you override this method, you must call super.setConfig.

  Overrides:
    `setConfig` in class `ContentItemsSource`