Package dev.roanh.gmark.query
Class QueryGenerator
java.lang.Object
dev.roanh.gmark.query.QueryGenerator
Utility class for generation queries for workloads.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interfaces for objects that want to listen to the progress of a query generation task. -
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
Maximum number of times to try to generate a query before giving up and throwing a generation exception. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic QuerySet
generateQueries
(Workload workload) Generates a complete workload consisting of the number of queries defined in the given workload configuration and all conforming to the given workload specification.static QuerySet
generateQueries
(Workload workload, int n, QueryGenerator.ProgressListener listener) Generates a workload of the given number of queries conforming to the given workload specification.static QuerySet
generateQueries
(Workload workload, QueryGenerator.ProgressListener listener) Generates a complete workload consisting of the number of queries defined in the given workload configuration and all conforming to the given workload specification.static Query
generateQuery
(Workload workload) Generates a single query according to the given workload specification.
-
Field Details
-
ERROR_BOUND
private static final int ERROR_BOUNDMaximum 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
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
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 benull
- 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 benull
- Returns:
- The generated queries.
- Throws:
GenerationException
- When generating the queries failed.
-