[ignite] branch master updated: IGNITE-12364 Migrate JMS module to ignite-extensions - Fixes #8198.

2020-08-31 Thread samaitra
This is an automated email from the ASF dual-hosted git repository.

samaitra 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 974f290  IGNITE-12364 Migrate JMS module to ignite-extensions - Fixes 
#8198.
974f290 is described below

commit 974f290d426af1bdc7bc5e78c9b4d93508735378
Author: samaitra 
AuthorDate: Mon Aug 31 20:08:44 2020 -0500

IGNITE-12364 Migrate JMS module to ignite-extensions - Fixes #8198.

Signed-off-by: samaitra 
---
 assembly/libs/README.txt   |   1 -
 modules/jms11/README.txt   |  29 -
 modules/jms11/licenses/apache-2.0.txt  | 202 --
 modules/jms11/pom.xml  | 104 ---
 .../apache/ignite/stream/jms11/JmsStreamer.java| 565 
 .../ignite/stream/jms11/MessageTransformer.java|  41 --
 .../apache/ignite/stream/jms11/package-info.java   |  22 -
 .../ignite/stream/jms11/IgniteJmsStreamerTest.java | 708 -
 .../stream/jms11/IgniteJmsStreamerTestSuite.java   |  34 -
 .../ignite/stream/jms11/TestTransformers.java  | 127 
 .../apache/ignite/stream/jms11/package-info.java   |  22 -
 pom.xml|   1 -
 12 files changed, 1856 deletions(-)

diff --git a/assembly/libs/README.txt b/assembly/libs/README.txt
index 8bb3bad..b36ab73 100644
--- a/assembly/libs/README.txt
+++ b/assembly/libs/README.txt
@@ -80,7 +80,6 @@ The following modules are available:
 - ignite-hibernate5 (for Hibernate5 integration)
 - ignite-indexing (for SQL querying and indexing)
 - ignite-jcl (for Apache Commons logging)
-- ignite-jms11 (for streaming messaging from JMS queue or topic into Ignite)
 - ignite-jta (for XA integration)
 - ignite-kafka (for streaming messages from Apache Kafka into Ignite)
 - ignite-logj4 (for Log4j logging)
diff --git a/modules/jms11/README.txt b/modules/jms11/README.txt
deleted file mode 100644
index 3f0d213..000
--- a/modules/jms11/README.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Apache Ignite JMS 1.1 Module
-
-
-Apache Ignite JMS 1.1 module provides a streamer to consume JMS queue and 
topic messages into
-Apache Ignite caches.
-
-Importing Apache Ignite JMS 1.1 Module In Maven Project
-
-
-If you are using Maven to manage dependencies of your project, you can add the 
JMS 1.1 module
-dependency like this (replace '${ignite.version}' with actual Ignite version 
you are
-interested in):
-
-http://maven.apache.org/POM/4.0.0;
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-http://maven.apache.org/xsd/maven-4.0.0.xsd;>
-...
-
-...
-
-org.apache.ignite
-ignite-jms11
-${ignite.version}
-
-...
-
-...
-
diff --git a/modules/jms11/licenses/apache-2.0.txt 
b/modules/jms11/licenses/apache-2.0.txt
deleted file mode 100644
index d645695..000
--- a/modules/jms11/licenses/apache-2.0.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
-   Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-  "License" shall mean the terms and conditions for use, reproduction,
-  and distribution as defined by Sections 1 through 9 of this document.
-
-  "Licensor" shall mean the copyright owner or entity authorized by
-  the copyright owner that is granting the License.
-
-  "Legal Entity" shall mean the union of the acting entity and all
-  other entities that control, are controlled by, or are under common
-  control with that entity. For the purposes of this definition,
-  "control" means (i) the power, direct or indirect, to cause the
-  direction or management of such entity, whether by contract or
-  otherwise, or (ii) ownership of fifty percent (50%) or more of the
-  outstanding shares, or (iii) beneficial ownership of such entity.
-
-  "You" (or "Your") shall mean an individual or Legal Entity
-  exercising permissions granted by this License.
-
-  "Source" form shall mean the preferred form for making modifications,
-  including but not limited to software source code, documentation
-  source, and configuration files.
-
-  "Object" form shall mean any form resulting from mechanical
-  transformation or translation of a Source form, including but
-  not limited to compiled object code, generated documentation,
-  and conversions to other media types.
-
-  "Work" shall mean the work of authorship, whether in Source or
-  Object form, made available under the License, as indicated by a

[ignite-extensions] branch master updated: IGNITE-12364 Migrate JMS module to ignite-extensions - Fixes #20.

2020-08-31 Thread samaitra
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 1f4cd8c  IGNITE-12364 Migrate JMS module to ignite-extensions - Fixes 
#20.
1f4cd8c is described below

commit 1f4cd8c38deb2e5ccf5a33985eb3f2b9e3c00704
Author: samaitra 
AuthorDate: Mon Aug 31 19:50:44 2020 -0500

IGNITE-12364 Migrate JMS module to ignite-extensions - Fixes #20.

Signed-off-by: samaitra 
---
 modules/jms11-ext/README.txt   |  29 +
 modules/jms11-ext/licenses/apache-2.0.txt  | 202 ++
 .../modules/core/src/test/config/log4j-test.xml|  97 +++
 .../modules/core/src/test/config/tests.properties  | 153 +
 modules/jms11-ext/pom.xml  | 104 +++
 .../apache/ignite/stream/jms11/JmsStreamer.java| 565 
 .../ignite/stream/jms11/MessageTransformer.java|  41 ++
 .../apache/ignite/stream/jms11/package-info.java   |  22 +
 .../ignite/stream/jms11/IgniteJmsStreamerTest.java | 708 +
 .../stream/jms11/IgniteJmsStreamerTestSuite.java   |  34 +
 .../ignite/stream/jms11/TestTransformers.java  | 127 
 .../apache/ignite/stream/jms11/package-info.java   |  22 +
 pom.xml|   1 +
 13 files changed, 2105 insertions(+)

