-
Notifications
You must be signed in to change notification settings - Fork 25.8k
CompressorFactory.compressor #131655
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
CompressorFactory.compressor #131655
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
@mosche - Is this something like what you had in mind? |
mosche
left a comment
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.
Thanks @prdoyle, functionally this looks correct except for the missing assert in isCompressed . Looks like this even fixes some inconsistencies where uncompress might have thrown NotXContentException rather than NotCompressedException.
Though, I think we should try to not expose checkXContentType, adding a new deprecated method smells a bit. Can we keep that internal?
server/src/main/java/org/elasticsearch/common/compress/CompressorFactory.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/common/compress/CompressorFactory.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/common/compress/CompressorFactory.java
Outdated
Show resolved
Hide resolved
|
Ok @mosche I've force-pushed a less ambitious change, with three commits:
|
| throws IOException { | ||
| Objects.requireNonNull(xContentType); | ||
| Compressor compressor = CompressorFactory.compressorForUnknownXContentType(bytes); | ||
| Compressor compressor = CompressorFactory.compressor(bytes); |
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.
In this case, the one call site I didn't change is the bug fix!
mosche
left a comment
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.
lgtm
💚 Backport successful
|
* Refactor: split out non-detecting compressor method * Unit test * Fix createParser not to detect XContentType
…king * upstream/main: (90 commits) Register a blob cache long counter metric for total evicted regions (elastic#131862) Move plan attribute resolution to its own component (elastic#131830) Make restore support multi-project (elastic#131661) Use logically more correct expression (elastic#131869) [ES|QL] Change equals and hashcode for ConstantNullBlock (elastic#131817) Update `TransportVersion` to support a new model (elastic#131488) Correct slow log user for RCS 2.0 (elastic#130140) Revert "Remove 8.17 from dev branches" Mute org.elasticsearch.compute.aggregation.ValuesBytesRefGroupingAggregatorFunctionTests testSomeFiltered elastic#131878 Remove 8.17 from dev branches Revert "CompressorFactory.compressor (elastic#131655)" (elastic#131866) Add fast path for single value in VALUES aggregator (elastic#130510) Resolve inference release tests failing due to missing feature flag (elastic#131841) [Docs] Replace placeholder URLs (elastic#131309) CompressorFactory.compressor (elastic#131655) add availability info for speed loading setting (elastic#131714) [Logstash] Move `elastic_integration` plugin usage to ES logstash-bridge. (elastic#131486) Migrate x-pack-enrich legacy rest tests to new test framework (elastic#131743) Fix plugin example test failures due to deprecation warning (elastic#131819) Remove deprecated function isNotNullAndFoldable (elastic#130944) ...
|
For the record... The backport didn't fail; I canceled it when I realized I needed to revert this in |
This reinstates elastic#131655.
CompressorFactory.compressorwas over-eager in detecting XContent type even when the type was already known.CompressorFactory.compressmethodFixes #131605.