Skip to content

Composable QueryExecutors #415

@cwbriones

Description

@cwbriones

Right now QueryExecutors are opaque, the signature of execute is essentially

CompletionStage<MetricsQueryResponse> execute(String serializedQuery)

If we want to support additional query features such as arithmetic, a single logical query will likely map to several KairosDB queries in which case the ArithmeticQueryExecutor would want to

  1. decompose their query and then
  2. pass it into the downstream executor.

To avoid the overhead of creating the query and then serializing it to conform to the interface, clients should be able to pass structured queries directly to the executors. The signature currently does not allow for passing in a structured query and so we would need to expose that, perhaps using a generic:

interface QueryExecutor<T>  { // T - RequestType
     CompletionStage<MetricsQueryResponse> executeRaw(final String serializedQuery);

     CompletionStage<MetricsQueryResponse> execute(final T request);
}

Executors can opt-out of this behavior by implementing QueryExecutor<Void>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions