Class QueryHandler

java.lang.Object
org.aksw.iguana.cc.query.handler.QueryHandler

public class QueryHandler extends Object
The QueryHandler is used by every worker that extends the AbstractWorker. It initializes the QuerySource, QuerySelector, QueryList and, if needed, TemplateHandler. After the initialization, it provides the next query to the worker using the generated QuerySource and the order given by the QuerySelector.
Author:
frensing
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
    • config

      protected final QueryHandler.Config config
    • queryList

      protected final QueryList queryList
    • hashCode

      protected final int hashCode
  • Constructor Details

    • QueryHandler

      protected QueryHandler()
      Empty Constructor for Testing purposes. TODO: look for an alternative
    • QueryHandler

      public QueryHandler(QueryHandler.Config config) throws IOException
      Throws:
      IOException
  • Method Details

    • getQuerySelectorInstance

      public QuerySelector getQuerySelectorInstance()
    • getNextQuery

      public QueryHandler.QueryStringWrapper getNextQuery(QuerySelector querySelector) throws IOException
      Throws:
      IOException
    • getNextQueryStream

      public QueryHandler.QueryStreamWrapper getNextQueryStream(QuerySelector querySelector)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getQueryCount

      public int getQueryCount()
    • getQueryId

      public String getQueryId(int i)
    • getAllQueryIds

      public String[] getAllQueryIds()
      Returns every query id in the format: queryListHash:index
      The index of a query inside the returned array is the same as the index inside the string.
      Returns:
      String[] of query ids
    • getConfig

      public QueryHandler.Config getConfig()
      Returns the configuration of the QueryHandler.
      Returns:
      the configuration of the QueryHandler