diff --git a/modules/jms11-ext/README.txt b/modules/jms11-ext/README.txt
new file mode 100644
index 000..0b61d55
--- /dev/null
+++ b/modules/jms11-ext/README.txt
@@ -0,0 +1,29 @@
+Apache Ignite JMS 1.1 Module
+
+
+Apache Ignite JMS 1.1 module provides a streamer to consume JMS queue and 
topic messages into
+Apache Ignite caches.
+
+Importing Apache Ignite JMS 1.1 Module In Maven Project
+
+
+If you are using Maven to manage dependencies of your project, you can add the 
JMS 1.1 module
+dependency like this (replace '${ignite.version}' with actual Ignite version 
you are
+interested in):
+
+http://maven.apache.org/POM/4.0.0;
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+...
+
+...
+
+org.apache.ignite
+ignite-jms11-ext
+${ignite.version}
+
+...
+
+...
+
diff --git a/modules/jms11-ext/licenses/apache-2.0.txt 
b/modules/jms11-ext/licenses/apache-2.0.txt
new file mode 100644
index 000..d645695
--- /dev/null
+++ b/modules/jms11-ext/licenses/apache-2.0.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+   Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+  "License" shall mean the terms and conditions for use, reproduction,
+  and distribution as defined by Sections 1 through 9 of this document.
+
+  "Licensor" shall mean the copyright owner or entity authorized by
+  the copyright owner that is granting the License.
+
+  "Legal Entity" shall mean the union of the acting entity and all
+  other entities that control, are controlled by, or are under common
+  control with that entity. For the purposes of this definition,
+  "control" means (i) the power, direct or indirect, to cause the
+  direction or management of such entity, whether by contract or
+  otherwise, or (ii) ownership of fifty percent (50%) or more of the
+  outstanding shares, or (iii) beneficial ownership of such entity.
+
+  "You" (or "Your") shall mean an individual or Legal Entity
+  exercising permissions granted by this License.
+
+  "Source" form shall mean the preferred form for making modifications,
+  including but not limited to software source code, documentation
+  source, and configuration files.
+
+  "Object" form shall mean any form resulting from mechanical
+  transformation or translation of a Source form, including but
+  not limited to compiled object code, generated documentation,
+  and conversions to other media types.
+
+  "Work" shall mean the work of authorship, whether in Source or
+  Object form, made available under the License, as indicated by a
+  copyright notice that is included in or attached to the work
+  (an example is provided in the Appendix below).
+
+  "Derivative Works" shall mean any work, whether in Source or Object
+  form, that is based on (or derived from) the Work and for which the
+  editorial revisions, annotations, elaborations, or other modifications
+  represent, as a whole, an original work of authorship. For the purposes
+  of this License, Derivative Works shall not 

[ignite] branch ignite-2.9-revert-12568 created (now ed52559)

2020-08-31 Thread agoncharuk
This is an automated email from the ASF dual-hosted git repository.

agoncharuk pushed a change to branch ignite-2.9-revert-12568
in repository https://gitbox.apache.org/repos/asf/ignite.git.


  at ed52559  Revert "IGNITE-12568 MessageFactory is refactored in order to 
detect registration of message with the same direct type"

This branch includes the following new commits:

 new f1fcea2  Revert "IGNITE-12756 TcpCommunication SPI metrics improvement"
 new 3d57f23  Revert "IGNITE-12682 
IgniteMessageFactoryImpl.registerCustom() method is removed as potentially 
dangerous"
 new ed52559  Revert "IGNITE-12568 MessageFactory is refactored in order to 
detect registration of message with the same direct type"

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[ignite] 01/03: Revert "IGNITE-12756 TcpCommunication SPI metrics improvement"

2020-08-31 Thread agoncharuk
This is an automated email from the ASF dual-hosted git repository.

agoncharuk pushed a commit to branch ignite-2.9-revert-12568
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit f1fcea2e8f788a3039fe91218b990c21c778f238
Author: Alexey Goncharuk 
AuthorDate: Mon Aug 31 18:59:34 2020 +0300

Revert "IGNITE-12756 TcpCommunication SPI metrics improvement"

This reverts commit 683f22e6
---
 .../internal/managers/GridManagerAdapter.java  |  18 ---
 .../managers/communication/GridIoManager.java  | 100 ++---
 .../communication/IgniteMessageFactoryImpl.java|  37 +
 .../processors/resource/GridResourceIoc.java   |  21 ++-
 .../processors/resource/GridResourceProcessor.java |   4 +-
 .../internal/resources/MetricManagerResource.java  |  32 +
 .../org/apache/ignite/spi/IgniteSpiAdapter.java|  33 +
 .../org/apache/ignite/spi/IgniteSpiContext.java|  36 -
 .../tcp/TcpCommunicationMetricsListener.java   | 156 +
 .../spi/communication/tcp/TcpCommunicationSpi.java |  29 ++--
 .../IgniteMessageFactoryImplTest.java  |  47 +--
 .../ignite/testframework/GridSpiTestContext.java   |  30 +---
 .../testframework/junits/IgniteTestResources.java  |  16 ++-
 13 files changed, 199 insertions(+), 360 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
index d10d774..d2952d9 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
@@ -23,7 +23,6 @@ import java.util.Collections;
 import java.util.IdentityHashMap;
 import java.util.Map;
 import java.util.UUID;
-import java.util.function.Consumer;
 import javax.cache.expiry.Duration;
 import javax.cache.expiry.ExpiryPolicy;
 import javax.cache.expiry.TouchedExpiryPolicy;
@@ -63,7 +62,6 @@ import org.apache.ignite.spi.IgniteSpiTimeoutObject;
 import org.apache.ignite.spi.discovery.DiscoveryDataBag;
 import org.apache.ignite.spi.discovery.DiscoveryDataBag.GridDiscoveryData;
 import 
org.apache.ignite.spi.discovery.DiscoveryDataBag.JoiningNodeDiscoveryData;
-import org.apache.ignite.spi.metric.ReadOnlyMetricRegistry;
 import org.jetbrains.annotations.Nullable;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -626,22 +624,6 @@ public abstract class GridManagerAdapter implements GridMan
 ctx.discovery().resolveCommunicationError(node, err);
 }
 
