Class QueryBatchRunner


  • public class QueryBatchRunner
    extends Object
    Executor of a ProbePlan over a class pool, evaluating the query condition on every candidate the plan's scope filter admits and projecting each hit into a QueryMatch carrying the evaluator's evidence.
    • Constructor Detail

      • QueryBatchRunner

        public QueryBatchRunner​(ClassPool classPool)
        Creates a runner over a pool, defaulting to a 60 second budget and no user-class restriction.
        Parameters:
        classPool - the classes to search
    • Method Detail

      • setUserClassNames

        public void setUserClassNames​(Set<String> userClassNames)
        Restricts the search to named classes; a null or empty set searches the whole pool.
        Parameters:
        userClassNames - the class names to keep
      • setTimeBudgetMs

        public void setTimeBudgetMs​(long ms)
        Sets the wall-clock budget after which a run stops early and reports what it has.
        Parameters:
        ms - the budget in milliseconds
      • cancel

        public void cancel()
        Requests that an in-flight run stop at the next candidate; the flag is cleared when a run starts.
      • run

        public QueryBatchRunner.QueryBatchResult run​(ProbePlan plan,
                                                     QueryBatchRunner.ProgressListener listener)
        Evaluates the plan's condition over every class or method the scope filter admits, then applies the query's ordering and limit.
        Parameters:
        plan - the planned query
        listener - notified of phase start, progress every 200 methods, and completion, or null
        Returns:
        the matches and whether the run was cancelled