Interface ChildCacheFinder

All Known Implementing Classes:
CheckCacheForSpecificChildren, DefaultChildCacheFinder

public interface ChildCacheFinder
Strategy to determine which child-cache (among hierarchy) to employ for a particular feature calculation.
  • Method Details

    • childCacheFor

      <V extends FeatureInput> FeatureCalculationCache<V> childCacheFor(FeatureCalculationCache<?> parentCache, CacheCreator factory, ChildCacheName childCacheName, V input) throws FeatureCalculationException
      Selects a child-cache given a parent and a child-name.

      This may involve reusing an existing cache, or creating a new one, depending on the strategy.

      Type Parameters:
      V - type-of-input to be used to calculate on the child-cache
      Parameters:
      parentCache - the existing parent-cache
      factory - how to create new caches
      childCacheName - name of child-cache
      input - input to be used for calculations on the child-cache
      Returns:
      an existing or newly created child-cache depending on the strategy.
      Throws:
      FeatureCalculationException - if no child-cache exists or can be created for childCacheName.
    • finderForGrandchild

      ChildCacheFinder finderForGrandchild()
      What finder to use for children-of-children?
      Returns:
      the finder to use.
    • cachesToAvoidInvalidating

      Optional<Set<ChildCacheName>> cachesToAvoidInvalidating()
      If set, these particular-caches are exceptionally not invalidated during the typical invalidation operation on their parent.

      If not-set, there are no exceptions.

      Returns:
      the names of the caches that are exceptionally not invalidated, if any exist.