Remove legacy versioned logic for DefaultSystemMemoryInfo#85761
Merged
rjernst merged 3 commits intoelastic:masterfrom Apr 12, 2022
Merged
Remove legacy versioned logic for DefaultSystemMemoryInfo#85761rjernst merged 3 commits intoelastic:masterfrom
rjernst merged 3 commits intoelastic:masterfrom
Conversation
The machine dependent heap logic uses SystemMemoryInfo to determine how much total memory is available on the system. The default implementation delegates to Java's MX bean to get OS stats. In the past this was only available in Java 14, but since the main branch is now on Java 17, we do not need this logic. This commit refactors the default implementation to no longer need the version check, and to also remove unnecessary forbidden api suppressions for the entire class, instead using a LongSupplier for the memory to isolate the platform specific bean references. relates elastic#85758
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Collaborator
|
Pinging @elastic/es-delivery (Team:Delivery) |
mark-vieira
requested changes
Apr 11, 2022
|
|
||
| return operatingSystemMXBean.getTotalPhysicalMemorySize(); | ||
| @Override | ||
| public long availableSystemMemory() { |
Contributor
There was a problem hiding this comment.
Since we've removed SystemMemoryInfoException from the signature here we should probably remove it everywhere else as well (catch statements, SystemMemoryInfo interface, etc). As far as I can tell this was the only place we ever threw such an exception, unless we want to keep this in place for furture implementations?
Member
Author
There was a problem hiding this comment.
I've removed SystemMemoryInfoException
Member
Author
|
@elasticmachine run elasticsearch-ci/part-2 |
Member
Author
|
@mark-vieira This is ready for another review. |
weizijun
added a commit
to weizijun/elasticsearch
that referenced
this pull request
Apr 13, 2022
* upstream/master: (40 commits) Fix BuildTests serialization (elastic#85827) Use urgent priority for node shutdown cluster state update (elastic#85838) Remove Task classes from HLRC (elastic#85835) Remove unused migration classes (elastic#85834) Remove uses of Charset name parsing (elastic#85795) Remove legacy versioned logic for DefaultSystemMemoryInfo (elastic#85761) Expose proxy settings for GCS repositories (elastic#85785) Remove SLM classes from HLRC (elastic#85825) TSDB: fix the time_series in order collect priority (elastic#85526) Remove ILM classes from HLRC (elastic#85822) FastVectorHighlighter should use ValueFetchers to load source data (elastic#85815) Iteratively execute synchronous ingest processors (elastic#84250) Remove TransformClient from HLRC (elastic#85787) Mute XPackRestIT deprecation/10_basic/Test Deprecations (elastic#85807) Unmute Lintian packaging test (elastic#85778) Add a highlighter unit test base class (elastic#85719) Remove NIO Transport Plugin (elastic#82085) [TEST] Remove token methods from HLRC SecurityClient (elastic#85515) [Test] Use thread-safe hashSet for result collection (elastic#85653) [TEST] Mute BuildTests.testSerialization (elastic#85801) ... # Conflicts: # server/src/test/java/org/elasticsearch/search/aggregations/timeseries/TimeSeriesIndexSearcherTests.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The machine dependent heap logic uses SystemMemoryInfo to determine how
much total memory is available on the system. The default implementation
delegates to Java's MX bean to get OS stats. In the past this was only
available in Java 14, but since the main branch is now on Java 17, we do
not need this logic.
This commit refactors the default implementation to no longer need the
version check, and to also remove unnecessary forbidden api suppressions
for the entire class, instead using a LongSupplier for the memory to
isolate the platform specific bean references.
relates #85758