Class IndexSearcher.CachingLeafSlicesSupplier

java.lang.Object
org.apache.lucene.search.IndexSearcher.CachingLeafSlicesSupplier
All Implemented Interfaces:
Supplier<IndexSearcher.LeafSlice[]>
Enclosing class:
IndexSearcher

private static class IndexSearcher.CachingLeafSlicesSupplier extends Object implements 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