-@Override public ReadOnlyMetricRegistry 
getOrCreateMetricRegistry(String name) {
-return ctx.metric().registry(name);
-}
-
-@Override public void removeMetricRegistry(String name) {
-ctx.metric().remove(name);
-}
-
-@Override public Iterable 
metricRegistries() {
-return ctx.metric();
-}
-
-@Override public void 
addMetricRegistryCreationListener(Consumer lsnr) {
-ctx.metric().addMetricRegistryCreationListener(lsnr);
-}
-
 /**
  * @param e Exception to handle.
  * @return GridSpiException Converted exception.
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 25581ce..552613f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -432,6 +432,56 @@ public class GridIoManager extends 
GridManagerAdapter spi = getSpi();
+
+if ((CommunicationSpi)spi instanceof TcpCommunicationSpi)
+getTcpCommunicationSpi().setConnectionRequestor(invConnHandler);
+
+startSpi();
+
+MetricRegistry ioMetric = ctx.metric().registry(COMM_METRICS);
+
+ioMetric.register(OUTBOUND_MSG_QUEUE_CNT, 
spi::getOutboundMessagesQueueSize,
+"Outbound messages queue size.");
+
+ioMetric.register(SENT_MSG_CNT, spi::getSentMessagesCount, "Sent 
messages count.");
+
+ioMetric.register(SENT_BYTES_CNT, spi::getSentBytesCount, "Sent bytes 
count.");
+
+ioMetric.register(RCVD_MSGS_CNT, spi::getReceivedMessagesCount,
+"Received messages count.");
+
+ioMetric.register(RCVD_BYTES_CNT, spi::getReceivedBytesCount, 
"Received bytes count.");
+
+getSpi().setListener(commLsnr = new 
CommunicationListenerEx() {
+@Override public void onMessage(UUID nodeId, Serializable msg, 
IgniteRunnable 

[ignite] 02/03: Revert "IGNITE-12682 IgniteMessageFactoryImpl.registerCustom() method is removed as potentially dangerous"

2020-08-31 Thread agoncharuk
This is an automated email from the ASF dual-hosted git repository.

agoncharuk pushed a commit to branch ignite-2.9-revert-12568
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 3d57f23a614595d246fc70c276ca8347ba868148
Author: Alexey Goncharuk 
AuthorDate: Mon Aug 31 19:02:59 2020 +0300

Revert "IGNITE-12682 IgniteMessageFactoryImpl.registerCustom() method is 
removed as potentially dangerous"

This reverts commit 2c428d53
---
 .../communication/IgniteMessageFactoryImpl.java| 26 ++
 .../GridManagerLocalMessageListenerSelfTest.java   | 30 ++-
 .../GridCommunicationSendMessageSelfTest.java  | 31 ++-
 .../MessageDirectTypeIdConflictTest.java   | 96 --
 .../GridCacheConditionalDeploymentSelfTest.java| 32 ++--
 .../ignite/plugin/PluginConfigurationTest.java | 92 -
 .../GridAbstractCommunicationSelfTest.java | 19 ++---
 .../communication/GridCacheMessageSelfTest.java| 49 +--
 ...pCommunicationSpiConcurrentConnectSelfTest.java | 21 ++---
 ...idTcpCommunicationSpiMultithreadedSelfTest.java | 18 +---
 ...GridTcpCommunicationSpiRecoveryAckSelfTest.java | 21 ++---
 .../GridTcpCommunicationSpiRecoverySelfTest.java   | 21 ++---
 ...TcpCommunicationRecoveryAckClosureSelfTest.java | 21 ++---
 .../tcp/TcpCommunicationStatisticsTest.java| 30 ++-
 .../ignite/testframework/GridSpiTestContext.java   | 34 
 15 files changed, 309 insertions(+), 232 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteMessageFactoryImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteMessageFactoryImpl.java
index 957ef7c..eb89043 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteMessageFactoryImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteMessageFactoryImpl.java
@@ -20,6 +20,8 @@ package org.apache.ignite.internal.managers.communication;
 import java.lang.reflect.Array;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Supplier;
 
 import org.apache.ignite.IgniteException;
@@ -28,6 +30,7 @@ import 
org.apache.ignite.plugin.extensions.communication.Message;
 import org.apache.ignite.plugin.extensions.communication.MessageFactory;
 import 
org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
 import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.TestOnly;
 
 /**
  * Message factory implementation which is responsible for instantiation of 
all communication messages.
@@ -39,6 +42,9 @@ public class IgniteMessageFactoryImpl implements 
IgniteMessageFactory {
 /** Array size. */
 private static final int ARR_SIZE = 1 << Short.SIZE;
 
+/** Custom messages registry. Used for test purposes. */
+private static final Map> CUSTOM = new 
ConcurrentHashMap<>();
+
 /** Message suppliers. */
 private final Supplier[] msgSuppliers = (Supplier[]) 
Array.newInstance(Supplier.class, ARR_SIZE);
 
@@ -115,6 +121,9 @@ public class IgniteMessageFactoryImpl implements 
IgniteMessageFactory {
 Supplier supplier = 
msgSuppliers[directTypeToIndex(directType)];
 
 if (supplier == null)
+supplier = CUSTOM.get(directType);
+
+if (supplier == null)
 throw new IgniteException("Invalid message type: " + directType);
 
 return supplier.get();
@@ -137,4 +146,21 @@ public class IgniteMessageFactoryImpl implements 
IgniteMessageFactory {
 
 return (short)res;
 }
+
+/**
+ * Registers factory for custom message. Used for test purposes.
+ *
+ * @param type Message type.
+ * @param c Message producer.
+ *
+ * @deprecated Should be removed. Please don't use this method anymore.
+ * Consider using of plugin with own message types.
+ */
+@TestOnly
+@Deprecated
+public static void registerCustom(short type, Supplier c) {
+assert c != null;
+
+CUSTOM.put(type, c);
+}
 }
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/managers/GridManagerLocalMessageListenerSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/managers/GridManagerLocalMessageListenerSelfTest.java
index 9b20690..6dd103e 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/managers/GridManagerLocalMessageListenerSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/managers/GridManagerLocalMessageListenerSelfTest.java
@@ -23,13 +23,8 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.communication.GridIoUserMessage;
+import 

[ignite] 03/03: Revert "IGNITE-12568 MessageFactory is refactored in order to detect registration of message with the same direct type"

2020-08-31 Thread agoncharuk
This is an automated email from the ASF dual-hosted git repository.

agoncharuk pushed a commit to branch ignite-2.9-revert-12568
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit ed52559eb95c913e4b6ebc1b334f60c27ddbac26
Author: Alexey Goncharuk 
AuthorDate: Mon Aug 31 19:24:24 2020 +0300

Revert "IGNITE-12568 MessageFactory is refactored in order to detect 
registration of message with the same direct type"

This reverts commit 65c30ec6
---
 .../managers/communication/GridIoManager.java  |4 +-
 .../communication/GridIoMessageFactory.java| 1127 
 .../communication/IgniteMessageFactoryImpl.java|  166 ---
 .../communication/IgniteMessageFactory.java|   39 -
 .../extensions/communication/MessageFactory.java   |3 -
 .../communication/MessageFactoryProvider.java  |   46 -
 .../tcp/TcpCommunicationMetricsListener.java   |   16 +-
 .../org.apache.ignite.plugin.PluginProvider|1 -
 .../GridManagerLocalMessageListenerSelfTest.java   |   14 +-
 .../GridCommunicationSendMessageSelfTest.java  |   19 +-
 .../IgniteMessageFactoryImplTest.java  |  198 
 .../MessageDirectTypeIdConflictTest.java   |  210 
 .../GridCacheConditionalDeploymentSelfTest.java|   22 +-
 ...niteCacheContinuousQueryImmutableEntryTest.java |8 +-
 .../GridAbstractCommunicationSelfTest.java |   17 +-
 .../communication/GridCacheMessageSelfTest.java|   61 +-
 .../tcp/GridTcpCommunicationSpiAbstractTest.java   |   16 +-
 ...pCommunicationSpiConcurrentConnectSelfTest.java |   21 +-
 ...idTcpCommunicationSpiMultithreadedSelfTest.java |9 +-
 ...GridTcpCommunicationSpiRecoveryAckSelfTest.java |   17 +-
 .../GridTcpCommunicationSpiRecoverySelfTest.java   |   13 +-
 ...TcpCommunicationRecoveryAckClosureSelfTest.java |   19 +-
 .../tcp/TcpCommunicationStatisticsTest.java|   35 +-
 .../ignite/testframework/GridSpiTestContext.java   |3 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java|5 -
 .../ignite/util/GridMessageCollectionTest.java |5 +-
 .../h2/twostep/msg/GridH2ValueMessageFactory.java  |  129 ++-
 27 files changed, 1220 insertions(+), 1003 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 552613f..28c5881 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -517,8 +517,6 @@ public class GridIoManager extends 
GridManagerAdapter compMsgs = new ArrayList<>();
 
-compMsgs.add(new GridIoMessageFactory());
-
 for (IgniteComponentType compType : IgniteComponentType.values()) {
 MessageFactory f = compType.messageFactory();
 
@@ -529,7 +527,7 @@ public class GridIoManager extends 
GridManagerAdapter> CUSTOM = new 
ConcurrentHashMap<>();
+
+/** Extensions. */
+private final MessageFactory[] ext;
+
+/**
+ * @param ext Extensions.
+ */
+public GridIoMessageFactory(MessageFactory[] ext) {
+this.ext = ext;
 }
 
 /** {@inheritDoc} */
 @Override public Message create(short type) {
-throw new UnsupportedOperationException();
+Message msg = null;
+
+switch (type) {
+// -54 is reserved for SQL.
+// -46 ... -51 - snapshot messages.
+case -61:
+msg = new IgniteDiagnosticMessage();
+
+break;
+
+case -53:
+msg = new SchemaOperationStatusMessage();
+
+break;
+
+case -52:
+msg = new GridIntList();
+
+break;
+
+case -51:
+msg = new NearCacheUpdates();
+
+break;
+
+case -50:
+msg = new GridNearAtomicCheckUpdateRequest();
+
+break;
+
+case -49:
+msg = new UpdateErrors();
+
+break;
+
+case -48:
+msg = new GridDhtAtomicNearResponse();
+
+break;
+
+case -45:
+msg = new GridChangeGlobalStateMessageResponse();
+
+break;
+
+case -44:
+msg = new HandshakeMessage2();
+
+break;
+
+case -43:
+msg = new IgniteIoTestMessage();
+
+break;
+
+case -36:
+msg = new GridDhtAtomicSingleUpdateRequest();
+
+break;
+
+case -27:
+msg = new GridDhtTxOnePhaseCommitAckRequest();
+
+break;
+
+case -26:
+msg = new TxLockList();
+
+break;
+
+case -25:
+msg = new TxLock();
+
+   

[ignite] branch ignite-2.9 updated (1303767 -> 03c7e2a)

2020-08-31 Thread alexpl
This is an automated email from the ASF dual-hosted git repository.

alexpl pushed a change to branch ignite-2.9
in repository https://gitbox.apache.org/repos/asf/ignite.git.


from 1303767  IGNITE-13328 Fixed: control.sh returns invalid error code - 
Fixes #8123.
 new 455bb28  IGNITE-12718 pyignite: added SSL keyfile password argument. 
(#7480)
 new 03c7e2a  IGNITE-13369 .NET: Clear cached node data on client disconnect

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../config/ssl/generate_certificates.sh|  18 +--
 .../Apache.Ignite.Core.Tests/ReconnectTest.cs  |  37 ++
 .../Impl/Cluster/ClusterGroupImpl.cs   |   9 
 .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs   |   8 ++-
 .../python/pyignite/connection/__init__.py |   4 ++
 .../platforms/python/pyignite/connection/ssl.py|  40 +--
 .../tests/config/ssl.xml}  |  15 +++---
 .../platforms/python/tests/config/ssl/README.txt   |   3 ++
 .../python/tests/config/ssl/client_full.pem|  52 
 .../tests/config/ssl/client_with_pass_full.pem |  54 +
 .../platforms/python/tests/config/ssl/server.jks   | Bin 0 -> 2380 bytes
 .../platforms/python/tests/config/ssl/trust.jks| Bin 0 -> 1346 bytes
 modules/platforms/python/tests/conftest.py |  11 -
 modules/platforms/python/tests/test_handshake.py   |   3 +-
 14 files changed, 223 insertions(+), 31 deletions(-)
 copy modules/platforms/{cpp/odbc-test/config/queries-ssl.xml => 
python/tests/config/ssl.xml} (88%)
 create mode 100644 modules/platforms/python/tests/config/ssl/README.txt
 create mode 100644 modules/platforms/python/tests/config/ssl/client_full.pem
 create mode 100644 
modules/platforms/python/tests/config/ssl/client_with_pass_full.pem
 create mode 100644 modules/platforms/python/tests/config/ssl/server.jks
 create mode 100644 modules/platforms/python/tests/config/ssl/trust.jks



[ignite] 01/02: IGNITE-12718 pyignite: added SSL keyfile password argument. (#7480)

2020-08-31 Thread alexpl
This is an automated email from the ASF dual-hosted git repository.

alexpl pushed a commit to branch ignite-2.9
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 455bb285509e811dac3cbd32261fb9deebaa
Author: Andrey Kuznetsov 
AuthorDate: Mon Aug 31 15:16:25 2020 +0300

IGNITE-12718 pyignite: added SSL keyfile password argument. (#7480)

Co-authored-by: Nikolay Izhikov 
(cherry picked from commit baf8c673c41a1790ef0a244862e6abfbd4eadbf5)
---
 .../config/ssl/generate_certificates.sh|  18 +--
 .../python/pyignite/connection/__init__.py |   4 ++
 .../platforms/python/pyignite/connection/ssl.py|  40 --
 modules/platforms/python/tests/config/ssl.xml  |  58 +
 .../platforms/python/tests/config/ssl/README.txt   |   3 ++
 .../python/tests/config/ssl/client_full.pem|  52 ++
 .../tests/config/ssl/client_with_pass_full.pem |  54 +++
 .../platforms/python/tests/config/ssl/server.jks   | Bin 0 -> 2380 bytes
 .../platforms/python/tests/config/ssl/trust.jks| Bin 0 -> 1346 bytes
 modules/platforms/python/tests/conftest.py |  11 +++-
 modules/platforms/python/tests/test_handshake.py   |   3 +-
 11 files changed, 221 insertions(+), 22 deletions(-)

diff --git 
a/modules/platforms/cpp/thin-client-test/config/ssl/generate_certificates.sh 
b/modules/platforms/cpp/thin-client-test/config/ssl/generate_certificates.sh
index 5e8303a..e4f41e2 100755
--- a/modules/platforms/cpp/thin-client-test/config/ssl/generate_certificates.sh
+++ b/modules/platforms/cpp/thin-client-test/config/ssl/generate_certificates.sh
@@ -34,7 +34,7 @@ function generate_ca {
 $OSSL req \
 -newkey rsa:2048 -nodes -sha256 -keyout $CA_KEY \
 -subj "/C=US/ST=Massachusetts/L=Wakefield/CN=ignite.apache.org/O=The 
Apache Software Foundation/OU=$OU/emailAddress=d...@ignite.apache.org" \
--x509 -days=3650 -out $CA_CRT
+-x509 -days 3650 -out $CA_CRT
 }
 
 function generate_client_key_and_crt {
@@ -55,10 +55,15 @@ function generate_client_key_and_crt {
 # Signing client cerificate
 $OSSL x509 -req \
 -in $CLIENT_CSR -CA $CA_CRT -CAkey $CA_KEY -CAcreateserial \
--days=3650 -sha256 -out $CLIENT_CRT
+-days 3650 -sha256 -out $CLIENT_CRT
 
 # Cleaning up.
 rm -f $CLIENT_CSR
+
+# Protecting key with the password if required
+if [ "$4" == "1" ]; then
+  openssl rsa -aes256 -in $CLIENT_KEY -passout pass:654321 -out $CLIENT_KEY
+fi
 }
 
 function generate_jks {
@@ -89,13 +94,15 @@ function generate_jks {
 
 CA='ca'
 CLIENT='client'
+CLIENT_WITH_PASS='client_with_pass'
 SERVER='server'
 CA_UNKNOWN='ca_unknown'
 CLIENT_UNKNOWN='client_unknown'
 
 generate_ca $CA 'Apache Ignite CA'
-generate_client_key_and_crt $CA 'client' 'Apache Ignite Client Test'
-generate_client_key_and_crt $CA 'server' 'Apache Ignite Server Test'
+generate_client_key_and_crt $CA $CLIENT 'Apache Ignite Client Test'
+generate_client_key_and_crt $CA $CLIENT_WITH_PASS 'Apache Ignite Client Test' 1
+generate_client_key_and_crt $CA $SERVER 'Apache Ignite Server Test'
 
 # We won't sign up any other certs so we do not need CA key or srl
 rm -f "$CA.key" "$CA.srl"
@@ -110,10 +117,11 @@ rm -f $CA_UNKNOWN*
 
 # Re-naming everything as needed
 cat $CLIENT.key $CLIENT.crt > "$CLIENT"_full.pem
+cat $CLIENT_WITH_PASS.key $CLIENT_WITH_PASS.crt > "$CLIENT_WITH_PASS"_full.pem
 cat $CLIENT_UNKNOWN.key $CLIENT_UNKNOWN.crt > $CLIENT_UNKNOWN.pem
 mv $CA.jks trust.jks
 mv $CA.crt ca.pem
 
-rm -f $CLIENT.crt $CLIENT.key $CLIENT_UNKNOWN.key $CLIENT_UNKNOWN.crt 
$SERVER_KEY $SERVER_CRT
+rm -f $CLIENT.crt $CLIENT.key $CLIENT_WITH_PASS.key $CLIENT_WITH_PASS.crt 
$CLIENT_UNKNOWN.key $CLIENT_UNKNOWN.crt $SERVER_KEY $SERVER_CRT
 
 
diff --git a/modules/platforms/python/pyignite/connection/__init__.py 
b/modules/platforms/python/pyignite/connection/__init__.py
index 32decdf..1f6f0c0 100644
--- a/modules/platforms/python/pyignite/connection/__init__.py
+++ b/modules/platforms/python/pyignite/connection/__init__.py
@@ -77,6 +77,7 @@ class Connection:
 'ssl_ciphers',
 'ssl_cert_reqs',
 'ssl_keyfile',
+'ssl_keyfile_password',
 'ssl_certfile',
 'ssl_ca_certfile',
 'username',
@@ -118,6 +119,9 @@ class Connection:
 
 :param ssl_keyfile: (optional) a path to SSL key file to identify
  local (client) party,
+:param ssl_keyfile_password: (optional) password for SSL key file,
+ can be provided when key file is encrypted to prevent OpenSSL
+ password prompt,
 :param ssl_certfile: (optional) a path to ssl certificate file
  to identify local (client) party,
 :param ssl_ca_certfile: (optional) a path to a trusted certificate
diff --git a/modules/platforms/python/pyignite/connection/ssl.py 
b/modules/platforms/python/pyignite/connection/ssl.py
index 

[ignite] 02/02: IGNITE-13369 .NET: Clear cached node data on client disconnect

2020-08-31 Thread alexpl
This is an automated email from the ASF dual-hosted git repository.

alexpl pushed a commit to branch ignite-2.9
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 03c7e2a132208e5bcb04204fd8195b97fc79d113
Author: Pavel Tupitsyn 
AuthorDate: Wed Aug 19 22:35:43 2020 +0300

IGNITE-13369 .NET: Clear cached node data on client disconnect

Client reconnect causes local node ID to change, so cached local node info 
should be cleared on disconnect

(cherry picked from commit 3cb71994e4fc22c34337658c3b5c24cb9ac0d7a3)
---
 .../Apache.Ignite.Core.Tests/ReconnectTest.cs  | 37 ++
 .../Impl/Cluster/ClusterGroupImpl.cs   |  9 ++
 .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs   |  8 -
 3 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs
index e8aa60a..b748041 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs
@@ -18,10 +18,13 @@
 namespace Apache.Ignite.Core.Tests
 {
 using System;
+using System.Collections.Generic;
+using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
 using Apache.Ignite.Core.Cache;
 using Apache.Ignite.Core.Cache.Configuration;
+using Apache.Ignite.Core.Cluster;
 using Apache.Ignite.Core.Common;
 using Apache.Ignite.Core.Lifecycle;
 using Apache.Ignite.Core.Tests.Client.Cache;
@@ -123,6 +126,9 @@ namespace Apache.Ignite.Core.Tests
 
 using (var ignite = Ignition.Start(cfg))
 {
+var localNode = ignite.GetCluster().GetLocalNode();
+var remoteNode = ignite.GetCluster().ForRemotes().GetNode();
+
 var reconnected = 0;
 var disconnected = 0;
 ignite.ClientDisconnected += (sender, args) => { 
disconnected++; };
@@ -163,6 +169,13 @@ namespace Apache.Ignite.Core.Tests
 
 Thread.Sleep(100);  // Wait for event handler
 Assert.AreEqual(1, reconnected);
+
+var localNodeNew = ignite.GetCluster().GetLocalNode();
+Assert.AreNotSame(localNode, localNodeNew);
+Assert.AreNotEqual(localNode.Id, localNodeNew.Id);
+
+var remoteNodeNew = ignite.GetCluster().ForRemotes().GetNode();
+Assert.AreEqual(remoteNode.Id, remoteNodeNew.Id);
 }
 }
 
@@ -187,6 +200,8 @@ namespace Apache.Ignite.Core.Tests
 var client = Ignition.Start(clientCfg);
 
 Assert.AreEqual(2, client.GetCluster().GetNodes().Count);
+var localNode = client.GetCluster().GetLocalNode();
+var nodes = client.GetCluster().GetNodes();
 
 var evt = new ManualResetEventSlim(false);
 client.ClientReconnected += (sender, args) => evt.Set();
@@ -218,6 +233,9 @@ namespace Apache.Ignite.Core.Tests
 
 var serverCache = server2.GetCache(CacheName);
 Assert.AreEqual(2, serverCache[2].Id);
+
+// Verify that cached node info is updated on the client.
+CheckUpdatedNodes(client, localNode, nodes);
 }
 
 /// 
@@ -250,5 +268,24 @@ namespace Apache.Ignite.Core.Tests
 IgniteProcess.KillAll();
 Ignition.ClientMode = false;
 }
+
+/// 
+/// Checks that node info is up to date.
+/// 
+// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local
+private static void CheckUpdatedNodes(IIgnite client, IClusterNode 
localNode, ICollection nodes)
+{
+var localNodeNew = client.GetCluster().GetLocalNode();
+Assert.AreNotSame(localNode, localNodeNew);
+Assert.AreNotEqual(localNode.Id, localNodeNew.Id);
+
+var nodesNew = client.GetCluster().GetNodes();
+Assert.AreEqual(2, nodesNew.Count);
+
+foreach (var node in nodesNew)
+{
+Assert.IsFalse(nodes.Any(n => n.Id == node.Id));
+}
+}
 }
 }
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs 
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs
index a2a7a7c..09c5b94 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs
@@ -721,6 +721,15 @@ namespace Apache.Ignite.Core.Impl.Cluster
 #pragma warning restore 618
 
 /// 
+/// Clears cached node data.
+/// 
+internal void ClearCachedNodeData()
+{
+_topVer = TopVerInit;
+_nodes = null;
+}
+
+/// 
 /// Creates new Cluster Group 

[ignite] branch master updated: IGNITE-13308: CPP Thin client Transactions

2020-08-31 Thread isapego
This is an automated email from the ASF dual-hosted git repository.

isapego 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 7b443b4  IGNITE-13308: CPP Thin client Transactions
7b443b4 is described below

commit 7b443b4698628c808e9e0f2810b19b021da5b04c
Author: zstan 
AuthorDate: Mon Aug 31 17:41:35 2020 +0300

IGNITE-13308: CPP Thin client Transactions

This closes #8118
---
 .../cpp/common/include/ignite/ignite_error.h   |   6 +
 .../cpp/core/src/transactions/transactions.cpp |   1 +
 .../platforms/cpp/thin-client-test/CMakeLists.txt  |   4 +-
 .../project/vs/thin-client-test.vcxproj|   1 +
 .../platforms/cpp/thin-client-test/src/tx_test.cpp | 400 +
 modules/platforms/cpp/thin-client/CMakeLists.txt   |   2 +
 .../impl/thin/transactions/transactions_proxy.h| 145 
 .../include/ignite/thin/ignite_client.h|  12 +
 .../include/ignite/thin/transactions/transaction.h | 100 ++
 .../ignite/thin/transactions/transaction_consts.h  | 119 ++
 .../ignite/thin/transactions/transactions.h| 130 +++
 .../cpp/thin-client/project/vs/thin-client.vcxproj |   7 +
 .../cpp/thin-client/src/ignite_client.cpp  |   5 +
 .../src/impl/cache/cache_client_impl.cpp   |  86 +
 .../thin-client/src/impl/cache/cache_client_impl.h |   8 +
 .../src/impl/cache/cache_client_proxy.cpp  |   2 -
 .../thin-client/src/impl/ignite_client_impl.cpp|  13 +-
 .../cpp/thin-client/src/impl/ignite_client_impl.h  |  11 +
 .../platforms/cpp/thin-client/src/impl/message.cpp |   9 +-
 .../platforms/cpp/thin-client/src/impl/message.h   | 201 ++-
 .../src/impl/transactions/transaction_impl.h   | 183 ++
 .../src/impl/transactions/transactions_impl.cpp| 214 +++
 .../src/impl/transactions/transactions_impl.h  | 129 +++
 .../src/impl/transactions/transactions_proxy.cpp   |  82 +
 24 files changed, 1858 insertions(+), 12 deletions(-)

diff --git a/modules/platforms/cpp/common/include/ignite/ignite_error.h 
b/modules/platforms/cpp/common/include/ignite/ignite_error.h
index 0f46d5a..0c402d4 100644
--- a/modules/platforms/cpp/common/include/ignite/ignite_error.h
+++ b/modules/platforms/cpp/common/include/ignite/ignite_error.h
@@ -207,6 +207,12 @@ namespace ignite
 
 /** SSL/TLS error. */
 static const int IGNITE_ERR_SECURE_CONNECTION_FAILURE = 2026;
+
+/** Transaction already started by current thread. */
+static const int IGNITE_ERR_TX_THIS_THREAD = 2027;
+
+/** Generic transaction error. */
+static const int IGNITE_ERR_TX = 2028;
 
 
 /** Unknown error. */
diff --git a/modules/platforms/cpp/core/src/transactions/transactions.cpp 
b/modules/platforms/cpp/core/src/transactions/transactions.cpp
index 4c1ea70..54a9fa2 100644
--- a/modules/platforms/cpp/core/src/transactions/transactions.cpp
+++ b/modules/platforms/cpp/core/src/transactions/transactions.cpp
@@ -16,6 +16,7 @@
  */
 
 #include "ignite/transactions/transactions.h"
+#include "ignite/transactions/transaction.h"
 
 using namespace ignite::common::concurrent;
 using namespace ignite::impl::transactions;
diff --git a/modules/platforms/cpp/thin-client-test/CMakeLists.txt 
b/modules/platforms/cpp/thin-client-test/CMakeLists.txt
index d0ebe58..535cb1a 100644
--- a/modules/platforms/cpp/thin-client-test/CMakeLists.txt
+++ b/modules/platforms/cpp/thin-client-test/CMakeLists.txt
@@ -33,7 +33,9 @@ set(SOURCES src/teamcity/teamcity_boost.cpp
 src/test_utils.cpp
 src/ignite_client_test.cpp
 src/auth_test.cpp
-src/ssl_test.cpp)
+src/tx_test.cpp
+src/ssl_test.cpp
+)
 
 add_executable(${TARGET} ${SOURCES})
 
diff --git 
a/modules/platforms/cpp/thin-client-test/project/vs/thin-client-test.vcxproj 
b/modules/platforms/cpp/thin-client-test/project/vs/thin-client-test.vcxproj
index ad13f6f..118c490 100644
--- a/modules/platforms/cpp/thin-client-test/project/vs/thin-client-test.vcxproj
+++ b/modules/platforms/cpp/thin-client-test/project/vs/thin-client-test.vcxproj
@@ -26,6 +26,7 @@
 
 
 
+
   
   
 
diff --git a/modules/platforms/cpp/thin-client-test/src/tx_test.cpp 
b/modules/platforms/cpp/thin-client-test/src/tx_test.cpp
new file mode 100644
index 000..19757a2
--- /dev/null
+++ b/modules/platforms/cpp/thin-client-test/src/tx_test.cpp
@@ -0,0 +1,400 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  

[ignite] branch ignite-ducktape updated: Ducktape parallel (#8192)

2020-08-31 Thread av
This is an automated email from the ASF dual-hosted git repository.

av pushed a commit to branch ignite-ducktape
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-ducktape by this push:
 new bb5453f  Ducktape parallel (#8192)
bb5453f is described below

commit bb5453ffcc2098ff389a1054e0926f4616670987
Author: Ivan Daschinskiy 
AuthorDate: Mon Aug 31 17:25:11 2020 +0300

Ducktape parallel (#8192)
---
 modules/ducktests/tests/docker/run_tests.sh|  18 +-
 .../ducktests/tests/ignitetest/services/ignite.py  |   9 +-
 .../tests/ignitetest/services/ignite_app.py|  17 +-
 .../utils/{ignite_config.py => config_template.py} |  10 +-
 .../ignitetest/services/utils/ignite_aware.py  |  31 ++-
 .../utils/ignite_configuration/__init__.py |  46 
 .../services/utils/ignite_configuration/cache.py   |  29 +++
 .../utils/ignite_configuration/data_storage.py |  38 
 .../utils/ignite_configuration/discovery.py| 141 
 .../services/utils/ignite_persistence.py   |   4 +-
 .../tests/ignitetest/services/utils/ignite_spec.py |  59 +++--
 .../services/utils/templates/cache_macro.j2|  34 +++
 .../services/utils/templates/datastorage_macro.j2  |  46 
 .../services/utils/templates/discovery_macro.j2|  57 +
 .../utils/{config => templates}/ignite.xml.j2  |  29 ++-
 .../utils/{config => templates}/log4j.xml.j2   |   0
 .../services/utils/templates/misc_macro.j2 |  24 ++
 .../ignitetest/tests/add_node_rebalance_test.py|  18 +-
 .../ignitetest/tests/cellular_affinity_test.py |  35 ++-
 .../tests/ignitetest/tests/control_utility_test.py |  85 +++
 .../tests/ignitetest/tests/discovery_test.py   | 251 ++---
 .../tests/ignitetest/tests/pme_free_switch_test.py |  52 ++---
 .../ducktests/tests/ignitetest/tests/smoke_test.py |  31 ++-
 .../tests/suites/fast_suite.yml}   |  28 +--
 .../tests/ignitetest/tests/suites/slow_suite.yml   |  17 ++
 modules/ducktests/tests/setup.py   |   5 +-
 26 files changed, 753 insertions(+), 361 deletions(-)

diff --git a/modules/ducktests/tests/docker/run_tests.sh 
b/modules/ducktests/tests/docker/run_tests.sh
index e5dc561..b9ee488 100755
--- a/modules/ducktests/tests/docker/run_tests.sh
+++ b/modules/ducktests/tests/docker/run_tests.sh
@@ -52,13 +52,22 @@ Usage: ${0} [options]
 
 The options are as follows:
 -h|--help
-Display this help message
+Display this help message.
+
+-n|--num-nodes
+Specify how many nodes to start. Default number of nodes to start: 11.
+
+-j|--max-parallel
+Specify max number of tests that can be run in parallel.
 
 -p|--param
 Use specified param to inject in tests. Could be used multiple times.
 
 ./run_tests.sh --param version=2.8.1
 
+-pj|--params-json
+Use specified json as parameters to inject in tests. Can be extended with 
-p|--param.
+
 -g|--global
 Use specified global param to pass to test context. Could be used multiple 
times.
 
@@ -108,8 +117,11 @@ while [[ $# -ge 1 ]]; do
 case "$1" in
 -h|--help) usage;;
 -p|--param) duck_add_param "$2"; shift 2;;
+-pj|--params-json) PARAMETERS="$2"; shift 2;;
 -g|--global) duck_add_global "$2"; shift 2;;
 -t|--tc-paths) TC_PATHS="$2"; shift 2;;
+-n|--num-nodes) IGNITE_NUM_CONTAINERS="$2"; shift 2;;
+-j|--max-parallel) MAX_PARALLEL="$2"; shift 2;;
 -f|--force) FORCE=$1; shift;;
 *) break;;
 esac
@@ -139,5 +151,9 @@ if [[ "$PARAMETERS" != "{}" ]]; then
 DUCKTAPE_OPTIONS="$DUCKTAPE_OPTIONS --parameters '$PARAMETERS'"
 fi
 
+if [[ -n "$MAX_PARALLEL" ]]; then
+  DUCKTAPE_OPTIONS="$DUCKTAPE_OPTIONS --max-parallel $MAX_PARALLEL"
+fi
+
 "$SCRIPT_DIR"/ducker-ignite test "$TC_PATHS" "$DUCKTAPE_OPTIONS" \
   || die "ducker-ignite test failed"
diff --git a/modules/ducktests/tests/ignitetest/services/ignite.py 
b/modules/ducktests/tests/ignitetest/services/ignite.py
index 2fb64b3..f50365d 100644
--- a/modules/ducktests/tests/ignitetest/services/ignite.py
+++ b/modules/ducktests/tests/ignitetest/services/ignite.py
@@ -31,7 +31,6 @@ from ducktape.utils.util import wait_until
 
 from ignitetest.services.utils.concurrent import CountDownLatch, AtomicValue
 from ignitetest.services.utils.ignite_aware import IgniteAwareService
-from ignitetest.utils.version import DEV_BRANCH
 
 
 class IgniteService(IgniteAwareService):
