Interface FieldLoadingStrategy

All Known Implementing Classes:
DoubleFieldLoadingStrategy, FloatFieldLoadingStrategy, IntFieldLoadingStrategy, LongFieldLoadingStrategy, StringFieldLoadingStrategy

public interface FieldLoadingStrategy
Using as composition in implementations of FieldCacheCollector, so that we can reuse different loading strategies in different kinds of Collectors.
See Also:
  • BigArrayFieldCacheCollectorImpl
  • MapFieldCacheCollectorImpl
  • Method Summary

    Modifier and Type
    Method
    Description
    collect(int relativeDocId)
    The collector wants to pick a specific element from the cache.
    void
    A new IndexReader is opened - implementations usually need this to load the next array of cached data.
  • Method Details

    • loadNewCacheValues

      void loadNewCacheValues(IndexReader reader) throws IOException
      A new IndexReader is opened - implementations usually need this to load the next array of cached data.
      Parameters:
      reader - the IndexReader for which to load the new cache values
      Throws:
      IOException - in case an error occurs reading the cache values from the index
    • collect

      Object collect(int relativeDocId)
      The collector wants to pick a specific element from the cache. Only at this point we convert primitives into an object if needed.
      Parameters:
      relativeDocId - the doc id relative to the current reader
      Returns:
      the cached field value for the document with the relative id relativeDocId.