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

matchers: implement interval tree for sublinear port range matching #19912

Closed
wants to merge 8 commits into from

Conversation

kyessenov
Copy link
Contributor

@kyessenov kyessenov commented Feb 11, 2022

Commit Message: Data structure for efficient lookup of intervals containing a port in the unified matcher framework.

The data structure is a balanced tree of pivots so that:

  • each node contains intervals that contains the pivot
  • left nodes have all intervals less than the pivot
  • right nodes have all the intervals greater than the pivot

To ensure balance, the pivots are chosen as medians in the sorted list of all start and end points.

Risk Level: low
Testing: unit, integration
Docs Changes: none (need #20277 )
Release Notes: none

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #19912 was opened by kyessenov.

see: more, trace.

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Feb 11, 2022
@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @htuch

🐱

Caused by: #19912 was opened by kyessenov.

see: more, trace.

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm deps

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Feb 15, 2022
@htuch htuch removed their assignment Feb 15, 2022
@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Mar 16, 2022
Signed-off-by: Kuat Yessenov <kuat@google.com>
@kyessenov kyessenov marked this pull request as ready for review March 16, 2022 21:10
@kyessenov kyessenov requested a review from mattklein123 as a code owner March 16, 2022 21:10
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool stuff. A high level request about code comments before I review in depth. Also, please check the coverage report for this new code, I think you should be able to hit 100% coverage for all error branches. Thank you!

/wait

namespace Network {
namespace IntervalTree {

template <class Data, class N> class IntervalTree {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very difficult/impossible to read this kind of code and understand what is going on as a new reader. Can you please add a large block comment at the top that describes what this does, provides a high level implementation overview, etc.? Also in general I would over comment the code below if possible.

Also in general this kind of code scares me a bit so you might consider writing a small fuzz test for it to help look for corner cases.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Apr 20, 2022
@github-actions
Copy link

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot closed this Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps Approval required for changes to Envoy's external dependencies stale stalebot believes this issue/PR has not been touched recently waiting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants