Class EagerStoreStrategy

java.lang.Object
org.apache.jena.mem.store.roaring.strategies.EagerStoreStrategy
All Implemented Interfaces:
StoreStrategy

public class EagerStoreStrategy extends Object implements 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 Details

    • EagerStoreStrategy

      public EagerStoreStrategy(TripleSet triples, boolean parallel)
      Create a new EagerStoreStrategy and initialize the index.
    • EagerStoreStrategy

      public EagerStoreStrategy(TripleSet triples)
      Default constructor for EagerStoreStrategy. Initializes the bitmaps for subjects, predicates, and objects. Note: This constructor does not index any triples.
    • EagerStoreStrategy

      public EagerStoreStrategy(TripleSet triples, EagerStoreStrategy strategyToCopyBitmapsFrom)
      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 store
      strategyToCopyBitmapsFrom - the strategy to copy bitmaps from
  • Method Details

    • addToIndex

      public void addToIndex(Triple triple, int index)
      Description copied from interface: StoreStrategy
      Add a triple to the index if the cuurent strategy supports indexing.
      Specified by:
      addToIndex in interface StoreStrategy
      Parameters:
      triple - the triple to add
      index - the index of the triple in the store
    • removeFromIndex

      public void removeFromIndex(Triple triple, int index)
      Description copied from interface: StoreStrategy
      Remove a triple from the index if the current strategy supports indexing.
      Specified by:
      removeFromIndex in interface StoreStrategy
      Parameters:
      triple - the triple to remove
      index - the index of the triple in the store
    • clearIndex

      public void clearIndex()
      Description copied from interface: StoreStrategy
      Clear the index of this store if the current strategy supports indexing. This will remove all triples from the index.
      Specified by:
      clearIndex in interface StoreStrategy
    • containsMatch

      public boolean containsMatch(Triple tripleMatch, MatchPattern pattern)
      Description copied from interface: StoreStrategy
      Check 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:
      containsMatch in interface StoreStrategy
      Parameters:
      tripleMatch - the triple to match
      pattern - the pattern to match against
      Returns:
      true if there is a match, false otherwise
    • streamMatch

      public Stream<Triple> streamMatch(Triple tripleMatch, MatchPattern pattern)
      Description copied from interface: StoreStrategy
      Stream the triples that match the given triple and pattern. This is used to retrieve the triples that match a given pattern.
      Specified by:
      streamMatch in interface StoreStrategy
      Parameters:
      tripleMatch - the triple to match
      pattern - the pattern to match against
      Returns:
      a stream of triples that match the given pattern
    • findMatch

      public ExtendedIterator<Triple> findMatch(Triple tripleMatch, MatchPattern pattern)
      Description copied from interface: StoreStrategy
      Find 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:
      findMatch in interface StoreStrategy
      Parameters:
      tripleMatch - the triple to match
      pattern - the pattern to match against
      Returns:
      an iterator over the triples that match the given pattern