Class IndexSearcher.CachingLeafSlicesSupplier

  • All Implemented Interfaces:
    java.util.function.Supplier<IndexSearcher.LeafSlice[]>
    Enclosing class:
    IndexSearcher

    private static class IndexSearcher.CachingLeafSlicesSupplier
    extends java.lang.Object
    implements java.util.function.Supplier<IndexSearcher.LeafSlice[]>
    Supplier for IndexSearcher.LeafSlice slices which computes and caches the value on first invocation and returns cached value on subsequent invocation. If the passed in provider for slice computation throws exception then same will be passed to the caller of this supplier on each invocation. If the provider returns null then NullPointerException will be thrown to the caller.

    NOTE: To provide thread safe caching mechanism this class is implementing the (subtle) double-checked locking idiom