Interface JoinStatsProvider


public interface JoinStatsProvider
Collects and supplies statistics about triple pattern evaluations.
  • Method Details

    • reset

      void reset()
    • recordCall

      void recordCall(PatternKey key)
    • recordResults

      void recordResults(PatternKey key, long resultCount)
    • recordFilterOutcome

      default void recordFilterOutcome(PatternKey key, String filterKey, long passedCount, long filteredCount)
      Records observed filter outcomes for a statement-pattern key and condition key.
      Parameters:
      key - statement-pattern key associated with the filter
      filterKey - normalized filter-condition key
      passedCount - number of rows accepted by the filter
      filteredCount - number of rows rejected by the filter
    • getFilterPassRatio

      default double getFilterPassRatio(PatternKey key, String filterKey)
      Returns the observed pass ratio for a specific filter condition and pattern key, or a negative value when unavailable.
    • getFilterTemplatePassRatio

      default double getFilterTemplatePassRatio(PatternKey key, String filterTemplateKey)
      Returns the observed pass ratio for a generalized filter template and pattern key, or a negative value when unavailable.
    • getPatternPassRatio

      default double getPatternPassRatio(PatternKey key)
      Returns the observed aggregate pass ratio for all filters seen on a pattern key, or a negative value when unavailable.
    • getFilterObservationCount

      default long getFilterObservationCount(PatternKey key, String filterKey)
      Returns the number of observed outcomes for a specific filter condition and pattern key, or a negative value when unavailable.
    • getFilterTemplateObservationCount

      default long getFilterTemplateObservationCount(PatternKey key, String filterTemplateKey)
      Returns the number of observed outcomes for a generalized filter template and pattern key, or a negative value when unavailable.
    • getPatternObservationCount

      default long getPatternObservationCount(PatternKey key)
      Returns the number of observed outcomes for all filters seen on a pattern key, or a negative value when unavailable.
    • seedIfAbsent

      void seedIfAbsent(PatternKey key, double defaultCardinality, long priorCalls)
      Seeds statistics for the given key. Implementations may also invalidate or refresh existing entries if the supplied default cardinality has drifted significantly from the stored baseline.
    • getAverageResults

      double getAverageResults(PatternKey key)
    • getMaxResults

      default double getMaxResults(PatternKey key)
      Returns the maximum observed result count per call for the given key. Defaults to the average result count when not supported by an implementation.
    • hasStats

      boolean hasStats(PatternKey key)
    • getCalls

      default long getCalls(PatternKey key)
      Returns the number of observed calls for the given key, or a negative value when unavailable.
    • getUncertainty

      default double getUncertainty(PatternKey key)
      Returns an uncertainty score in [0,1] where 1 means highest uncertainty.
    • getTotalCalls

      long getTotalCalls()
    • recordStatementsAdded

      default void recordStatementsAdded(long statementCount)
      Records that statements have been added to the store. Implementations may use this to invalidate statistics when a write threshold is exceeded in a time window.