-
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
Issue #3840 Static resource byte-range support performance #3910
Conversation
Signed-off-by: Joakim Erdfelt <[email protected]>
+ Reverting toFile().getInputStream() on PathResource + Adding RangeWriter concept for managing open resource across multiple range writes + RangeWriter implementation delegates to HttpContent behaviors Lookup is : - Direct Buffer - Indirect Buffer - ReadableByteChannel (as SeekableByteChannel) - InputStream + Adding unit tests for all RangeWriter implementation to ensure that they behave the same way everywhere. + Making ResourceService use new RangeWriter implementation + Existing DefaultServletRangeTest still works as-is Signed-off-by: Joakim Erdfelt <[email protected]>
The implementation and test case are complete. I'm working on collecting some numbers from tests on 9.2.28.v20190418 (which still had FileResource as default), 9.4.19, and this branch. |
+ SPARSE hint only applies to real os file systems or default file systems, not for all file systems. Signed-off-by: Joakim Erdfelt <[email protected]>
jetty-server/src/main/java/org/eclipse/jetty/server/resource/InputStreamRangeWriter.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.
This is mostly LGTM... modulo my caution about making this change in a dot release... but I can be convinced. Just a few quibbles.
jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Show resolved
Hide resolved
jetty-util/src/test/java/org/eclipse/jetty/util/resource/PathResourceTest.java
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java
Outdated
Show resolved
Hide resolved
+ break out if progress isn't made, loop if not enough progress is made Signed-off-by: Joakim Erdfelt <[email protected]>
+ Construction of PathResource now tests if path belongs to the Default FileSystem or not. This important info for later actions against the PathResource that would need to know the File object for the Path object. Non-Default FileSystem == null Default FileSystem == Path.toFile() Signed-off-by: Joakim Erdfelt <[email protected]>
jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/resource/InputStreamRangeWriter.java
Show resolved
Hide resolved
+ Reset progress on any positive skip value + Throw IOException(EOF) for any negative skip value Signed-off-by: Joakim Erdfelt <[email protected]>
+ Using techniques from SeekableByteChannelRangeWriter with variant for -1 count parameter Signed-off-by: Joakim Erdfelt <[email protected]>
+ Removing unnecessary variables (per PR review) Signed-off-by: Joakim Erdfelt <[email protected]>
@gregw you'll want to review the extra 3 commits since your approval. |
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.
one little niggle...
jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Show resolved
Hide resolved
Signed-off-by: Joakim Erdfelt <[email protected]>
Lookup is :
Signed-off-by: Joakim Erdfelt [email protected]