-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Tries cleanup #5566
Tries cleanup #5566
Conversation
jetty-util/src/main/java/org/eclipse/jetty/util/OpaqueIndex.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/OpaqueIndex.java
Outdated
Show resolved
Hide resolved
I've now removed all references to the
|
jetty-util/src/main/java/org/eclipse/jetty/util/MutableOpaqueIndex.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/OpaqueIndex.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/MutableIndex.java
Outdated
Show resolved
Hide resolved
@lachlan-roberts I've added you as a reviewer to get your opinion about the look and feel of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Can we push on this to get it in before a .0.0
Even if the impls are not perfect, they are the same as we had before and the Builder abstraction would be good to get in for a .0.0
jetty-util/src/main/java/org/eclipse/jetty/util/MutableIndex.java
Outdated
Show resolved
Hide resolved
jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java
Outdated
Show resolved
Hide resolved
if (_field == null) | ||
{ | ||
HttpField field = new HttpField(_header, caseInsensitiveHeader(_headerString, _header.asString()), _valueString); | ||
if (_fieldCache.put(field)) | ||
_field = field; | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm not having isFull changes this a bit... plus I;m not sure it is right. Maybe something like:
if (_field == null) | |
{ | |
HttpField field = new HttpField(_header, caseInsensitiveHeader(_headerString, _header.asString()), _valueString); | |
if (_fieldCache.put(field)) | |
_field = field; | |
} | |
else | |
if (_field == null) | |
_field = new HttpField(_header, caseInsensitiveHeader(_headerString, _header.asString()), _valueString); | |
if (!_fieldCache.put(field)) | |
{ | |
_fieldCache.clear(); | |
_fieldCache.put(field); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we should rely on some eviction algorithm in the index instead of clearing it. But that's quite a can of worm that should be left closed if possible.
Let's use that if (!put) clear & put
logic, it should be roughly equivalent to what the old code is doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think before it just filled up the cache and left it as is.... so maybe we just put and ignore the return for now.... we can refine in future PRs
jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java
Show resolved
Hide resolved
jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java
Show resolved
Hide resolved
jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Cipher.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No show stoppers for me now... but leave the issue open so we can refine a bit after .0.0
jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java
Outdated
Show resolved
Hide resolved
… Builders Signed-off-by: Ludovic Orban <[email protected]>
Replace all
Trie
usages in the code base with a more abstract hierarchy of*Index
interfaces, and do not directly expose the implementations, requiring the use of a factory exposed via the builder pattern to create instances.This should help maintenance as the implementation will be chosen based on a set of requirements (case-sensitivity, mutability...) that the factory can interpret as it wants to provide the best implementation complying with them.
Clears the path for a proper fix for #5291