Class LazyStoreStrategy

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

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

  • 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