Module org.apache.jena.core
Class LazyStoreStrategy
java.lang.Object
org.apache.jena.mem.store.roaring.strategies.LazyStoreStrategy
- All Implemented Interfaces:
StoreStrategy
A lazy store strategy that defers the initialization of the index until it is needed.
This strategy is useful when the index is not always required, allowing for more efficient memory usage.
It uses a supplier to create a new instance of
EagerStoreStrategy when needed.-
Constructor Summary
ConstructorsConstructorDescriptionLazyStoreStrategy(Supplier<EagerStoreStrategy> setCurrentStrategyToNewEagerStoreStrategy) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToIndex(Triple triple, int index) Add a triple to the index if the cuurent strategy supports indexing.voidClear the index of this store if the current strategy supports indexing.booleancontainsMatch(Triple tripleMatch, MatchPattern pattern) Check if the index contains a match for the given triple and pattern.findMatch(Triple tripleMatch, MatchPattern pattern) Find the triples that match the given triple and pattern.voidremoveFromIndex(Triple triple, int index) Remove a triple from the index if the current strategy supports indexing.streamMatch(Triple tripleMatch, MatchPattern pattern) Stream the triples that match the given triple and pattern.
-
Constructor Details
-
LazyStoreStrategy
-
-
Method Details
-
addToIndex
Description copied from interface:StoreStrategyAdd a triple to the index if the cuurent strategy supports indexing.- Specified by:
addToIndexin interfaceStoreStrategy- Parameters:
triple- the triple to addindex- the index of the triple in the store
-
removeFromIndex
Description copied from interface:StoreStrategyRemove a triple from the index if the current strategy supports indexing.- Specified by:
removeFromIndexin interfaceStoreStrategy- Parameters:
triple- the triple to removeindex- the index of the triple in the store
-
clearIndex
public void clearIndex()Description copied from interface:StoreStrategyClear the index of this store if the current strategy supports indexing. This will remove all triples from the index.- Specified by:
clearIndexin interfaceStoreStrategy
-
containsMatch
Description copied from interface:StoreStrategyCheck if the index contains a match for the given triple and pattern. This is used to quickly check if a triple matches a given pattern without retrieving the triples.- Specified by:
containsMatchin interfaceStoreStrategy- Parameters:
tripleMatch- the triple to matchpattern- the pattern to match against- Returns:
- true if there is a match, false otherwise
-
streamMatch
Description copied from interface:StoreStrategyStream the triples that match the given triple and pattern. This is used to retrieve the triples that match a given pattern.- Specified by:
streamMatchin interfaceStoreStrategy- Parameters:
tripleMatch- the triple to matchpattern- the pattern to match against- Returns:
- a stream of triples that match the given pattern
-
findMatch
Description copied from interface:StoreStrategyFind the triples that match the given triple and pattern. This is used to retrieve the triples that match a given pattern as an iterator.- Specified by:
findMatchin interfaceStoreStrategy- Parameters:
tripleMatch- the triple to matchpattern- the pattern to match against- Returns:
- an iterator over the triples that match the given pattern
-