Skip to content
New issue

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

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

Already on GitHub? # to your account

Refactor GraphHandler.java and QueryRpc.java to share query logic #775

Open
HugoMFernandes opened this issue Apr 15, 2016 · 2 comments
Open
Milestone

Comments

@HugoMFernandes
Copy link
Contributor

Right now, GraphHandler.doGraph (

private void doGraph(final TSDB tsdb, final HttpQuery query)
) implements its own query-processing logic which, among other things, fetches all series synchronously (see the TODO in
// TODO(tsuna): Optimization: run each query in parallel.
).

QueryRpc.handleQuery has similar logic, but actually does things asynchronously (

private void handleQuery(final TSDB tsdb, final HttpQuery query) {
).

Because of this (code path) difference, adding query-related features requires implementing the logic in both places (which has led to bugs).

I propose rewriting this block of code (i.e. the query-related logic contained in QueryRpc) to process queries/annotations/etc and return data, moving it away from handleQuery. The responsibility of QueryRpc.handleQuery would then simply be to attach a formatter to the data, while the responsibility of GraphHandler.doGraph would be to turn the data into a graph (via gnuplot).

@johann8384
Copy link
Member

Changed to bug at the request of the @HugoMFernandes

@HugoMFernandes
Copy link
Contributor Author

This one was fine as enhancement. My bug comment was related to the other one (#773). Anyways, it doesn't really matter.

@johann8384 johann8384 added this to the v2.3.1 milestone Jul 6, 2016
@johann8384 johann8384 added enhancement and removed bug labels Jul 6, 2016
@johann8384 johann8384 modified the milestones: v2.3.1, v2.4.0 Jul 10, 2017
@johann8384 johann8384 modified the milestones: v2.5.0, 2.6.0 Oct 26, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants