You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/04/12 15:08:27 UTC

[GitHub] [ignite] eadha opened a new pull request #8998: Ignite-14509 XML-based configuration for thin client

eadha opened a new pull request #8998:
URL: https://github.com/apache/ignite/pull/8998


   Now it's possible to use XML based configuration for thin clients.
   Use simple test as example:
   tests/ignitetest/tests/thin_client_test.py
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov commented on a change in pull request #8998: Ignite-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8998:
URL: https://github.com/apache/ignite/pull/8998#discussion_r615688211



##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java
##########
@@ -38,9 +37,23 @@
 public class IgniteAwareApplicationService {
     /** Logger. */
     private static final Logger log = LogManager.getLogger(IgniteAwareApplicationService.class.getName());
+    /** Ignite mode = node. */
+    public static final String IGNITE_START_NODE = "NODE";

Review comment:
       These constants are useless. Please, remove them.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov commented on a change in pull request #8998: Ignite-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8998:
URL: https://github.com/apache/ignite/pull/8998#discussion_r615726137



##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java
##########
@@ -39,8 +38,18 @@
     /** Logger. */
     private static final Logger log = LogManager.getLogger(IgniteAwareApplicationService.class.getName());
 
-    /** Thin client connection string variable. */
-    public static final String THIN_CLIENT_CONNECTION = "thin_client_connection";
+    /**
+     * Ignite start modes.
+     */
+    protected enum StartIgniteMode {
+        /** Ignite mode = node. */
+        NODE,
+        /** gnite start mode = thin client. */

Review comment:
       typo -> **I**gnite




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov commented on a change in pull request #8998: Ignite-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8998:
URL: https://github.com/apache/ignite/pull/8998#discussion_r615728021



##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py
##########
@@ -73,16 +82,31 @@ def __init__(self, context, config, num_nodes, startup_timeout_sec, shutdown_tim
         self.main_java_class = main_java_class
         self.startup_timeout_sec = startup_timeout_sec
         self.shutdown_timeout_sec = shutdown_timeout_sec
+        self.thin_client_config = thin_client_config
 
-        self.spec = resolve_spec(self, context, config, main_java_class, **kwargs)
+        self.spec = resolve_spec(self, context, config, main_java_class,
+                                 self.mode, thin_client_config, **kwargs)
         self.init_logs_attribute()
 
         self.disconnected_nodes = []
-        self.start_ignite = kwargs.get("start_ignite", True)
 
+    # pylint: disable=R1705
     @property
     def version(self):
-        return self.config.version
+        if not self.thin_client_config:
+            return self.config.version
+        else:
+            return self.thin_client_config.version
+
+    @property
+    def mode(self):
+        if self.thin_client_config:
+            return IgniteAwareService.StartIgnite.THIN_CLIENT
+        else:
+            if self.config:

Review comment:
       This can be rewritten as
   
   `return IgniteAwareService.StartIgnite.NODE if self.config else IgniteAwareService.StartIgnite.NONE`
   
   Please, import `StartIgnite` to use shorten names.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov commented on a change in pull request #8998: Ignite-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8998:
URL: https://github.com/apache/ignite/pull/8998#discussion_r615686728



##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java
##########
@@ -38,9 +37,23 @@
 public class IgniteAwareApplicationService {
     /** Logger. */
     private static final Logger log = LogManager.getLogger(IgniteAwareApplicationService.class.getName());
+    /** Ignite mode = node. */
+    public static final String IGNITE_START_NODE = "NODE";
+    /** Ignite start mode = thin client. */
+    public static final String IGNITE_START_THIN_CLIENT = "THIN_CLIENT";
+
+    /**
+     * Ignite start modes.
+     */
+    protected enum startIgniteMode {

Review comment:
       Class name should start from a capital letter.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov commented on a change in pull request #8998: Ignite-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8998:
URL: https://github.com/apache/ignite/pull/8998#discussion_r615727043



##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py
##########
@@ -57,9 +57,18 @@ class NetPart(IntEnum):
         OUTPUT = 1
         ALL = 2
 
+    @constructible
+    class StartIgnite(IntEnum):
+        """
+        Network part to emulate failure.

Review comment:
       Wrong comment. Please, fix it.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov commented on a change in pull request #8998: Ignite-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8998:
URL: https://github.com/apache/ignite/pull/8998#discussion_r615690290



##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py
##########
@@ -73,16 +82,29 @@ def __init__(self, context, config, num_nodes, startup_timeout_sec, shutdown_tim
         self.main_java_class = main_java_class
         self.startup_timeout_sec = startup_timeout_sec
         self.shutdown_timeout_sec = shutdown_timeout_sec
+        self.thin_client_config = thin_client_config
+
+        if self.thin_client_config:
+            self.start_ignite = IgniteAwareService.StartIgnite.THIN_CLIENT

Review comment:
       start_ignite -> mode
   Why do we need an instance variable here? 
   It seems only a local variable required.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov commented on a change in pull request #8998: Ignite-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8998:
URL: https://github.com/apache/ignite/pull/8998#discussion_r615691035



##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py
##########
@@ -73,16 +82,29 @@ def __init__(self, context, config, num_nodes, startup_timeout_sec, shutdown_tim
         self.main_java_class = main_java_class
         self.startup_timeout_sec = startup_timeout_sec
         self.shutdown_timeout_sec = shutdown_timeout_sec
+        self.thin_client_config = thin_client_config
+
+        if self.thin_client_config:

Review comment:
       1. Please, rename `start_ignite` to `mode` 
   2. Make it property (like version or project).




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov merged pull request #8998: IGNITE-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov merged pull request #8998:
URL: https://github.com/apache/ignite/pull/8998


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] nizhikov commented on a change in pull request #8998: Ignite-14509 XML-based configuration for thin client

Posted by GitBox <gi...@apache.org>.
nizhikov commented on a change in pull request #8998:
URL: https://github.com/apache/ignite/pull/8998#discussion_r615687858



##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java
##########
@@ -50,7 +63,7 @@ public static void main(String[] args) throws Exception {
 
         String[] params = args[0].split(",");
 
-        boolean startIgnite = Boolean.parseBoolean(params[0]);
+        String startIgnite = params[0];

Review comment:
       Please, rewrite this to
   ```
   StartIgniteMode mode = StartIgniteMode.valueOf(params[0]);
   ...
   if (mode == NODE) {
   ...
   }
   else if (mode == THIS_CLIENT) {
   ...
   }
   else if (mode == NONE) {
   }
   else
       throw new IllegalArgumentException("Unknown mode " + mode);
   ```




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org