NationalSecurityAgency / datawave

DataWave is an ingest/query framework that leverages Apache Accumulo to provide fast, secure data access.
https://code.nsa.gov/datawave
Apache License 2.0
548 stars 236 forks source link

Short Circuit Visitors - IvaratorRequired #1476

Open mineralntl opened 2 years ago

mineralntl commented 2 years ago

For any visitors that extend BaseVisitor, we have the option to short circuit at leaf nodes.

Improving the speed of our visitors will cut query planning time and, in some cases, speed up the time it takes to debug a query.

jwomeara commented 2 years ago

I see that you are creating a lot of tickets like this. Can you give me an example of what a short-circuit looks like to you for situations like this? Are you talking about just returning a given "leaf" node vs calling childrenAccept on it?

If so, instead of creating a ticket for each visitor that you want to update, I wonder if you could just create a ShortCircuitBaseVisitor where each visit call just returns the node, and then have each of these visitors extend that instead.

mineralntl commented 2 years ago

Spoke with @jwomeara offline - keeping a separate ticket per visitor for ease of PRs but will refactor all current (and future) branches with a ShortCircuitBaseVisitor extension of BaseVisitor