Class QueryService


  • public class QueryService
    extends Object
    Front end for running query text against a class pool - parse, plan, then execute, either inline or on a single daemon worker thread.
    • Constructor Detail

      • QueryService

        public QueryService​(ClassPool classPool)
        Creates a service over a pool, with its own parser and a single-thread daemon executor for async runs.
        Parameters:
        classPool - the classes to query
    • Method Detail

      • setUserClassNames

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

        public Query parse​(String queryText)
                    throws ParseException
        Parses query text into its syntax tree.
        Parameters:
        queryText - the query source
        Returns:
        the parsed query
        Throws:
        ParseException - if the text is not a valid query
      • plan

        public ProbePlan plan​(Query query)
        Turns a parsed query into an executable plan with its scope filter.
        Parameters:
        query - the parsed query
        Returns:
        the probe plan
      • cancel

        public void cancel()
        Asks the run in progress, if any, to stop early.
      • shutdown

        public void shutdown()
        Shuts down the worker thread; async runs already submitted still finish.