-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Remove SizeValue
#134871
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
Remove SizeValue
#134871
Conversation
In principle this utility class lets us format potentially-large numbers nicely in API responses, but in practice it is wholly unused for that purpose. Nor is it used to accept user input (e.g. setting values) that could potentially be large. In the few places it appears in the codebase we can just use `Long` instead.
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
|
||
| if (poolInfo != null) { | ||
| if (poolInfo.getQueueSize() != null) { | ||
| maxQueueSize = poolInfo.getQueueSize().singles(); |
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 was the only place we could possibly have used SizeValue for nice formatting of large numbers in a cat API, but the .singles() call forces it to be a pure integer instead.
| private final int max; | ||
| private final TimeValue keepAlive; | ||
| private final SizeValue queueSize; | ||
| private final Long queueSize; |
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.
The only possible observable change is that the Info#toString() now always shows the bare integer rather than something like 10k for larger numbers. I'm not sure this is actually visible to end-users anywhere and honestly IMO that's an improvement.
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.
thx, lgtm 💯
| } | ||
| } | ||
| if (value instanceof SizeValue v) { | ||
| String resolution = request.param("size"); |
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 like that would even conflict with usage of size in cat.transforms and cat.ml_trained_models 💥
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.
Yes, it does.
In principle this utility class lets us format potentially-large numbers nicely in API responses, but in practice it is wholly unused for that purpose. Nor is it used to accept user input (e.g. setting values) that could potentially be large. In the few places it appears in the codebase we can just use `Long` instead.
* upstream/main: Add additional logging to make spotting stats issues easier (elastic#133972) [ESQL] Clean up ESQL enrich landing page (elastic#134820) ES|QL: Make kibana docs for Query settings more consistent (elastic#134881) Add file extension metadata to cache miss counter from SharedBlobCacheService (elastic#134374) Add IT for num_reduced_phases with batched query execution (elastic#134312) Remove `SizeValue` (elastic#134871)
In principle this utility class lets us format potentially-large numbers nicely in API responses, but in practice it is wholly unused for that purpose. Nor is it used to accept user input (e.g. setting values) that could potentially be large. In the few places it appears in the codebase we can just use `Long` instead.
In principle this utility class lets us format potentially-large numbers
nicely in API responses, but in practice it is wholly unused for that
purpose. Nor is it used to accept user input (e.g. setting values) that
could potentially be large. In the few places it appears in the codebase
we can just use
Longinstead.