-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Reinstate BYTE_SIZE_VALUE_ALWAYS_USES_BYTES #122964
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
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
rjernst
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.
Looks fine but let's be consistent with the style of other transport version checks.
server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java
Outdated
Show resolved
Hide resolved
rjernst
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
| ); | ||
| for (var tv : List.of(TransportVersion.current(), BYTE_SIZE_VALUE_ALWAYS_USES_BYTES, BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_90)) { | ||
| for (var desiredUnit : ByteSizeUnit.values()) { | ||
| if (desiredUnit == ByteSizeUnit.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.
Why do we skip 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.
You can't have a fraction of a byte, but you can have a fraction of any other unit.
This allows fractional units, like
1.1KB, to be preserved across the transport protocol instead of turning into1126B.This should be backported to
9.0but the transport versions there are out of sync withmainso I'll hold off until I can coordinate with them.See ES-10585.