Module org.apache.jena.core
Class EagerStoreStrategy
java.lang.Object
org.apache.jena.mem.store.roaring.strategies.EagerStoreStrategy
- All Implemented Interfaces:
StoreStrategy
Eager store strategy that indexes all triples immediately.
This strategy is used when the indexing strategy is set to EAGER.
It builds the index by adding all triples to the index at once.
-
Constructor Summary
ConstructorsConstructorDescriptionEagerStoreStrategy(TripleSet triples) Default constructor for EagerStoreStrategy.EagerStoreStrategy(TripleSet triples, boolean parallel) Create a new EagerStoreStrategy and initialize the index.EagerStoreStrategy(TripleSet triples, EagerStoreStrategy strategyToCopyBitmapsFrom) Copy constructor for EagerStoreStrategy. -
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
-
EagerStoreStrategy
Create a new EagerStoreStrategy and initialize the index. -
EagerStoreStrategy
Default constructor for EagerStoreStrategy. Initializes the bitmaps for subjects, predicates, and objects. Note: This constructor does not index any triples. -
EagerStoreStrategy
Copy constructor for EagerStoreStrategy. Creates a new EagerStoreStrategy that is a copy of the given strategy but with a new reference to a set of triples. This set should be a copy of the original set to ensure independence of the new store.- Parameters:
triples- the set of triples of the new storestrategyToCopyBitmapsFrom- the strategy to copy bitmaps from
-
-
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
-