skorotkov commented on a change in pull request #9754:
URL: https://github.com/apache/ignite/pull/9754#discussion_r803421625
##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py
##########
@@ -205,17 +225,49 @@ def prepare_shared_files(self, local_dir):
self._runcmd(f"chmod a+x {local_dir}/*.sh")
self._runcmd(f"{local_dir}/mkcerts.sh")
+ def final_jvm_opts(self):
+ """
+ Return final set of JVM options used to run service. Function takes
into account both default options specified
+ in each subclass in a hierarhy and options passed from the outside via
the constructor.
+
+ The external jvm_opts passed via the constructor have the higher
priority than any default options.
+
+ The external full_jvm_opts passed via the constructor have the
absolute priority and none of the default options
+ or jvm_opts passed via construction are used at all.
+
+ :return: list of strings containing JVM options
+ """
+ return merge_jvm_settings(self.external_full_jvm_opts, []) \
+ if self.external_full_jvm_opts \
+ else merge_jvm_settings(self.__merge_default_jvm_opts(),
+ self.external_jvm_opts if
self.external_jvm_opts else [])
+
+ def __merge_default_jvm_opts(self):
+ """
+ Merge default JVM options through the whole classes hierarhy. Options
from the subclasses have higher priority
+ and overwrite ones from the parents.
+
+ :return: merged set of default JVM options specified in all subclasses
+ """
+
+ # Start from the most specific subclass and go up until the root class
(IgniteSpec)
+ merged_default_jvm_opts = self.get_default_jvm_opts()
Review comment:
The idea is to localize logic of option merging in a single place (in
base class). Other way logic is spread all over the hyerarhy and each and every
child should do merge correctly. Which is error prone.
It was done more or less so in the original approach. And the
IgniteApplicationSpec already failed to do merge correctly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]