java.lang.Object
org.apache.jena.mem.store.strategies.LazyStoreStrategy
- All Implemented Interfaces:
StoreStrategy
StoreStrategy that defers index construction until the first
pattern lookup. Add/remove are no-ops while the index is absent (the
triples are still maintained in the enclosing
TripleStore but no
subject/predicate/object index is updated). On the first
containsMatch/streamMatch/findMatch call, the
supplied callback is invoked to build (and install) an
IndexingStrategy.EAGER implementation;
the lookup is then forwarded to it.
Used to back both IndexingStrategy.LAZY and
IndexingStrategy.LAZY_PARALLEL; the
sequential / parallel choice is encoded in the supplied callback.
-
Constructor Summary
ConstructorsConstructorDescriptionLazyStoreStrategy(Supplier<StoreStrategy> setCurrentStrategyToNewEagerStoreStrategy) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToIndex(Triple triple, int index) Notify the strategy that a triple was added to the underlying triple set at the given index.voidDiscard any auxiliary index data held by the strategy.booleanbooleanbooleancontainsAnyPreObj(Node p, Node o) booleanbooleancontainsSubAnyObj(Node s, Node o) booleancontainsSubPreAny(Node s, Node p) findAnyPreObj(Node p, Node o) findSubAnyObj(Node s, Node o) findSubPreAny(Node s, Node p) voidremoveFromIndex(Triple triple, int index) Notify the strategy that the triple at the given index has been removed from the underlying triple set.streamAnyPreObj(Node p, Node o) streamSubAnyObj(Node s, Node o) streamSubPreAny(Node s, Node p) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.mem.store.strategies.StoreStrategy
isIndexInitialized
-
Constructor Details
-
LazyStoreStrategy
- Parameters:
setCurrentStrategyToNewEagerStoreStrategy- callback that builds anIndexingStrategy.EAGERstrategy, installs it as the enclosing store's current strategy, and returns it so this strategy can delegate the triggering lookup to it
-
-
Method Details
-
addToIndex
Description copied from interface:StoreStrategyNotify the strategy that a triple was added to the underlying triple set at the given index. Implementations that maintain an index must update it; implementations without an index are free to no-op.- Specified by:
addToIndexin interfaceStoreStrategy- Parameters:
triple- the newly added tripleindex- the stable index it now occupies in the triple set
-
removeFromIndex
Description copied from interface:StoreStrategyNotify the strategy that the triple at the given index has been removed from the underlying triple set. Implementations that maintain an index must remove the triple from it; implementations without an index are free to no-op.- Specified by:
removeFromIndexin interfaceStoreStrategy- Parameters:
triple- the removed tripleindex- the index it occupied immediately before removal
-
clearIndex
public void clearIndex()Description copied from interface:StoreStrategyDiscard any auxiliary index data held by the strategy. Implementations without an index may no-op.- Specified by:
clearIndexin interfaceStoreStrategy
-
containsSubAnyAny
- Specified by:
containsSubAnyAnyin interfaceStoreStrategy
-
containsAnyPreAny
- Specified by:
containsAnyPreAnyin interfaceStoreStrategy
-
containsAnyAnyObj
- Specified by:
containsAnyAnyObjin interfaceStoreStrategy
-
containsSubPreAny
- Specified by:
containsSubPreAnyin interfaceStoreStrategy
-
containsSubAnyObj
- Specified by:
containsSubAnyObjin interfaceStoreStrategy
-
containsAnyPreObj
- Specified by:
containsAnyPreObjin interfaceStoreStrategy
-
streamSubAnyAny
- Specified by:
streamSubAnyAnyin interfaceStoreStrategy
-
streamAnyPreAny
- Specified by:
streamAnyPreAnyin interfaceStoreStrategy
-
streamAnyAnyObj
- Specified by:
streamAnyAnyObjin interfaceStoreStrategy
-
streamSubPreAny
- Specified by:
streamSubPreAnyin interfaceStoreStrategy
-
streamSubAnyObj
- Specified by:
streamSubAnyObjin interfaceStoreStrategy
-
streamAnyPreObj
- Specified by:
streamAnyPreObjin interfaceStoreStrategy
-
findSubAnyAny
- Specified by:
findSubAnyAnyin interfaceStoreStrategy
-
findAnyPreAny
- Specified by:
findAnyPreAnyin interfaceStoreStrategy
-
findAnyAnyObj
- Specified by:
findAnyAnyObjin interfaceStoreStrategy
-
findSubPreAny
- Specified by:
findSubPreAnyin interfaceStoreStrategy
-
findSubAnyObj
- Specified by:
findSubAnyObjin interfaceStoreStrategy
-
findAnyPreObj
- Specified by:
findAnyPreObjin interfaceStoreStrategy
-