@@ -42,10 +41,8 @@ class IgniteService(IgniteAwareService):
 HEAP_DUMP_FILE = os.path.join(IgniteAwareService.PERSISTENT_ROOT, 
"ignite-heap.bin")
 
 # pylint: disable=R0913
-def __init__(self, context, num_nodes, jvm_opts=None, properties="", 
client_mode=False, modules=None,
- version=DEV_BRANCH):
-super().__init__(context, num_nodes, properties, 
client_mode=client_mode, modules=modules, version=version,
- jvm_opts=jvm_opts)
+  

[ignite] branch master updated: IGNITE-12718 pyignite: added SSL keyfile password argument. (#7480)

2020-08-31 Thread nizhikov
This is an automated email from the ASF dual-hosted git repository.

nizhikov 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 baf8c67  IGNITE-12718 pyignite: added SSL keyfile password argument. 
(#7480)
baf8c67 is described below

commit baf8c673c41a1790ef0a244862e6abfbd4eadbf5
Author: Andrey Kuznetsov 
AuthorDate: Mon Aug 31 15:16:25 2020 +0300

IGNITE-12718 pyignite: added SSL keyfile password argument. (#7480)

Co-authored-by: Nikolay Izhikov 
---
 .../config/ssl/generate_certificates.sh|  18 +--
 .../python/pyignite/connection/__init__.py |   4 ++
 .../platforms/python/pyignite/connection/ssl.py|  40 --
 modules/platforms/python/tests/config/ssl.xml  |  58 +
 .../platforms/python/tests/config/ssl/README.txt   |   3 ++
 .../python/tests/config/ssl/client_full.pem|  52 ++
 .../tests/config/ssl/client_with_pass_full.pem |  54 +++
 .../platforms/python/tests/config/ssl/server.jks   | Bin 0 -> 2380 bytes
 .../platforms/python/tests/config/ssl/trust.jks| Bin 0 -> 1346 bytes
 modules/platforms/python/tests/conftest.py |  11 +++-
 modules/platforms/python/tests/test_handshake.py   |   3 +-
 11 files changed, 221 insertions(+), 22 deletions(-)

diff --git 
a/modules/platforms/cpp/thin-client-test/config/ssl/generate_certificates.sh 
b/modules/platforms/cpp/thin-client-test/config/ssl/generate_certificates.sh
index 5e8303a..e4f41e2 100755
--- a/modules/platforms/cpp/thin-client-test/config/ssl/generate_certificates.sh
+++ b/modules/platforms/cpp/thin-client-test/config/ssl/generate_certificates.sh
@@ -34,7 +34,7 @@ function generate_ca {
 $OSSL req \
 -newkey rsa:2048 -nodes -sha256 -keyout $CA_KEY \
 -subj "/C=US/ST=Massachusetts/L=Wakefield/CN=ignite.apache.org/O=The 
Apache Software Foundation/OU=$OU/emailAddress=d...@ignite.apache.org" \
--x509 -days=3650 -out $CA_CRT
+-x509 -days 3650 -out $CA_CRT
 }
 
 function generate_client_key_and_crt {
@@ -55,10 +55,15 @@ function generate_client_key_and_crt {
 # Signing client cerificate
 $OSSL x509 -req \
 -in $CLIENT_CSR -CA $CA_CRT -CAkey $CA_KEY -CAcreateserial \
--days=3650 -sha256 -out $CLIENT_CRT
+-days 3650 -sha256 -out $CLIENT_CRT
 
 # Cleaning up.
 rm -f $CLIENT_CSR
+
+# Protecting key with the password if required
+if [ "$4" == "1" ]; then
+  openssl rsa -aes256 -in $CLIENT_KEY -passout pass:654321 -out $CLIENT_KEY
+fi
 }
 
 function generate_jks {
@@ -89,13 +94,15 @@ function generate_jks {
 
 CA='ca'
 CLIENT='client'
+CLIENT_WITH_PASS='client_with_pass'
 SERVER='server'
 CA_UNKNOWN='ca_unknown'
 CLIENT_UNKNOWN='client_unknown'
 
 generate_ca $CA 'Apache Ignite CA'
-generate_client_key_and_crt $CA 'client' 'Apache Ignite Client Test'
-generate_client_key_and_crt $CA 'server' 'Apache Ignite Server Test'
+generate_client_key_and_crt $CA $CLIENT 'Apache Ignite Client Test'
+generate_client_key_and_crt $CA $CLIENT_WITH_PASS 'Apache Ignite Client Test' 1
+generate_client_key_and_crt $CA $SERVER 'Apache Ignite Server Test'
 
 # We won't sign up any other certs so we do not need CA key or srl
 rm -f "$CA.key" "$CA.srl"
@@ -110,10 +117,11 @@ rm -f $CA_UNKNOWN*
 
 # Re-naming everything as needed
 cat $CLIENT.key $CLIENT.crt > "$CLIENT"_full.pem
+cat $CLIENT_WITH_PASS.key $CLIENT_WITH_PASS.crt > "$CLIENT_WITH_PASS"_full.pem
 cat $CLIENT_UNKNOWN.key $CLIENT_UNKNOWN.crt > $CLIENT_UNKNOWN.pem
 mv $CA.jks trust.jks
 mv $CA.crt ca.pem
 
-rm -f $CLIENT.crt $CLIENT.key $CLIENT_UNKNOWN.key $CLIENT_UNKNOWN.crt 
$SERVER_KEY $SERVER_CRT
+rm -f $CLIENT.crt $CLIENT.key $CLIENT_WITH_PASS.key $CLIENT_WITH_PASS.crt 
$CLIENT_UNKNOWN.key $CLIENT_UNKNOWN.crt $SERVER_KEY $SERVER_CRT
 
 
diff --git a/modules/platforms/python/pyignite/connection/__init__.py 
b/modules/platforms/python/pyignite/connection/__init__.py
index 32decdf..1f6f0c0 100644
--- a/modules/platforms/python/pyignite/connection/__init__.py
+++ b/modules/platforms/python/pyignite/connection/__init__.py
@@ -77,6 +77,7 @@ class Connection:
 'ssl_ciphers',
 'ssl_cert_reqs',
 'ssl_keyfile',
+'ssl_keyfile_password',
 'ssl_certfile',
 'ssl_ca_certfile',
 'username',
@@ -118,6 +119,9 @@ class Connection:
 
 :param ssl_keyfile: (optional) a path to SSL key file to identify
  local (client) party,
+:param ssl_keyfile_password: (optional) password for SSL key file,
+ can be provided when key file is encrypted to prevent OpenSSL
+ password prompt,
 :param ssl_certfile: (optional) a path to ssl certificate file
  to identify local (client) party,
 :param ssl_ca_certfile: (optional) a path to a trusted certificate
diff --git