Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composable QueryExecutors #415

Open
cwbriones opened this issue Jun 19, 2020 · 0 comments
Open

Composable QueryExecutors #415

cwbriones opened this issue Jun 19, 2020 · 0 comments

Comments

@cwbriones
Copy link
Contributor

cwbriones commented Jun 19, 2020

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>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant