Skip to content

stats: remove symbol table interface #19597

Merged
jmarantz merged 13 commits intoenvoyproxy:mainfrom
jmarantz:symbol-table-remove-interface
Feb 2, 2022
Merged

stats: remove symbol table interface #19597
jmarantz merged 13 commits intoenvoyproxy:mainfrom
jmarantz:symbol-table-remove-interface

Conversation

@jmarantz
Copy link
Copy Markdown
Contributor

Commit Message: Removes the pure interface for symbol tables, as there is now only one implementation. It was originally added to enable a fake implementation while the impl and its usage was being refined, but now the interface layer just gets in the way. For example it's not possible to add a virtual template method to SymbolTable which would have been useful in #19563
Additional Description:
Risk Level: low
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
…ard decls) to impl.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
…kes sense in its new context.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Copy Markdown
Contributor

@pradeepcrao pradeepcrao left a comment

Choose a reason for hiding this comment

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

Could you also please update source/docs/stats.md?

* same string is re-encoded, it may or may not encode to the same underlying
* symbol.
*/
class SymbolTableImpl : public SymbolTable {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also change the names of files?

Also, if this class is not expected to be mocked, does it make sense declaring it as final?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added 'final' - though that's not something that happens much in Envoy C++ code for other classes that are not expected to be derived from.

I'm wondering if you think the compiler might be able to optimize better with this keyword in this case (no virtual anything), or whether this is just for the human reader. Either way I'm fine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It was more to validate that we indeed don't need an interface for the class, and this is the one and only implementation.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@pradeepcrao
Copy link
Copy Markdown
Contributor

pradeepcrao commented Jan 24, 2022

LGTM (pending file name changes)

@jmarantz
Copy link
Copy Markdown
Contributor Author

/assign-from @envoyproxy/senior-maintainers

@repokitteh-read-only
Copy link
Copy Markdown

@envoyproxy/senior-maintainers assignee is @zuercher

🐱

Caused by: a #19597 (comment) was created by @jmarantz.

see: more, trace.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Copy Markdown
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

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

Generally looks good.

What's the benefit of keeping around envoy/stats/symbol_table.h?

.bazelversion Outdated
@@ -1 +1 @@
5.0.0
4.2.1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Bad merge?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oops I'll get rid of that. not sure what happened.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
Copy link
Copy Markdown
Contributor Author

jmarantz commented Feb 2, 2022

RE envoy/stats/symbol_table.h right now there are a lot of references to that throughout the codebase. I'll do a follow-up to move the forward decls into stats.h, but that would make this PR a bit too big if I do it now.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz merged commit b6a30ac into envoyproxy:main Feb 2, 2022
@jmarantz jmarantz deleted the symbol-table-remove-interface branch February 2, 2022 17:45
jmarantz added a commit that referenced this pull request Feb 4, 2022
…istent (#19788)

Commit Message: follow-up to #19597 -- removes trivial forward decls from envoy/stats/symbol_table.h and renames all the files to reflect this is no longer an interface/impl pattern but a single implementation.

This PR has a lot of files but all the changes are renames of includes except for the removal of envoy/stats/symbol_table.h and the moving of its forward decls into envoy/stats/stats.h.
Additional Description:
Risk Level: llw
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
joshperry pushed a commit to joshperry/envoy that referenced this pull request Feb 13, 2022
Commit Message: Removes the pure interface for symbol tables, as there is now only one implementation. It was originally added to enable a fake implementation while the impl and its usage was being refined, but now the interface layer just gets in the way. For example it's not possible to add a virtual template method to SymbolTable which would have been useful in envoyproxy#19563
Additional Description:
Risk Level: low
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Josh Perry <josh.perry@mx.com>
joshperry pushed a commit to joshperry/envoy that referenced this pull request Feb 13, 2022
…istent (envoyproxy#19788)

Commit Message: follow-up to envoyproxy#19597 -- removes trivial forward decls from envoy/stats/symbol_table.h and renames all the files to reflect this is no longer an interface/impl pattern but a single implementation.

This PR has a lot of files but all the changes are renames of includes except for the removal of envoy/stats/symbol_table.h and the moving of its forward decls into envoy/stats/stats.h.
Additional Description:
Risk Level: llw
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Josh Perry <josh.perry@mx.com>
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

Successfully merging this pull request may close these issues.

3 participants