This is an automated email from the ASF dual-hosted git repository.

ivandasch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 95d5262deba IGNITE-19064 Allow several server nodes and partition 
awareness option in thin client configuration (#10602)
95d5262deba is described below

commit 95d5262deba981f2d917588fc48e45b908db3fe9
Author: Sergey Korotkov <[email protected]>
AuthorDate: Mon Mar 20 14:39:10 2023 +0700

    IGNITE-19064 Allow several server nodes and partition awareness option in 
thin client configuration (#10602)
---
 .../ignitetest/services/utils/ignite_configuration/__init__.py    | 3 ++-
 .../services/utils/templates/client_configuration_macro.j2        | 8 +++++++-
 modules/ducktests/tests/ignitetest/tests/auth_test.py             | 2 +-
 modules/ducktests/tests/ignitetest/tests/thin_client_test.py      | 2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git 
a/modules/ducktests/tests/ignitetest/services/utils/ignite_configuration/__init__.py
 
b/modules/ducktests/tests/ignitetest/services/utils/ignite_configuration/__init__.py
index a9c84f4d295..d9158d46726 100644
--- 
a/modules/ducktests/tests/ignitetest/services/utils/ignite_configuration/__init__.py
+++ 
b/modules/ducktests/tests/ignitetest/services/utils/ignite_configuration/__init__.py
@@ -133,12 +133,13 @@ class IgniteThinClientConfiguration(NamedTuple):
     """
     Thin client configuration.
     """
-    addresses: str = None
+    addresses: list = []
     version: IgniteVersion = DEV_BRANCH
     ssl_params: SslParams = None
     username: str = None
     password: str = None
     ext_beans: list = []
+    partition_awareness_enabled: bool = None
 
     def prepare_ssl(self, test_globals, shared_root):
         """
diff --git 
a/modules/ducktests/tests/ignitetest/services/utils/templates/client_configuration_macro.j2
 
b/modules/ducktests/tests/ignitetest/services/utils/templates/client_configuration_macro.j2
index 7e034bfed9f..ce03ccb297a 100644
--- 
a/modules/ducktests/tests/ignitetest/services/utils/templates/client_configuration_macro.j2
+++ 
b/modules/ducktests/tests/ignitetest/services/utils/templates/client_configuration_macro.j2
@@ -21,7 +21,9 @@
     <bean class="org.apache.ignite.configuration.ClientConfiguration" 
id="thin.client.cfg">
         <property name="addresses">
             <list>
-                <value>{{ config.addresses }}</value>
+                {% for address in config.addresses %}
+                    <value>{{ address }}</value>
+                {% endfor %}
             </list>
         </property>
 
@@ -37,5 +39,9 @@
         <property name="sslTrustCertificateKeyStorePath" value="{{ 
config.ssl_params.trust_store_path }}"/>
         <property name="sslTrustCertificateKeyStorePassword" value="{{ 
config.ssl_params.trust_store_password }}"/>
         {% endif %}
+
+        {% if config.partition_awareness_enabled %}
+        <property name="partitionAwarenessEnabled" value="{{ 
config.partition_awareness_enabled }}"/>
+        {% endif %}
     </bean>
 {% endmacro %}
diff --git a/modules/ducktests/tests/ignitetest/tests/auth_test.py 
b/modules/ducktests/tests/ignitetest/tests/auth_test.py
index 96a5d98815f..7cb61513080 100644
--- a/modules/ducktests/tests/ignitetest/tests/auth_test.py
+++ b/modules/ducktests/tests/ignitetest/tests/auth_test.py
@@ -68,7 +68,7 @@ class AuthenticationTests(IgniteTest):
         ControlUtility(cluster=servers, username=DEFAULT_AUTH_USERNAME, 
password=DEFAULT_AUTH_PASSWORD).activate()
 
         client_cfg = IgniteThinClientConfiguration(
-            addresses=servers.nodes[0].account.hostname + ":" + 
str(config.client_connector_configuration.port),
+            addresses=[servers.nodes[0].account.hostname + ":" + 
str(config.client_connector_configuration.port)],
             version=IgniteVersion(ignite_version),
             username=DEFAULT_AUTH_USERNAME,
             password=DEFAULT_AUTH_PASSWORD)
diff --git a/modules/ducktests/tests/ignitetest/tests/thin_client_test.py 
b/modules/ducktests/tests/ignitetest/tests/thin_client_test.py
index 47351e07d84..90b1b55dee4 100644
--- a/modules/ducktests/tests/ignitetest/tests/thin_client_test.py
+++ b/modules/ducktests/tests/ignitetest/tests/thin_client_test.py
@@ -48,7 +48,7 @@ class ThinClientTest(IgniteTest):
 
         ignite = IgniteService(self.test_context, server_config, 1)
 
-        addresses = ignite.nodes[0].account.hostname + ":" + 
str(server_config.client_connector_configuration.port)
+        addresses = [ignite.nodes[0].account.hostname + ":" + 
str(server_config.client_connector_configuration.port)]
 
         thin_clients = IgniteApplicationService(self.test_context,
                                                 
IgniteThinClientConfiguration(addresses=addresses,

Reply via email to