Class QueryGenerator

java.lang.Object
dev.roanh.gmark.query.QueryGenerator

public final class QueryGenerator extends Object
Utility class for generation queries for workloads.
See Also:
  • Field Details

    • ERROR_BOUND

      private static final int ERROR_BOUND
      Maximum number of times to try to generate a query before giving up and throwing a generation exception.
      See Also:
  • Constructor Details

    • QueryGenerator

      private QueryGenerator()
      Prevent instantiation.
  • Method Details

    • generateQuery

      public static Query generateQuery(Workload workload) throws GenerationException
      Generates a single query according to the given workload specification.
      Parameters:
      workload - The workload configuration.
      Returns:
      The generated query.
      Throws:
      GenerationException - When generating the query failed.
    • generateQueries

      public static QuerySet generateQueries(Workload workload) throws GenerationException
      Generates a complete workload consisting of the number of queries defined in the given workload configuration and all conforming to the given workload specification.
      Parameters:
      workload - The workload configuration.
      Returns:
      The generated queries.
      Throws:
      GenerationException - When generating the queries failed.
      See Also:
    • generateQueries

      public static QuerySet generateQueries(Workload workload, QueryGenerator.ProgressListener listener) throws GenerationException
      Generates a complete workload consisting of the number of queries defined in the given workload configuration and all conforming to the given workload specification. The given progress listener is updated with the progress of the generation task.
      Parameters:
      workload - The workload configuration.
      listener - The progress listener to use, can be null
      Returns:
      The generated queries.
      Throws:
      GenerationException - When generating the queries failed.
      See Also:
    • generateQueries

      public static QuerySet generateQueries(Workload workload, int n, QueryGenerator.ProgressListener listener) throws GenerationException
      Generates a workload of the given number of queries conforming to the given workload specification. The given number of queries overrides the workload size as defined in the workload configuration. The given progress listener is updated with the progress of the generation task.
      Parameters:
      workload - The workload configuration.
      n - The number of queries to generate.
      listener - The progress listener to use, can be null
      Returns:
      The generated queries.
      Throws:
      GenerationException - When generating the queries failed.