From aaa3483147c53b969759bb9307b2f1a19f7f8a57 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 16:48:38 +0300 Subject: [PATCH 001/110] IGNITE-28819 Scaffold ignite-thin-client-impl module Create empty modules/thin-client/impl (ignite-thin-client-impl) for the thin client implementation extraction. It depends only on ignite-commons, ignite-binary-api and ignite-thin-client-api (no ignite-core dependency). Wire it into the reactor (root pom.xml), the BOM dependency management, and ignite-core (compile dependency + maven-shade include) so the module's classes are bundled back into ignite-core.jar for binary compatibility, mirroring ignite-thin-client-api. Exclude ignite-thin-client-impl from the assembly dependency sets (dependencies-apache-ignite{,-lgpl,-slim}.xml) as done for ignite-thin-client-api, since the classes ship inside ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- assembly/dependencies-apache-ignite-lgpl.xml | 1 + assembly/dependencies-apache-ignite-slim.xml | 1 + assembly/dependencies-apache-ignite.xml | 1 + modules/bom/pom.xml | 5 ++ modules/core/pom.xml | 7 ++ modules/thin-client/impl/README.txt | 9 +++ modules/thin-client/impl/pom.xml | 75 ++++++++++++++++++++ pom.xml | 1 + 8 files changed, 100 insertions(+) create mode 100644 modules/thin-client/impl/README.txt create mode 100644 modules/thin-client/impl/pom.xml diff --git a/assembly/dependencies-apache-ignite-lgpl.xml b/assembly/dependencies-apache-ignite-lgpl.xml index ac3d35c972a66..6a12956482793 100644 --- a/assembly/dependencies-apache-ignite-lgpl.xml +++ b/assembly/dependencies-apache-ignite-lgpl.xml @@ -119,6 +119,7 @@ ${project.groupId}:ignite-binary-api ${project.groupId}:ignite-binary-impl ${project.groupId}:ignite-thin-client-api + ${project.groupId}:ignite-thin-client-impl ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/assembly/dependencies-apache-ignite-slim.xml b/assembly/dependencies-apache-ignite-slim.xml index f113444139b1a..537d5c55beae4 100644 --- a/assembly/dependencies-apache-ignite-slim.xml +++ b/assembly/dependencies-apache-ignite-slim.xml @@ -119,6 +119,7 @@ ${project.groupId}:ignite-binary-api ${project.groupId}:ignite-binary-impl ${project.groupId}:ignite-thin-client-api + ${project.groupId}:ignite-thin-client-impl ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/assembly/dependencies-apache-ignite.xml b/assembly/dependencies-apache-ignite.xml index 5952320cba9b2..208fbe8eda207 100644 --- a/assembly/dependencies-apache-ignite.xml +++ b/assembly/dependencies-apache-ignite.xml @@ -120,6 +120,7 @@ ${project.groupId}:ignite-binary-api ${project.groupId}:ignite-binary-impl ${project.groupId}:ignite-thin-client-api + ${project.groupId}:ignite-thin-client-impl ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/modules/bom/pom.xml b/modules/bom/pom.xml index e14c89f779b55..865b97ca23582 100644 --- a/modules/bom/pom.xml +++ b/modules/bom/pom.xml @@ -186,6 +186,11 @@ ignite-thin-client-api ${revision} + + ${project.groupId} + ignite-thin-client-impl + ${revision} + ${project.groupId} ignite-codegen diff --git a/modules/core/pom.xml b/modules/core/pom.xml index aebc94795a5f5..b4202baf9728f 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -81,6 +81,12 @@ compile + + ${project.groupId} + ignite-thin-client-impl + compile + + ${project.groupId} ignite-codegen @@ -360,6 +366,7 @@ ${project.groupId}:ignite-binary-impl ${project.groupId}:ignite-grid-unsafe ${project.groupId}:ignite-thin-client-api + ${project.groupId}:ignite-thin-client-impl diff --git a/modules/thin-client/impl/README.txt b/modules/thin-client/impl/README.txt new file mode 100644 index 0000000000000..e0d6f4297d37e --- /dev/null +++ b/modules/thin-client/impl/README.txt @@ -0,0 +1,9 @@ +Apache Ignite Thin Client Implementation Module +------------------------ + +ignite-thin-client-impl module is internal module to separate thin-client API and implementation. +It contains the implementation of the thin client API declared in ignite-thin-client-api +(TcpIgniteClient and supporting classes). + +Note, class files of this module are copied in ignite-core.jar during project assembly +to ensure compatibility with previous Ignite releases. diff --git a/modules/thin-client/impl/pom.xml b/modules/thin-client/impl/pom.xml new file mode 100644 index 0000000000000..49bf4aeca4e5d --- /dev/null +++ b/modules/thin-client/impl/pom.xml @@ -0,0 +1,75 @@ + + + + + + + 4.0.0 + + + org.apache.ignite + ignite-parent-internal + ${revision} + ../../../parent-internal/pom.xml + + + ignite-thin-client-impl + + http://ignite.apache.org + + + + ${project.groupId} + ignite-commons + provided + + + + ${project.groupId} + ignite-binary-api + provided + + + + ${project.groupId} + ignite-thin-client-api + provided + + + + org.jetbrains + annotations + ${jetbrains.annotations.version} + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + ${maven.deploy.plugin.version} + + false + + + + + diff --git a/pom.xml b/pom.xml index 5b4ef9e6f5516..beaba513ff029 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,7 @@ modules/binary/api modules/binary/impl modules/thin-client/api + modules/thin-client/impl modules/unsafe modules/core modules/compress From 8a3c9d2f7ae260c6363a38bb470addbdcb388fa1 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 16:52:36 +0300 Subject: [PATCH 002/110] IGNITE-28819 Move ProtocolVersion to ignite-thin-client-impl Pure relocation (no code change) of the first leaf class of the thin client implementation. ProtocolVersion has no dependencies on ignite-core internals and is referenced only from within the thin client package, so it moves cleanly. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ProtocolVersion.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersion.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersion.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersion.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersion.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersion.java From 77e510b0b6b9db7dae64b11e05bec8f433ef243c Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 16:56:25 +0300 Subject: [PATCH 003/110] IGNITE-28819 Move BinaryNameMapperMode to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. BinaryNameMapperMode has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../apache/ignite/internal/client/thin/BinaryNameMapperMode.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/BinaryNameMapperMode.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/BinaryNameMapperMode.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/BinaryNameMapperMode.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/BinaryNameMapperMode.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/BinaryNameMapperMode.java From bae4a37e4510be3ab791581873b12595ca0b7356 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 16:57:19 +0300 Subject: [PATCH 004/110] IGNITE-28819 Move ClientCacheEntry to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientCacheEntry has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ClientCacheEntry.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntry.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntry.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntry.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntry.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntry.java From 4302ef48e2ea6221d5c8a7d29e8c456d2cffd383 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 16:58:12 +0300 Subject: [PATCH 005/110] IGNITE-28819 Move ClientConnection to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientConnection has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../apache/ignite/internal/client/thin/io/ClientConnection.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnection.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnection.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnection.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnection.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnection.java From dd8877d125d457008a7cc295be756f000beec0d6 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 16:59:04 +0300 Subject: [PATCH 006/110] IGNITE-28819 Move ClientConnectionStateHandler to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientConnectionStateHandler has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/client/thin/io/ClientConnectionStateHandler.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionStateHandler.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionStateHandler.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionStateHandler.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionStateHandler.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionStateHandler.java From 7822aab132061edfb097c2b3470eabf99b290974 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 16:59:56 +0300 Subject: [PATCH 007/110] IGNITE-28819 Move ClientJCacheAdapter to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientJCacheAdapter has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../apache/ignite/internal/client/thin/ClientJCacheAdapter.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheAdapter.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheAdapter.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheAdapter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheAdapter.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheAdapter.java From 5baf3d4116e70e10826929e46855de121d3c8938 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:00:50 +0300 Subject: [PATCH 008/110] IGNITE-28819 Move ClientJCacheEntryListenerAdapter to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientJCacheEntryListenerAdapter has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/client/thin/ClientJCacheEntryListenerAdapter.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheEntryListenerAdapter.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheEntryListenerAdapter.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheEntryListenerAdapter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheEntryListenerAdapter.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientJCacheEntryListenerAdapter.java From 09fc180c1eb61ec0563052581b675c7012b50f78 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:01:43 +0300 Subject: [PATCH 009/110] IGNITE-28819 Move ClientMessageDecoder to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientMessageDecoder has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/io/ClientMessageDecoder.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageDecoder.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageDecoder.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageDecoder.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageDecoder.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageDecoder.java From a5ad757a60000cf37a3ef34e0aeac8614a03d3cd Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:02:36 +0300 Subject: [PATCH 010/110] IGNITE-28819 Move ClientMessageHandler to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientMessageHandler has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/io/ClientMessageHandler.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageHandler.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageHandler.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageHandler.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageHandler.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientMessageHandler.java From 528282d9762647712d114fd1e47d0b6cde5f95e4 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:03:28 +0300 Subject: [PATCH 011/110] IGNITE-28819 Move ClientNotificationType to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientNotificationType has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientNotificationType.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientNotificationType.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientNotificationType.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientNotificationType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientNotificationType.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientNotificationType.java From 58a2476983201d2a98b3e8ba050e142e9d089d4f Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:04:18 +0300 Subject: [PATCH 012/110] IGNITE-28819 Move ClientProtocolError to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientProtocolError has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../apache/ignite/internal/client/thin/ClientProtocolError.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientProtocolError.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientProtocolError.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientProtocolError.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientProtocolError.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientProtocolError.java From 9c1e1d9fe894a948b14b0085c02a974158949baa Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:05:08 +0300 Subject: [PATCH 013/110] IGNITE-28819 Move ClientRetryPolicyContextImpl to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientRetryPolicyContextImpl has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientRetryPolicyContextImpl.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientRetryPolicyContextImpl.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientRetryPolicyContextImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientRetryPolicyContextImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientRetryPolicyContextImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientRetryPolicyContextImpl.java From 55a5be74ea1edc278803b521e5a1b63df05c9aa4 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:06:01 +0300 Subject: [PATCH 014/110] IGNITE-28819 Move IgniteClientFutureImpl to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. IgniteClientFutureImpl has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/IgniteClientFutureImpl.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/IgniteClientFutureImpl.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/IgniteClientFutureImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/IgniteClientFutureImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/IgniteClientFutureImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/IgniteClientFutureImpl.java From a1a6890d4fce33aceedacfe2ad3349c8312ed1ca Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:06:52 +0300 Subject: [PATCH 015/110] IGNITE-28819 Move NotificationListener to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. NotificationListener has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../apache/ignite/internal/client/thin/NotificationListener.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/NotificationListener.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/NotificationListener.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/NotificationListener.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/NotificationListener.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/NotificationListener.java From e7579260f489339678d682549e906afe500239ee Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:07:46 +0300 Subject: [PATCH 016/110] IGNITE-28819 Move ProtocolVersionFeature to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ProtocolVersionFeature has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ProtocolVersionFeature.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersionFeature.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersionFeature.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersionFeature.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersionFeature.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ProtocolVersionFeature.java From 988771f625615a60308d4b2fa9852908ada29eca Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:08:41 +0300 Subject: [PATCH 017/110] IGNITE-28819 Move QueryPager to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. QueryPager has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../java/org/apache/ignite/internal/client/thin/QueryPager.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/QueryPager.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/QueryPager.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/QueryPager.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/QueryPager.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/QueryPager.java From 5addab3310de5674706db4ca10251128aa3b7c79 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:09:35 +0300 Subject: [PATCH 018/110] IGNITE-28819 Move ClientConnectionMultiplexer to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientConnectionMultiplexer has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/client/thin/io/ClientConnectionMultiplexer.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionMultiplexer.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionMultiplexer.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionMultiplexer.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionMultiplexer.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/ClientConnectionMultiplexer.java From 7ca591e0e243e68e447c2f952550ed70b322bd7a Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:10:26 +0300 Subject: [PATCH 019/110] IGNITE-28819 Move ClientInternalBinaryConfiguration to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientInternalBinaryConfiguration has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/client/thin/ClientInternalBinaryConfiguration.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientInternalBinaryConfiguration.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientInternalBinaryConfiguration.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientInternalBinaryConfiguration.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientInternalBinaryConfiguration.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientInternalBinaryConfiguration.java From c42651e13e91fbc80e221e7863ff74f6243695b9 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:11:18 +0300 Subject: [PATCH 020/110] IGNITE-28819 Move ClientOperation to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientOperation has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ClientOperation.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientOperation.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientOperation.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientOperation.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientOperation.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientOperation.java From 42004c856a4cc69e991121643206e5c7157772b1 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:12:11 +0300 Subject: [PATCH 021/110] IGNITE-28819 Move ClientQueryCursor to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientQueryCursor has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ClientQueryCursor.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryCursor.java From 83ce436eca5c01bd201c43d3241a07ea801054b0 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:13:04 +0300 Subject: [PATCH 022/110] IGNITE-28819 Move FieldsQueryPager to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. FieldsQueryPager has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/FieldsQueryPager.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/FieldsQueryPager.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/FieldsQueryPager.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/FieldsQueryPager.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/FieldsQueryPager.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/FieldsQueryPager.java From ad762654a0e1264d53922cd3bf6cc46e917970bf Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:13:57 +0300 Subject: [PATCH 023/110] IGNITE-28819 Move ProtocolContext to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ProtocolContext has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ProtocolContext.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ProtocolContext.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolContext.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ProtocolContext.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolContext.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ProtocolContext.java From ca73b2e26862817499a1ff779bf3f360f2ccd601 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:14:48 +0300 Subject: [PATCH 024/110] IGNITE-28819 Move ClientFieldsQueryCursor to ignite-thin-client-impl Pure relocation (no code change) of a leaf class of the thin client implementation. ClientFieldsQueryCursor has no ignite-core internal dependencies and is referenced only from within the thin client package. Its class still ships in ignite-core.jar via the shade of ignite-thin-client-impl. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientFieldsQueryCursor.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryCursor.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryCursor.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryCursor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryCursor.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryCursor.java From 0333a7a3e0ec4f51df21f855b8ddee2dcbfd8d82 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 17:22:58 +0300 Subject: [PATCH 025/110] IGNITE-28819 Move ClientServiceDescriptorImpl to ignite-thin-client-impl ClientServiceDescriptorImpl's only ignite-core dependency was the import of org.apache.ignite.services.Service, used solely in a javadoc {@link}. Per the move convention, the javadoc-only import is removed (the {@link Service} text remains; doclint is disabled so it does not fail the build), leaving the class free of ignite-core internals. Relocated to ignite-thin-client-impl; its class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientServiceDescriptorImpl.java | 1 - 1 file changed, 1 deletion(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientServiceDescriptorImpl.java (98%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServiceDescriptorImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientServiceDescriptorImpl.java similarity index 98% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServiceDescriptorImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientServiceDescriptorImpl.java index 51a1eea708b93..580c7963676d7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServiceDescriptorImpl.java +++ b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientServiceDescriptorImpl.java @@ -20,7 +20,6 @@ import java.util.UUID; import org.apache.ignite.client.ClientServiceDescriptor; import org.apache.ignite.platform.PlatformType; -import org.apache.ignite.services.Service; import org.jetbrains.annotations.Nullable; /** From 218ffc5ac77720f91cd8314d8cfe7d7381b6aa85 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 23:02:24 +0300 Subject: [PATCH 026/110] IGNITE-28819 Move ClusterNodeFunc to ignite-commons Relocate the ClusterNodeFunc utility class from ignite-core to ignite-commons so it is available to modules that must not depend on ignite-core (the thin client implementation being extracted uses ClusterNodeFunc.eqNodes). The class keeps its package org.apache.ignite.internal.util.lang, so all existing ignite-core call sites are unaffected. ClusterNodeFunc references four node-id predicates that lived in ignite-core (ContainsNodeIdsPredicate, EqualsClusterNodeIdPredicate, HasEqualIdPredicate, HasNotEqualIdPredicate); they depend only on ignite-commons classes (ClusterNode, S, IgnitePredicate) and are moved alongside it (keeping their gridfunc package). EqualsUuidPredicate already lives in ignite-commons. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/util/lang/ClusterNodeFunc.java | 0 .../internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java | 0 .../internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java | 0 .../ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java | 0 .../internal/util/lang/gridfunc/HasNotEqualIdPredicate.java | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/lang/ClusterNodeFunc.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/ClusterNodeFunc.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/lang/ClusterNodeFunc.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/lang/ClusterNodeFunc.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/lang/ClusterNodeFunc.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ContainsNodeIdsPredicate.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/EqualsClusterNodeIdPredicate.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasEqualIdPredicate.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/HasNotEqualIdPredicate.java From 2853b05d679b9c1165f4dd4bd52de63995134279 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 23:03:50 +0300 Subject: [PATCH 027/110] IGNITE-28819 Move ClientClusterNodeImpl to ignite-thin-client-impl ClientClusterNodeImpl's only ignite-core dependency was the static import of ClusterNodeFunc.eqNodes, now resident in ignite-commons. All its other dependencies (ClusterNode, ClusterMetrics, S, IgniteProductVersion) already live in ignite-commons, so this is a pure relocation with no code change. The class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../apache/ignite/internal/client/thin/ClientClusterNodeImpl.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterNodeImpl.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterNodeImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterNodeImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterNodeImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterNodeImpl.java From 473befde1e4f646d19e9e44d3ae1c5be7914a56a Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 23:19:52 +0300 Subject: [PATCH 028/110] IGNITE-28819 Move org.apache.ignite.ssl package to ignite-commons Relocate the SSL context factory classes (SslContextFactory, AbstractSslContextFactory, DelegatingSSLContextSpi, SSLContextWrapper, SSLServerSocketFactoryWrapper, SSLSocketFactoryWrapper and package-info) from ignite-core to ignite-commons so they are available to modules that must not depend on ignite-core. The thin client implementation being extracted uses SslContextFactory.DFLT_STORE_TYPE / DFLT_KEY_ALGORITHM. The package org.apache.ignite.ssl is preserved, so all existing call sites (configuration classes, discovery/communication SPIs, etc.) are unaffected. The package's only external dependencies are IgniteException and the A argument-check helper, both already in ignite-commons. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../java/org/apache/ignite/ssl/AbstractSslContextFactory.java | 0 .../main/java/org/apache/ignite/ssl/DelegatingSSLContextSpi.java | 0 .../src/main/java/org/apache/ignite/ssl/SSLContextWrapper.java | 0 .../java/org/apache/ignite/ssl/SSLServerSocketFactoryWrapper.java | 0 .../main/java/org/apache/ignite/ssl/SSLSocketFactoryWrapper.java | 0 .../src/main/java/org/apache/ignite/ssl/SslContextFactory.java | 0 .../src/main/java/org/apache/ignite/ssl/package-info.java | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/ssl/AbstractSslContextFactory.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/ssl/DelegatingSSLContextSpi.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/ssl/SSLContextWrapper.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/ssl/SSLServerSocketFactoryWrapper.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/ssl/SSLSocketFactoryWrapper.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/ssl/SslContextFactory.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/ssl/package-info.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/ssl/AbstractSslContextFactory.java b/modules/commons/src/main/java/org/apache/ignite/ssl/AbstractSslContextFactory.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/ssl/AbstractSslContextFactory.java rename to modules/commons/src/main/java/org/apache/ignite/ssl/AbstractSslContextFactory.java diff --git a/modules/core/src/main/java/org/apache/ignite/ssl/DelegatingSSLContextSpi.java b/modules/commons/src/main/java/org/apache/ignite/ssl/DelegatingSSLContextSpi.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/ssl/DelegatingSSLContextSpi.java rename to modules/commons/src/main/java/org/apache/ignite/ssl/DelegatingSSLContextSpi.java diff --git a/modules/core/src/main/java/org/apache/ignite/ssl/SSLContextWrapper.java b/modules/commons/src/main/java/org/apache/ignite/ssl/SSLContextWrapper.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/ssl/SSLContextWrapper.java rename to modules/commons/src/main/java/org/apache/ignite/ssl/SSLContextWrapper.java diff --git a/modules/core/src/main/java/org/apache/ignite/ssl/SSLServerSocketFactoryWrapper.java b/modules/commons/src/main/java/org/apache/ignite/ssl/SSLServerSocketFactoryWrapper.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/ssl/SSLServerSocketFactoryWrapper.java rename to modules/commons/src/main/java/org/apache/ignite/ssl/SSLServerSocketFactoryWrapper.java diff --git a/modules/core/src/main/java/org/apache/ignite/ssl/SSLSocketFactoryWrapper.java b/modules/commons/src/main/java/org/apache/ignite/ssl/SSLSocketFactoryWrapper.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/ssl/SSLSocketFactoryWrapper.java rename to modules/commons/src/main/java/org/apache/ignite/ssl/SSLSocketFactoryWrapper.java diff --git a/modules/core/src/main/java/org/apache/ignite/ssl/SslContextFactory.java b/modules/commons/src/main/java/org/apache/ignite/ssl/SslContextFactory.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/ssl/SslContextFactory.java rename to modules/commons/src/main/java/org/apache/ignite/ssl/SslContextFactory.java diff --git a/modules/core/src/main/java/org/apache/ignite/ssl/package-info.java b/modules/commons/src/main/java/org/apache/ignite/ssl/package-info.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/ssl/package-info.java rename to modules/commons/src/main/java/org/apache/ignite/ssl/package-info.java From a7b57cc3fa952e0546a5fdd0999e935c462c4c3b Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 23:21:14 +0300 Subject: [PATCH 029/110] IGNITE-28819 Move ClientSslUtils to ignite-thin-client-impl ClientSslUtils's only ignite-core dependencies were the static imports of SslContextFactory.DFLT_STORE_TYPE / DFLT_KEY_ALGORITHM, now resident in ignite-commons. Its other dependencies (SslMode, SslProtocol, ClientConfiguration) already live in ignite-thin-client-api, so this is a pure relocation with no code change. The class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ClientSslUtils.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientSslUtils.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientSslUtils.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientSslUtils.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientSslUtils.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientSslUtils.java From e5ba9db6ee7c0b166c9499000d72cdd6bc3bab5e Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 23:29:25 +0300 Subject: [PATCH 030/110] IGNITE-28819 Move AffinityTopologyVersion to ignite-commons Relocate AffinityTopologyVersion from ignite-core to ignite-commons so it is available to modules that must not depend on ignite-core. The thin client channel abstraction (ClientChannel#serverTopologyVersion) returns it. The class is a self-contained value type whose only external dependency (the S to-string helper) already lives in ignite-commons; its package org.apache.ignite.internal.processors.affinity is preserved so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/processors/affinity/AffinityTopologyVersion.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java From fddee498fd8de09f0198fd818e6a094f475de3f2 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 23:30:39 +0300 Subject: [PATCH 031/110] IGNITE-28819 Move ClientChannel and Payload channels to ignite-thin-client-impl ClientChannel, PayloadInputChannel and PayloadOutputChannel form a mutual reference cycle (ClientChannel methods take Payload*Channel; the Payload channels hold a ClientChannel), so they move together as one unit. Their only ignite-core dependency was AffinityTopologyVersion (ClientChannel#serverTopologyVersion), relocated to ignite-commons in the preceding commit; the Payload channels depend only on binary stream types in ignite-binary-api. Pure relocation with no code change; the classes still ship in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ClientChannel.java | 0 .../apache/ignite/internal/client/thin/PayloadInputChannel.java | 0 .../apache/ignite/internal/client/thin/PayloadOutputChannel.java | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientChannel.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/PayloadInputChannel.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/PayloadOutputChannel.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientChannel.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientChannel.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientChannel.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientChannel.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/PayloadInputChannel.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/PayloadInputChannel.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/PayloadInputChannel.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/PayloadInputChannel.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/PayloadOutputChannel.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/PayloadOutputChannel.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/PayloadOutputChannel.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/PayloadOutputChannel.java From e2a7d9ec309ff3b1368728f70aa0ea5d75056bdc Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 23:34:56 +0300 Subject: [PATCH 032/110] IGNITE-28819 Move ReliableChannelEx to ignite-thin-client-impl ReliableChannelEx's dependencies are now all satisfied outside ignite-core: its imports are thin client API types (ClientException, IgniteClientFuture, etc.) and it references only thin classes already moved to ignite-thin-client-impl (ClientOperation, ClientProtocolError, PayloadInputChannel, PayloadOutputChannel). Pure relocation with no code change; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ReliableChannelEx.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelEx.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelEx.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelEx.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelEx.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelEx.java From 94b5b0ca5c4f30581399bd808dda5ca440842128 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 25 Jun 2026 23:44:17 +0300 Subject: [PATCH 033/110] IGNITE-28819 Move NullLogger to ignite-commons Relocate the no-op IgniteLogger implementation NullLogger from ignite-core to ignite-commons so it is available to modules that must not depend on ignite-core (the thin client implementation uses NullLogger.INSTANCE). It is self-contained: it implements IgniteLogger and uses only the S to-string helper, both already in ignite-commons. Its package org.apache.ignite.logger is preserved, so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/apache/ignite/logger/NullLogger.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/logger/NullLogger.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/logger/NullLogger.java b/modules/commons/src/main/java/org/apache/ignite/logger/NullLogger.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/logger/NullLogger.java rename to modules/commons/src/main/java/org/apache/ignite/logger/NullLogger.java From d3ba4654102a21aed554cf635dbaac9fb1cfbc34 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 00:35:33 +0300 Subject: [PATCH 034/110] IGNITE-28819 Move BinaryContext creation helpers to BinaryUtils Relocate the machinery for creating a BinaryContext into ignite-binary-api's BinaryUtils so it can be used by modules that must not depend on ignite-core (the thin client implementation): * TestBinaryContext (+ TestBinaryContextListener) and the useTestBinaryCtx test flag moved from IgniteUtils to BinaryUtils. * New BinaryUtils.binaryContext(...) overload that takes explicit values (ignite instance name, class loader, BinaryConfiguration, affinity fields, affinity-field-name provider) instead of an IgniteConfiguration. IgniteUtils.binaryContext(IgniteConfiguration) now derives those values and delegates to it. * affinityFieldName(Class) moved to BinaryUtils; all call sites (IgniteUtils, CacheConfiguration, CacheObjectBinaryProcessorImpl, IgniteMock) repointed and GridCacheUtils.affinityFieldName removed. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/binary/BinaryUtils.java | 172 ++++++++++++++++++ .../configuration/CacheConfiguration.java | 4 +- .../processors/cache/GridCacheUtils.java | 17 -- .../CacheObjectBinaryProcessorImpl.java | 2 +- .../ignite/internal/util/IgniteUtils.java | 142 +-------------- .../testframework/junits/IgniteMock.java | 2 +- ...tadataConcurrentUpdateWithIndexesTest.java | 9 +- 7 files changed, 191 insertions(+), 157 deletions(-) diff --git a/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index cbb9394cb2b57..234ff797ec0e1 100644 --- a/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -27,6 +27,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.lang.reflect.Array; +import java.lang.reflect.Field; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -62,13 +63,20 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteCommonsSystemProperties; import org.apache.ignite.IgniteException; +import org.apache.ignite.IgniteLogger; import org.apache.ignite.binary.BinaryCollectionFactory; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.binary.BinaryInvalidTypeException; import org.apache.ignite.binary.BinaryMapFactory; +import org.apache.ignite.binary.BinaryNameMapper; import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryObjectException; +import org.apache.ignite.binary.BinarySerializer; import org.apache.ignite.binary.BinaryType; +import org.apache.ignite.binary.BinaryTypeConfiguration; import org.apache.ignite.binary.Binarylizable; +import org.apache.ignite.cache.affinity.AffinityKeyMapped; +import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.internal.binary.streams.BinaryInputStream; import org.apache.ignite.internal.binary.streams.BinaryOutputStream; import org.apache.ignite.internal.util.CommonUtils; @@ -167,6 +175,10 @@ TreeSet.class, new BinaryTreeSetWriteReplacer() public static boolean FIELDS_SORTED_ORDER = IgniteCommonsSystemProperties.getBoolean(IgniteCommonsSystemProperties.IGNITE_BINARY_SORT_OBJECT_FIELDS); + /** For tests. */ + @SuppressWarnings("PublicField") + public static boolean useTestBinaryCtx; + /** Field type names. */ private static final String[] FIELD_TYPE_NAMES; @@ -3091,4 +3103,164 @@ public EnumType(int typeId, @Nullable String clsName) { this.clsName = clsName; } } + + /** + * @param cls Class to get affinity field for. + * @return Affinity field name or {@code null} if field name was not found. + */ + public static String affinityFieldName(Class cls) { + for (; cls != Object.class && cls != null; cls = cls.getSuperclass()) { + for (Field f : cls.getDeclaredFields()) { + if (f.getAnnotation(AffinityKeyMapped.class) != null) + return f.getName(); + } + } + + return null; + } + + /** + * Creates a binary context from explicit values. + * + * @param metaHnd Binary metadata handler. + * @param marsh Binary marshaller. + * @param igniteInstanceName Ignite instance name. + * @param classLoader Class loader. + * @param binCfg Binary configuration. + * @param affFlds Affinity fields by type name. + * @param affFldNameProvider Affinity field name provider. + * @param log Logger. + * @return Binary context instance. + */ + public static BinaryContext binaryContext( + BinaryMetadataHandler metaHnd, + BinaryMarshaller marsh, + @Nullable String igniteInstanceName, + @Nullable ClassLoader classLoader, + BinaryConfiguration binCfg, + Map affFlds, + Function, String> affFldNameProvider, + IgniteLogger log + ) { + return useTestBinaryCtx + ? new TestBinaryContext( + metaHnd, + marsh, + igniteInstanceName, + classLoader, + binCfg.getSerializer(), + binCfg.getIdMapper(), + binCfg.getNameMapper(), + binCfg.getTypeConfigurations(), + affFlds, + binCfg.isCompactFooter(), + affFldNameProvider, + log + ) + : new BinaryContext( + metaHnd, + marsh, + igniteInstanceName, + classLoader, + binCfg.getSerializer(), + binCfg.getIdMapper(), + binCfg.getNameMapper(), + binCfg.getTypeConfigurations(), + affFlds, + binCfg.isCompactFooter(), + affFldNameProvider, + log + ); + } + + /** */ + @SuppressWarnings("PublicInnerClass") + public static class TestBinaryContext extends BinaryContext { + /** */ + private List listeners; + + /** */ + public TestBinaryContext( + BinaryMetadataHandler metaHnd, + @Nullable BinaryMarshaller marsh, + @Nullable String igniteInstanceName, + @Nullable ClassLoader clsLdr, + @Nullable BinarySerializer dfltSerializer, + @Nullable BinaryIdMapper idMapper, + @Nullable BinaryNameMapper nameMapper, + @Nullable Collection typeCfgs, + Map affFlds, + boolean compactFooter, + Function, String> affFldNameProvider, + IgniteLogger log + ) { + super( + metaHnd, + marsh, + igniteInstanceName, + clsLdr, + dfltSerializer, + idMapper, + nameMapper, + typeCfgs, + affFlds, + compactFooter, + affFldNameProvider, + log + ); + } + + + /** {@inheritDoc} */ + @Nullable @Override public BinaryType metadata(int typeId) throws BinaryObjectException { + BinaryType metadata = super.metadata(typeId); + + if (listeners != null) { + for (TestBinaryContextListener listener : listeners) + listener.onAfterMetadataRequest(typeId, metadata); + } + + return metadata; + } + + /** {@inheritDoc} */ + @Override public void updateMetadata(int typeId, BinaryMetadata meta, boolean failIfUnregistered) throws BinaryObjectException { + if (listeners != null) { + for (TestBinaryContextListener listener : listeners) + listener.onBeforeMetadataUpdate(typeId, meta); + } + + super.updateMetadata(typeId, meta, failIfUnregistered); + } + + /** */ + public interface TestBinaryContextListener { + /** + * @param typeId Type id. + * @param type Type. + */ + void onAfterMetadataRequest(int typeId, BinaryType type); + + /** + * @param typeId Type id. + * @param metadata Metadata. + */ + void onBeforeMetadataUpdate(int typeId, BinaryMetadata metadata); + } + + /** @param lsnr Listener. */ + public void addListener(TestBinaryContextListener lsnr) { + if (listeners == null) + listeners = new ArrayList<>(); + + if (!listeners.contains(lsnr)) + listeners.add(lsnr); + } + + /** */ + public void clearAllListener() { + if (listeners != null) + listeners.clear(); + } + } } diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java index 4a8d52e81e770..ce1bc69c9b77d 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java @@ -52,10 +52,10 @@ import org.apache.ignite.cache.store.CacheStore; import org.apache.ignite.cache.store.CacheStoreSessionListener; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.processors.query.QueryUtils; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.A; -import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteExperimental; @@ -1984,7 +1984,7 @@ public CacheConfiguration setIndexedTypes(Class... indexedTypes) { qryEntities.add(newEntity); // Set key configuration if needed. - String affFieldName = CU.affinityFieldName(keyCls); + String affFieldName = BinaryUtils.affinityFieldName(keyCls); if (affFieldName != null) { CacheKeyConfiguration newKeyCfg = new CacheKeyConfiguration(newEntity.getKeyType(), affFieldName); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java index 9437762372485..924bfd3db6d34 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java @@ -17,7 +17,6 @@ package org.apache.ignite.internal.processors.cache; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -53,7 +52,6 @@ import org.apache.ignite.cache.CacheServerNotFoundException; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.affinity.AffinityFunction; -import org.apache.ignite.cache.affinity.AffinityKeyMapped; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.store.CacheStoreSessionListener; import org.apache.ignite.cluster.ClusterNode; @@ -2205,21 +2203,6 @@ public static Map affinityFields(@Nullable IgniteConfiguration c return affFields; } - /** - * @param cls Class to get affinity field for. - * @return Affinity field name or {@code null} if field name was not found. - */ - public static String affinityFieldName(Class cls) { - for (; cls != Object.class && cls != null; cls = cls.getSuperclass()) { - for (Field f : cls.getDeclaredFields()) { - if (f.getAnnotation(AffinityKeyMapped.class) != null) - return f.getName(); - } - } - - return null; - } - /** * */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index 2913263ed9d80..2e44c95fe2533 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -115,9 +115,9 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_WAIT_SCHEMA_UPDATE; import static org.apache.ignite.IgniteSystemProperties.getBoolean; import static org.apache.ignite.internal.GridComponent.DiscoveryDataExchangeType.BINARY_PROC; +import static org.apache.ignite.internal.binary.BinaryUtils.affinityFieldName; import static org.apache.ignite.internal.binary.BinaryUtils.mergeMetadata; import static org.apache.ignite.internal.processors.metric.impl.MetricUtils.metricName; -import static org.apache.ignite.internal.util.typedef.internal.CU.affinityFieldName; /** * Binary processor implementation. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 1513346138589..4a2e36ae17ae6 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -114,7 +114,6 @@ import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReadWriteLock; import java.util.function.Consumer; -import java.util.function.Function; import java.util.jar.JarFile; import java.util.logging.ConsoleHandler; import java.util.logging.Handler; @@ -144,13 +143,7 @@ import org.apache.ignite.IgniteLogger; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.binary.BinaryField; -import org.apache.ignite.binary.BinaryIdMapper; -import org.apache.ignite.binary.BinaryNameMapper; import org.apache.ignite.binary.BinaryObjectBuilder; -import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinarySerializer; -import org.apache.ignite.binary.BinaryType; -import org.apache.ignite.binary.BinaryTypeConfiguration; import org.apache.ignite.cluster.ClusterGroupEmptyException; import org.apache.ignite.cluster.ClusterMetrics; import org.apache.ignite.cluster.ClusterNode; @@ -171,7 +164,6 @@ import org.apache.ignite.internal.IgniteNodeAttributes; import org.apache.ignite.internal.binary.BinaryContext; import org.apache.ignite.internal.binary.BinaryMarshaller; -import org.apache.ignite.internal.binary.BinaryMetadata; import org.apache.ignite.internal.binary.BinaryMetadataHandler; import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderEx; @@ -413,10 +405,6 @@ public abstract class IgniteUtils extends CommonUtils { public static boolean IGNITE_TEST_FEATURES_ENABLED = IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_TEST_FEATURES_ENABLED); - /** For tests. */ - @SuppressWarnings("PublicField") - public static boolean useTestBinaryCtx; - /** */ private static final boolean assertionsEnabled; @@ -7896,35 +7884,16 @@ public static BinaryContext binaryContext( ) { BinaryConfiguration bcfg = cfg.getBinaryConfiguration() == null ? new BinaryConfiguration() : cfg.getBinaryConfiguration(); - return useTestBinaryCtx - ? new TestBinaryContext( - metaHnd, - marsh, - cfg.getIgniteInstanceName(), - cfg.getClassLoader(), - bcfg.getSerializer(), - bcfg.getIdMapper(), - bcfg.getNameMapper(), - bcfg.getTypeConfigurations(), - CU.affinityFields(cfg), - bcfg.isCompactFooter(), - CU::affinityFieldName, - log - ) - : new BinaryContext( - metaHnd, - marsh, - cfg.getIgniteInstanceName(), - cfg.getClassLoader(), - bcfg.getSerializer(), - bcfg.getIdMapper(), - bcfg.getNameMapper(), - bcfg.getTypeConfigurations(), - CU.affinityFields(cfg), - bcfg.isCompactFooter(), - CU::affinityFieldName, - log - ); + return BinaryUtils.binaryContext( + metaHnd, + marsh, + cfg.getIgniteInstanceName(), + cfg.getClassLoader(), + bcfg, + CU.affinityFields(cfg), + BinaryUtils::affinityFieldName, + log + ); } /** @@ -8009,97 +7978,6 @@ public static IgniteThread newThread(GridWorker worker) { return new IgniteThread(worker.igniteInstanceName(), worker.name(), worker); } - /** */ - @SuppressWarnings("PublicInnerClass") - public static class TestBinaryContext extends BinaryContext { - /** */ - private List listeners; - - /** */ - public TestBinaryContext( - BinaryMetadataHandler metaHnd, - @Nullable BinaryMarshaller marsh, - @Nullable String igniteInstanceName, - @Nullable ClassLoader clsLdr, - @Nullable BinarySerializer dfltSerializer, - @Nullable BinaryIdMapper idMapper, - @Nullable BinaryNameMapper nameMapper, - @Nullable Collection typeCfgs, - Map affFlds, - boolean compactFooter, - Function, String> affFldNameProvider, - IgniteLogger log - ) { - super( - metaHnd, - marsh, - igniteInstanceName, - clsLdr, - dfltSerializer, - idMapper, - nameMapper, - typeCfgs, - affFlds, - compactFooter, - affFldNameProvider, - log - ); - } - - - /** {@inheritDoc} */ - @Nullable @Override public BinaryType metadata(int typeId) throws BinaryObjectException { - BinaryType metadata = super.metadata(typeId); - - if (listeners != null) { - for (TestBinaryContextListener listener : listeners) - listener.onAfterMetadataRequest(typeId, metadata); - } - - return metadata; - } - - /** {@inheritDoc} */ - @Override public void updateMetadata(int typeId, BinaryMetadata meta, boolean failIfUnregistered) throws BinaryObjectException { - if (listeners != null) { - for (TestBinaryContextListener listener : listeners) - listener.onBeforeMetadataUpdate(typeId, meta); - } - - super.updateMetadata(typeId, meta, failIfUnregistered); - } - - /** */ - public interface TestBinaryContextListener { - /** - * @param typeId Type id. - * @param type Type. - */ - void onAfterMetadataRequest(int typeId, BinaryType type); - - /** - * @param typeId Type id. - * @param metadata Metadata. - */ - void onBeforeMetadataUpdate(int typeId, BinaryMetadata metadata); - } - - /** @param lsnr Listener. */ - public void addListener(TestBinaryContextListener lsnr) { - if (listeners == null) - listeners = new ArrayList<>(); - - if (!listeners.contains(lsnr)) - listeners.add(lsnr); - } - - /** */ - public void clearAllListener() { - if (listeners != null) - listeners.clear(); - } - } - /** */ public static final IgniteDataTransferObjectSerializer EMPTY_DTO_SERIALIZER = new IgniteDataTransferObjectSerializer() { /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java index 152b209a533a7..a37e758c414ee 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java @@ -480,7 +480,7 @@ public IgniteMock(String name, String locHost, UUID nodeId, Marshaller marshalle bcfg.getTypeConfigurations(), CU.affinityFields(configuration()), bcfg.isCompactFooter(), - CU::affinityFieldName, + BinaryUtils::affinityFieldName, NullLogger.INSTANCE ) { @Override public int typeId(String typeName) { diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataConcurrentUpdateWithIndexesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataConcurrentUpdateWithIndexesTest.java index 1a4403a307acd..8e9bbd48ca383 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataConcurrentUpdateWithIndexesTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataConcurrentUpdateWithIndexesTest.java @@ -44,10 +44,11 @@ import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.binary.BinaryMetadata; +import org.apache.ignite.internal.binary.BinaryUtils; +import org.apache.ignite.internal.binary.BinaryUtils.TestBinaryContext; +import org.apache.ignite.internal.binary.BinaryUtils.TestBinaryContext.TestBinaryContextListener; import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl; import org.apache.ignite.internal.processors.cache.binary.MetadataUpdateProposedMessage; -import org.apache.ignite.internal.util.IgniteUtils.TestBinaryContext; -import org.apache.ignite.internal.util.IgniteUtils.TestBinaryContext.TestBinaryContextListener; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.spi.discovery.tcp.BlockTcpDiscoverySpi; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; @@ -343,14 +344,14 @@ protected BinaryObject build(Ignite ignite, String prefix, int... fields) { @Override protected void beforeTest() throws Exception { super.beforeTest(); - U.useTestBinaryCtx = true; + BinaryUtils.useTestBinaryCtx = true; } /** {@inheritDoc} */ @Override protected void afterTest() throws Exception { super.afterTest(); - U.useTestBinaryCtx = false; + BinaryUtils.useTestBinaryCtx = false; stopAllGrids(); } From 3ae7dd51e9cb7880083cc3cde225a54f3768dc27 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 00:35:50 +0300 Subject: [PATCH 035/110] IGNITE-28819 Move ClientBinaryMarshaller to ignite-thin-client-impl ClientBinaryMarshaller now builds its BinaryContext via BinaryUtils.binaryContext(...) (explicit values, no IgniteConfiguration) and BinaryUtils::affinityFieldName, with NullLogger from ignite-commons. This drops its last ignite-core dependencies (the typedef U and IgniteConfiguration), so the class is relocated to ignite-thin-client-impl. Behaviour is preserved: the former throwaway IgniteConfiguration carried no instance name, class loader or cache-key configuration, matching the null/empty arguments passed here. The class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/client/thin/ClientBinaryMarshaller.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientBinaryMarshaller.java (92%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientBinaryMarshaller.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientBinaryMarshaller.java similarity index 92% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientBinaryMarshaller.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientBinaryMarshaller.java index a496265c5b18e..671e1a2c869b9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientBinaryMarshaller.java +++ b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientBinaryMarshaller.java @@ -17,14 +17,14 @@ package org.apache.ignite.internal.client.thin; +import java.util.Collections; import org.apache.ignite.configuration.BinaryConfiguration; -import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.binary.BinaryContext; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.binary.BinaryMetadataHandler; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.binary.GridBinaryMarshaller; import org.apache.ignite.internal.binary.streams.BinaryInputStream; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.logger.NullLogger; import org.apache.ignite.marshaller.MarshallerContext; @@ -108,10 +108,14 @@ private GridBinaryMarshaller createImpl(BinaryConfiguration binCfg) { marsh.setContext(marshCtx); - BinaryContext ctx = U.binaryContext( + BinaryContext ctx = BinaryUtils.binaryContext( metaHnd, marsh, - new IgniteConfiguration().setBinaryConfiguration(binCfg), + null, + null, + binCfg, + Collections.emptyMap(), + BinaryUtils::affinityFieldName, NullLogger.INSTANCE ); From 3beb0d46eb1e56f39f73a66fdf037f159e9666b2 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 10:10:00 +0300 Subject: [PATCH 036/110] IGNITE-28819 Move ClientBinary to ignite-thin-client-impl ClientBinary's dependencies are now all outside ignite-core: binary API/impl types from ignite-binary-api (BinaryContext, BinaryUtils, BinaryObjectBuilders, etc.) and ClientBinaryMarshaller, already in ignite-thin-client-impl. Pure relocation with no code change; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../java/org/apache/ignite/internal/client/thin/ClientBinary.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientBinary.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientBinary.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientBinary.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientBinary.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientBinary.java From 59e64aaed979436623d68bccbf71ba1973204b49 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 10:13:38 +0300 Subject: [PATCH 037/110] IGNITE-28819 Move EventListenerDemultiplexer to ignite-thin-client-impl EventListenerDemultiplexer (the thin client event-listener demultiplexer in package org.apache.ignite.internal.client.monitoring) depends only on the thin client events API (ignite-thin-client-api), ClientConfiguration and ignite-commons types (IgniteLogger, NullLogger, F). Pure relocation with no code change; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/client/monitoring/EventListenerDemultiplexer.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/monitoring/EventListenerDemultiplexer.java From 92ffdcc7e2e7dd8c4ee017f2c3d33c8d648a328d Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 10:23:10 +0300 Subject: [PATCH 038/110] IGNITE-28819 Move PlatformExpiryPolicy to ignite-commons Relocate PlatformExpiryPolicy from ignite-core to ignite-commons so its convertDuration(Duration) helper is available to modules that must not depend on ignite-core (the thin client's ClientUtils/TcpClientCache use it). The class implements javax.cache.expiry.ExpiryPolicy and uses only JCache types (cache-api is already a commons dependency); its package org.apache.ignite.internal.processors.platform.cache.expiry is preserved so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../processors/platform/cache/expiry/PlatformExpiryPolicy.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/platform/cache/expiry/PlatformExpiryPolicy.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/expiry/PlatformExpiryPolicy.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/cache/expiry/PlatformExpiryPolicy.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/expiry/PlatformExpiryPolicy.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/cache/expiry/PlatformExpiryPolicy.java From 5a0b4309e38ad50eaf9e7c0ab024df9b0d7d96d3 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 10:26:02 +0300 Subject: [PATCH 039/110] IGNITE-28819 Move ClientUtils to ignite-thin-client-impl ClientUtils no longer has ignite-core dependencies: its former blocker PlatformExpiryPolicy.convertDuration is now in ignite-commons, and it references only thin client API types and classes already in ignite-thin-client-impl. Pure relocation with no code change; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../java/org/apache/ignite/internal/client/thin/ClientUtils.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java From 4a1e1842db698bbd5dd403074dcf73d5419e02d5 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 10:43:41 +0300 Subject: [PATCH 040/110] IGNITE-28819 Move IgniteUtils.cast/unwrap to CommonUtils Relocate the exception helpers cast(Throwable) and unwrap(Throwable) from ignite-core's IgniteUtils to ignite-commons's CommonUtils so they are available to modules that must not depend on ignite-core (GridFutureAdapter uses U.cast). Both depend only on commons types (GridClosureException, IgniteCheckedException). Since IgniteUtils extends CommonUtils, existing U.cast / U.unwrap call sites keep working via inheritance, with no caller changes. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/util/CommonUtils.java | 44 +++++++++++++++++++ .../ignite/internal/util/IgniteUtils.java | 44 ------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index e87513b9b0aae..0f2e21b55f377 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -79,6 +79,7 @@ import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException; import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.processors.cache.CacheClassLoaderMarker; +import org.apache.ignite.internal.util.lang.GridClosureException; import org.apache.ignite.internal.util.lang.GridTuple; import org.apache.ignite.internal.util.typedef.C1; import org.apache.ignite.internal.util.typedef.F; @@ -2354,4 +2355,47 @@ public static int toDigit(char ch, int idx) throws IgniteCheckedException { return sqlClasses; } + + /** + * Unwraps closure exceptions. + * + * @param t Exception. + * @return Unwrapped exception. + */ + public static Exception unwrap(Throwable t) { + assert t != null; + + while (true) { + if (t instanceof Error) + throw (Error)t; + + if (t instanceof GridClosureException) { + t = ((GridClosureException)t).unwrap(); + + continue; + } + + return (Exception)t; + } + } + + /** + * Casts the passed {@code Throwable t} to {@link IgniteCheckedException}.
+ * If {@code t} is a {@link GridClosureException}, it is unwrapped and then cast to {@link IgniteCheckedException}. + * If {@code t} is an {@link IgniteCheckedException}, it is returned. + * If {@code t} is not a {@link IgniteCheckedException}, a new {@link IgniteCheckedException} caused by {@code t} + * is returned. + * + * @param t Throwable to cast. + * @return {@code t} cast to {@link IgniteCheckedException}. + */ + public static IgniteCheckedException cast(Throwable t) { + assert t != null; + + t = unwrap(t); + + return t instanceof IgniteCheckedException + ? (IgniteCheckedException)t + : new IgniteCheckedException(t); + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 4a2e36ae17ae6..9bea9be89d65b 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -192,7 +192,6 @@ import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.future.IgniteFutureImpl; -import org.apache.ignite.internal.util.lang.GridClosureException; import org.apache.ignite.internal.util.lang.GridPeerDeployAware; import org.apache.ignite.internal.util.lang.IgniteThrowableFunction; import org.apache.ignite.internal.util.typedef.C1; @@ -4868,49 +4867,6 @@ public static JMException jmException(Throwable e) { return new JMException(e.getMessage()); } - /** - * Unwraps closure exceptions. - * - * @param t Exception. - * @return Unwrapped exception. - */ - public static Exception unwrap(Throwable t) { - assert t != null; - - while (true) { - if (t instanceof Error) - throw (Error)t; - - if (t instanceof GridClosureException) { - t = ((GridClosureException)t).unwrap(); - - continue; - } - - return (Exception)t; - } - } - - /** - * Casts the passed {@code Throwable t} to {@link IgniteCheckedException}.
- * If {@code t} is a {@link GridClosureException}, it is unwrapped and then cast to {@link IgniteCheckedException}. - * If {@code t} is an {@link IgniteCheckedException}, it is returned. - * If {@code t} is not a {@link IgniteCheckedException}, a new {@link IgniteCheckedException} caused by {@code t} - * is returned. - * - * @param t Throwable to cast. - * @return {@code t} cast to {@link IgniteCheckedException}. - */ - public static IgniteCheckedException cast(Throwable t) { - assert t != null; - - t = unwrap(t); - - return t instanceof IgniteCheckedException - ? (IgniteCheckedException)t - : new IgniteCheckedException(t); - } - /** * Checks if class loader is an internal P2P class loader. * From dac6a504e70f0a2188df3de0e6af632f0b3d0230 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 10:43:49 +0300 Subject: [PATCH 041/110] IGNITE-28819 Move GridFutureAdapter and related futures to ignite-commons Relocate GridFutureAdapter, GridFinishedFuture and GridFutureChainListener from ignite-core to ignite-commons so future-based code can be built by modules that must not depend on ignite-core (the thin client's ClientRequestFuture extends GridFutureAdapter). These three form a closed reference set within the util.future package; their interface IgniteInternalFuture already lives in ignite-commons. U.cast / U.error usages are repointed to CommonUtils.cast / CommonUtils.error. Package org.apache.ignite.internal.util.future is preserved, so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/util/future/GridFinishedFuture.java | 4 ++-- .../ignite/internal/util/future/GridFutureAdapter.java | 8 ++++---- .../internal/util/future/GridFutureChainListener.java | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java (98%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java (98%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/future/GridFutureChainListener.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java similarity index 98% rename from modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java index 2b42c4bb2f58d..cc6d57dfeb884 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java @@ -21,9 +21,9 @@ import java.util.concurrent.TimeUnit; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.lang.GridClosureException; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgniteOutClosure; @@ -100,7 +100,7 @@ public GridFinishedFuture(Throwable err) { /** {@inheritDoc} */ @Override public T get() throws IgniteCheckedException { if (resFlag == ERR) - throw U.cast((Throwable)res); + throw CommonUtils.cast((Throwable)res); return (T)res; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java similarity index 98% rename from modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java index c932a9c3f8ffc..6f301814f1b01 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java @@ -29,11 +29,11 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.thread.context.function.OperationContextAwareInClosure; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.lang.GridClosureException; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgniteOutClosure; @@ -263,7 +263,7 @@ private R resolve() throws IgniteCheckedException { if (state == null || state.getClass() != ErrorWrapper.class) return (R)state; - throw U.cast(((ErrorWrapper)state).error); + throw CommonUtils.cast(((ErrorWrapper)state).error); } /** @@ -477,11 +477,11 @@ private void notifyListener(IgniteInClosure> lsn lsnr.apply(this); } catch (IllegalStateException e) { - U.error(logger(), "Failed to notify listener (is grid stopped?) [fut=" + this + + CommonUtils.error(logger(), "Failed to notify listener (is grid stopped?) [fut=" + this + ", lsnr=" + lsnr + ", err=" + e.getMessage() + ']', e); } catch (RuntimeException | Error e) { - U.error(logger(), "Failed to notify listener: " + lsnr, e); + CommonUtils.error(logger(), "Failed to notify listener: " + lsnr, e); throw e; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureChainListener.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridFutureChainListener.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureChainListener.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridFutureChainListener.java From 0b30de5a9cd7143ce3481af86f958cddc5af524f Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 10:48:05 +0300 Subject: [PATCH 042/110] IGNITE-28819 Move IgniteUtils.closeQuiet/addSuppressed to CommonUtils Relocate closeQuiet(AutoCloseable), closeQuiet(Socket) and addSuppressed from ignite-core's IgniteUtils to ignite-commons's CommonUtils so they are available to thin client classes being extracted (e.g. TcpClientChannel). They are self-contained (java.net.Socket / Throwable only). Since IgniteUtils extends CommonUtils, existing U.closeQuiet / U.addSuppressed call sites keep working via inheritance, with no caller changes. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/util/CommonUtils.java | 66 +++++++++++++++++++ .../ignite/internal/util/IgniteUtils.java | 66 ------------------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index 0f2e21b55f377..2365891bfde9a 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -2356,6 +2356,72 @@ public static int toDigit(char ch, int idx) throws IgniteCheckedException { return sqlClasses; } + /** + * Quietly closes given resource ignoring possible checked exception. + * + * @param rsrc Resource to close. If it's {@code null} - it's no-op. + */ + public static void closeQuiet(@Nullable AutoCloseable rsrc) { + if (rsrc != null) + try { + rsrc.close(); + } + catch (Exception ignored) { + // No-op. + } + } + + /** + * Quietly closes given {@link Socket} ignoring possible checked exception. + * + * @param sock Socket to close. If it's {@code null} - it's no-op. + */ + public static void closeQuiet(@Nullable Socket sock) { + if (sock == null) + return; + + try { + // Avoid tls 1.3 incompatibility https://bugs.openjdk.java.net/browse/JDK-8208526 + sock.shutdownOutput(); + sock.shutdownInput(); + } + catch (Exception ignored) { + // No-op. + } + + try { + sock.close(); + } + catch (Exception ignored) { + // No-op. + } + } + + /** + * Utility method to add the given throwable error to the given throwable root error. If the given + * suppressed throwable is an {@code Error}, but the root error is not, will change the root to the {@code Error}. + * + * @param root Root error to add suppressed error to. + * @param err Error to add. + * @return New root error. + */ + public static T addSuppressed(T root, T err) { + assert err != null; + + if (root == null) + return err; + + if (err instanceof Error && !(root instanceof Error)) { + err.addSuppressed(root); + + root = err; + } + else + root.addSuppressed(err); + + return root; + } + /** * Unwraps closure exceptions. * diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 9bea9be89d65b..312f1f409381d 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -2783,47 +2783,6 @@ public static void closeWithSuppressingException(@Nullable AutoCloseable rsrc, @ } } - /** - * Quietly closes given resource ignoring possible checked exception. - * - * @param rsrc Resource to close. If it's {@code null} - it's no-op. - */ - public static void closeQuiet(@Nullable AutoCloseable rsrc) { - if (rsrc != null) - try { - rsrc.close(); - } - catch (Exception ignored) { - // No-op. - } - } - - /** - * Quietly closes given {@link Socket} ignoring possible checked exception. - * - * @param sock Socket to close. If it's {@code null} - it's no-op. - */ - public static void closeQuiet(@Nullable Socket sock) { - if (sock == null) - return; - - try { - // Avoid tls 1.3 incompatibility https://bugs.openjdk.java.net/browse/JDK-8208526 - sock.shutdownOutput(); - sock.shutdownInput(); - } - catch (Exception ignored) { - // No-op. - } - - try { - sock.close(); - } - catch (Exception ignored) { - // No-op. - } - } - /** * Quietly releases file lock ignoring all possible exceptions. * @@ -7233,31 +7192,6 @@ private static Collection doInParallel( return results; } - /** - * Utility method to add the given throwable error to the given throwable root error. If the given - * suppressed throwable is an {@code Error}, but the root error is not, will change the root to the {@code Error}. - * - * @param root Root error to add suppressed error to. - * @param err Error to add. - * @return New root error. - */ - public static T addSuppressed(T root, T err) { - assert err != null; - - if (root == null) - return err; - - if (err instanceof Error && !(root instanceof Error)) { - err.addSuppressed(root); - - root = err; - } - else - root.addSuppressed(err); - - return root; - } - /** * @return {@code true} if local node is coordinator. */ From 87671a625fcb203b516b4c9e17bcac6922e17902 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 11:46:53 +0300 Subject: [PATCH 043/110] IGNITE-28819 Move ClientStatus and ClientFlag to ignite-commons Relocate the thin client protocol constant holders ClientStatus and ClientFlag from ignite-core to ignite-commons so they are available to both the server (processors.platform.client) and the thin client implementation being extracted (TcpClientChannel reads ClientStatus.* and ClientFlag.*). Both are self-contained constant classes with no dependencies. Their package org.apache.ignite.internal.processors.platform.client is preserved, so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/processors/platform/client/ClientFlag.java | 0 .../ignite/internal/processors/platform/client/ClientStatus.java | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientFlag.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStatus.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientFlag.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientFlag.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientFlag.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientFlag.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStatus.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStatus.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStatus.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStatus.java From 6f04a77b15f90a95ed9b3f45dac88451a8862615 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 11:51:23 +0300 Subject: [PATCH 044/110] IGNITE-28819 Move ClientConnectionNodeRecoveryException to ignite-commons Relocate ClientConnectionNodeRecoveryException from ignite-core to ignite-commons so it is available to both the server (processors.odbc ClientListenerNioListener) and the thin client implementation being extracted (TcpClientChannel throws/checks it). It extends IgniteCheckedException (already in ignite-commons) and has no other dependencies. Its package org.apache.ignite.internal.processors.odbc is preserved, so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../processors/odbc/ClientConnectionNodeRecoveryException.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/odbc/ClientConnectionNodeRecoveryException.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientConnectionNodeRecoveryException.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/odbc/ClientConnectionNodeRecoveryException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientConnectionNodeRecoveryException.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/odbc/ClientConnectionNodeRecoveryException.java From c24c4d372297d7dd8d647a4b84f65d5c6a3f1253 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 14:15:19 +0300 Subject: [PATCH 045/110] IGNITE-28819 Extract ClientListenerProtocol constants to ignite-commons Extract the THIN_CLIENT (connection type) and HANDSHAKE (request command) constants needed by the thin client into a new ignite-commons class ClientListenerProtocol (package processors.odbc). The server-side ClientListenerNioListener.THIN_CLIENT and the ClientListenerRequest.HANDSHAKE interface constant now delegate to it; both remain literal compile-time constants, so case labels and all existing server/JDBC call sites are unaffected. TcpClientChannel now references ClientListenerProtocol, dropping its dependency on the (unmovable, server-side) ClientListenerNioListener and ClientListenerRequest. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../odbc/ClientListenerProtocol.java | 34 +++++++++++++++++++ .../client/thin/TcpClientChannel.java | 7 ++-- .../odbc/ClientListenerNioListener.java | 2 +- .../odbc/ClientListenerRequest.java | 2 +- 4 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 modules/commons/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProtocol.java diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProtocol.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProtocol.java new file mode 100644 index 0000000000000..3720694c2b81d --- /dev/null +++ b/modules/commons/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProtocol.java @@ -0,0 +1,34 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.odbc; + +/** + * Client listener protocol constants shared between the server-side listener and the thin client. + */ +public final class ClientListenerProtocol { + /** Thin client handshake (connection type) code. */ + public static final byte THIN_CLIENT = 2; + + /** Handshake request command code. */ + public static final int HANDSHAKE = 1; + + /** */ + private ClientListenerProtocol() { + // No-op. + } +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java index 00a6c56c59e88..2302fcb68a930 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java @@ -64,8 +64,7 @@ import org.apache.ignite.internal.client.thin.io.ClientMessageHandler; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.odbc.ClientConnectionNodeRecoveryException; -import org.apache.ignite.internal.processors.odbc.ClientListenerNioListener; -import org.apache.ignite.internal.processors.odbc.ClientListenerRequest; +import org.apache.ignite.internal.processors.odbc.ClientListenerProtocol; import org.apache.ignite.internal.processors.platform.client.ClientFlag; import org.apache.ignite.internal.processors.platform.client.ClientStatus; import org.apache.ignite.internal.util.future.GridFutureAdapter; @@ -846,13 +845,13 @@ private void handshakeReq(ProtocolVersion proposedVer, String user, String pwd, ProtocolContext protocolCtx = protocolContextFromVersion(proposedVer); writer.writeInt(0); // reserve an integer for the request size - writer.writeByte((byte)ClientListenerRequest.HANDSHAKE); + writer.writeByte((byte)ClientListenerProtocol.HANDSHAKE); writer.writeShort(proposedVer.major()); writer.writeShort(proposedVer.minor()); writer.writeShort(proposedVer.patch()); - writer.writeByte(ClientListenerNioListener.THIN_CLIENT); + writer.writeByte(ClientListenerProtocol.THIN_CLIENT); if (protocolCtx.isFeatureSupported(BITMAP_FEATURES)) { byte[] features = ProtocolBitmaskFeature.featuresAsBytes(protocolCtx.features()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java index 3d6f6ab75c3be..de9833824e0a5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerNioListener.java @@ -63,7 +63,7 @@ public class ClientListenerNioListener extends GridNioServerListenerAdapter Date: Fri, 26 Jun 2026 14:20:56 +0300 Subject: [PATCH 046/110] IGNITE-28819 Add BinaryUtils.binaryContext(BinaryMarshaller) overload Add a convenience BinaryUtils.binaryContext(marsh) overload that builds a binary context with default (empty) configuration, mirroring the existing IgniteUtils.binaryContext(BinaryMarshaller) but without requiring ignite-core. Used by the thin client (TcpClientChannel) for handshake/error decoding. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/binary/BinaryUtils.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index 234ff797ec0e1..bbf642108042b 100644 --- a/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -86,6 +86,7 @@ import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.lang.IgniteUuid; +import org.apache.ignite.logger.NullLogger; import org.apache.ignite.marshaller.Marshallers; import org.apache.ignite.platform.PlatformType; import org.jetbrains.annotations.Nullable; @@ -3119,6 +3120,25 @@ public static String affinityFieldName(Class cls) { return null; } + /** + * Creates a binary context with default (empty) configuration for the given marshaller. + * + * @param marsh Binary marshaller (may be {@code null}). + * @return Binary context instance. + */ + public static BinaryContext binaryContext(BinaryMarshaller marsh) { + return binaryContext( + cachingMetadataHandler(), + marsh, + null, + null, + new BinaryConfiguration(), + Collections.emptyMap(), + BinaryUtils::affinityFieldName, + NullLogger.INSTANCE + ); + } + /** * Creates a binary context from explicit values. * From d58cb270e33f92af3bf323d335b507ad5b55f29a Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 26 Jun 2026 14:20:57 +0300 Subject: [PATCH 047/110] IGNITE-28819 Move TcpClientChannel and ClientChannelConfiguration to ignite-thin-client-impl TcpClientChannel and ClientChannelConfiguration form a mutual reference cycle and move together. TcpClientChannel's last ignite-core dependencies are gone: U.closeQuiet/U.addSuppressed are repointed to CommonUtils, U.binaryContext(null) to BinaryUtils.binaryContext, and the handshake protocol constants now come from the relocated ClientListenerProtocol / ClientStatus / ClientFlag in ignite-commons. ClientChannelConfiguration has no remaining core dependencies. Both still ship in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../client/thin/ClientChannelConfiguration.java | 0 .../internal/client/thin/TcpClientChannel.java | 12 ++++++------ 2 files changed, 6 insertions(+), 6 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientChannelConfiguration.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java (98%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientChannelConfiguration.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientChannelConfiguration.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientChannelConfiguration.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientChannelConfiguration.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java similarity index 98% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java index 2302fcb68a930..25e2401c010e4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java +++ b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java @@ -67,12 +67,12 @@ import org.apache.ignite.internal.processors.odbc.ClientListenerProtocol; import org.apache.ignite.internal.processors.platform.client.ClientFlag; import org.apache.ignite.internal.processors.platform.client.ClientStatus; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.T2; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.logger.NullLogger; import org.jetbrains.annotations.Nullable; @@ -216,7 +216,7 @@ class TcpClientChannel implements ClientChannel, ClientMessageHandler, ClientCon catch (ClientConnectionException e) { log.info("Can't establish connection with " + addr); - connectionEx = U.addSuppressed(connectionEx, e); + connectionEx = CommonUtils.addSuppressed(connectionEx, e); continue; } @@ -230,9 +230,9 @@ class TcpClientChannel implements ClientChannel, ClientMessageHandler, ClientCon log.info("Can't establish connection with " + addr + ". Node in recovery mode."); - connectionEx = U.addSuppressed(connectionEx, e); + connectionEx = CommonUtils.addSuppressed(connectionEx, e); - U.closeQuiet(sock); + CommonUtils.closeQuiet(sock); sock = null; continue; @@ -289,7 +289,7 @@ private void close(Exception cause) { if (heartbeatTimer != null) heartbeatTimer.cancel(); - U.closeQuiet(sock); + CommonUtils.closeQuiet(sock); pendingReqsLock.writeLock().lock(); @@ -841,7 +841,7 @@ else if (!supportedVers.contains(srvVer) || /** Send handshake request. */ private void handshakeReq(ProtocolVersion proposedVer, String user, String pwd, Map userAttrs) throws ClientConnectionException { - try (BinaryWriterEx writer = BinaryUtils.writer(U.binaryContext(null), BinaryStreams.outputStream(32), null)) { + try (BinaryWriterEx writer = BinaryUtils.writer(BinaryUtils.binaryContext(null), BinaryStreams.outputStream(32), null)) { ProtocolContext protocolCtx = protocolContextFromVersion(proposedVer); writer.writeInt(0); // reserve an integer for the request size From ba8653f2e9acb26abd367902ed68ce7805f38d9b Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 13:44:30 +0300 Subject: [PATCH 048/110] IGNITE-28819 Move TcpClientTransactions to ignite-thin-client-impl TcpClientTransactions (and its inner TcpClientTransaction) has no remaining ignite-core dependencies and references no thin class still in core. Pure relocation with no code change; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../apache/ignite/internal/client/thin/TcpClientTransactions.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/TcpClientTransactions.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientTransactions.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpClientTransactions.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientTransactions.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpClientTransactions.java From 79e9b8db9bec0a124443e57cd093418942716b06 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 13:59:43 +0300 Subject: [PATCH 049/110] IGNITE-28819 Repoint thin client U usages to CommonUtils Repoint nine thin client classes from the ignite-core typedef U (org.apache.ignite.internal.util.typedef.internal.U) to org.apache.ignite.internal.util.CommonUtils for the helper methods they use (closeQuiet, newHashMap, newHashSet, ceilPow2, currentTimeMillis, convertException, nanosToMillis). These methods already live in CommonUtils (U extends IgniteUtils extends CommonUtils), so this is a pure import/qualifier change with no behaviour change, removing the last ignite-core dependency of several of these classes. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/client/thin/ClientCacheAffinityContext.java | 4 ++-- .../internal/client/thin/ClientCacheAffinityMapping.java | 8 ++++---- .../client/thin/ClientCacheEntryListenerHandler.java | 4 ++-- .../internal/client/thin/ClientClusterGroupImpl.java | 6 +++--- .../ignite/internal/client/thin/ClientComputeImpl.java | 4 ++-- .../internal/client/thin/ClientContinuousQueryCursor.java | 6 +++--- .../ignite/internal/client/thin/ClientServicesImpl.java | 4 ++-- .../ignite/internal/client/thin/ReliableChannelImpl.java | 4 ++-- .../ignite/internal/client/thin/TcpClientCache.java | 6 +++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java index 9ac655460ef71..fb3877dbdee6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java @@ -38,8 +38,8 @@ import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.binary.BinaryWriterEx; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.GridConcurrentHashSet; -import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.Nullable; import static org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion.NONE; @@ -365,7 +365,7 @@ public void registerCache(String cacheName) { ClientPartitionAwarenessMapperHolder hld = cacheKeyMapperFactoryMap.computeIfAbsent(ClientUtils.cacheId(cacheName), id -> new ClientPartitionAwarenessMapperHolder(cacheName)); - hld.ts = U.currentTimeMillis(); + hld.ts = CommonUtils.currentTimeMillis(); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java index 4a944e0c6915e..f35d5b9024d6c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java @@ -34,8 +34,8 @@ import org.apache.ignite.internal.binary.BinaryWriterEx; import org.apache.ignite.internal.binary.streams.BinaryOutputStream; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.internal.util.typedef.internal.U; import static org.apache.ignite.internal.client.thin.ProtocolBitmaskFeature.ALL_AFFINITY_MAPPINGS; import static org.apache.ignite.internal.client.thin.ProtocolBitmaskFeature.DC_AWARE; @@ -211,7 +211,7 @@ public static ClientCacheAffinityMapping readResponse( int cachesCnt = in.readInt(); if (applicable) { // Partition awareness is applicable for these caches. - Map> cacheKeyCfg = U.newHashMap(cachesCnt); + Map> cacheKeyCfg = CommonUtils.newHashMap(cachesCnt); for (int j = 0; j < cachesCnt; j++) cacheKeyCfg.put(in.readInt(), readCacheKeyConfiguration(in)); @@ -264,7 +264,7 @@ public static ClientCacheAffinityMapping readResponse( private static Map readCacheKeyConfiguration(BinaryReaderEx in) { int keyCfgCnt = in.readInt(); - Map keyCfg = U.newHashMap(keyCfgCnt); + Map keyCfg = CommonUtils.newHashMap(keyCfgCnt); for (int i = 0; i < keyCfgCnt; i++) keyCfg.put(in.readInt(), in.readInt()); @@ -298,7 +298,7 @@ private static UUID[] readNodePartitions(BinaryReaderEx in) { // Expand partToNode if needed. if (part >= partToNode.length) - partToNode = Arrays.copyOf(partToNode, U.ceilPow2(part + 1)); + partToNode = Arrays.copyOf(partToNode, CommonUtils.ceilPow2(part + 1)); } partToNode[part] = nodeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java index 72142323a2546..5ca39dc97d98d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java @@ -36,8 +36,8 @@ import org.apache.ignite.internal.binary.streams.BinaryInputStream; import org.apache.ignite.internal.binary.streams.BinaryOutputStream; import org.apache.ignite.internal.binary.streams.BinaryStreams; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.T2; -import org.apache.ignite.internal.util.typedef.internal.U; import static org.apache.ignite.internal.client.thin.ClientNotificationType.CONTINUOUS_QUERY_EVENT; import static org.apache.ignite.internal.client.thin.TcpClientCache.JAVA_PLATFORM; @@ -176,7 +176,7 @@ public synchronized void startListen( if (lsnr != null) lsnr.onDisconnected(reason); - U.closeQuiet(this); + CommonUtils.closeQuiet(this); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java index 838aecc92a33a..fbca7b15caa04 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java @@ -42,10 +42,10 @@ import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.binary.BinaryReaderEx; import org.apache.ignite.internal.binary.BinaryWriterEx; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.lang.ClusterNodeFunc; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.A; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteProductVersion; import org.jetbrains.annotations.Nullable; @@ -121,7 +121,7 @@ private ClientClusterGroupImpl(ReliableChannelEx ch, ClientUtils utils, @Override public ClientClusterGroup forOthers(ClusterNode node, ClusterNode... nodes) { A.notNull(node, "node"); - Collection nodes0 = collection(U::newHashSet, node, nodes); + Collection nodes0 = collection(CommonUtils::newHashSet, node, nodes); return forPredicate(n -> !nodes0.contains(n)); } @@ -221,7 +221,7 @@ private ClientClusterGroupImpl(ReliableChannelEx ch, ClientUtils utils, @Override public ClientClusterGroup forHost(String host, String... hosts) { A.notNull(host, "host"); - Collection hosts0 = collection(U::newHashSet, host, hosts); + Collection hosts0 = collection(CommonUtils::newHashSet, host, hosts); return forPredicate(n -> { for (String hostName : n.hostNames()) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java index 7234473597c2e..d3fbf8744ffae 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java @@ -37,9 +37,9 @@ import org.apache.ignite.internal.binary.BinaryWriterEx; import org.apache.ignite.internal.binary.streams.BinaryStreams; import org.apache.ignite.internal.processors.platform.client.ClientStatus; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.Nullable; import static org.apache.ignite.internal.client.thin.ClientNotificationType.COMPUTE_TASK_FINISHED; @@ -266,7 +266,7 @@ private static boolean cancelGridFuture(GridFutureAdapter fut, Boolean mayInt return mayInterruptIfRunning ? fut.cancel() : fut.onCancelled(); } catch (IgniteCheckedException e) { - throw U.convertException(e); + throw CommonUtils.convertException(e); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java index 0ff1f41782e61..7a5e1447b5e25 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java @@ -21,7 +21,7 @@ import java.util.Iterator; import java.util.List; import org.apache.ignite.cache.query.QueryCursor; -import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.internal.util.CommonUtils; import org.jetbrains.annotations.NotNull; /** @@ -50,8 +50,8 @@ class ClientContinuousQueryCursor implements QueryCursor { /** {@inheritDoc} */ @Override public void close() { - U.closeQuiet(initQryCursor); - U.closeQuiet(lsnrHnd); + CommonUtils.closeQuiet(initQryCursor); + CommonUtils.closeQuiet(lsnrHnd); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java index 6cda195ddf72a..342ce8f630c5f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java @@ -40,9 +40,9 @@ import org.apache.ignite.internal.binary.BinaryWriterEx; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.service.ServiceCallContextImpl; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.A; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.platform.PlatformServiceMethod; import org.apache.ignite.platform.PlatformType; import org.apache.ignite.services.ServiceCallContext; @@ -218,7 +218,7 @@ private ServiceTopology(String name) { */ private boolean isUpdateRequired(AffinityTopologyVersion curAffTop) { return lastAffTop == null || curAffTop.topologyVersion() > lastAffTop.topologyVersion() - || U.nanosToMillis(System.nanoTime() - lastUpdateRequestTime) >= SRV_TOP_UPDATE_PERIOD; + || CommonUtils.nanosToMillis(System.nanoTime() - lastUpdateRequestTime) >= SRV_TOP_UPDATE_PERIOD; } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java index ec6e96cb0f979..931a9dfb772c3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java @@ -52,8 +52,8 @@ import org.apache.ignite.configuration.ClientConfiguration; import org.apache.ignite.internal.client.thin.io.ClientConnectionMultiplexer; import org.apache.ignite.internal.client.thin.io.gridnioserver.GridNioClientConnectionMultiplexer; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.logger.NullLogger; import org.jetbrains.annotations.Nullable; @@ -1133,7 +1133,7 @@ private ClientChannel getOrCreateChannel(boolean ignoreThrottling) */ private synchronized void closeChannel() { if (ch != null) { - U.closeQuiet(ch); + CommonUtils.closeQuiet(ch); ch = null; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java index 0099f096b4fbf..ab574b9cf3eb4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java @@ -72,11 +72,11 @@ import org.apache.ignite.internal.processors.cache.CacheInvokeResult; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.processors.platform.client.ClientStatus; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.T3; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.A; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.transactions.TransactionConcurrency; import org.apache.ignite.transactions.TransactionIsolation; import org.jetbrains.annotations.Nullable; @@ -1146,7 +1146,7 @@ else if (qry instanceof IndexQuery) return new ClientContinuousQueryCursor<>(cur, hnd); } catch (Exception e) { - U.closeQuiet(hnd); + CommonUtils.closeQuiet(hnd); throw e; } @@ -1202,7 +1202,7 @@ else if (qry instanceof IndexQuery) @Override public void deregisterCacheEntryListener(CacheEntryListenerConfiguration cfg) { ClientCacheEntryListenerHandler hnd = lsnrsRegistry.deregisterCacheEntryListener(name, cfg); - U.closeQuiet(hnd); + CommonUtils.closeQuiet(hnd); } /** From 3c4636cb2df44844762a44daa5fb99e27493631d Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:01:07 +0300 Subject: [PATCH 050/110] IGNITE-28819 Move ClientClusterGroupImpl to ignite-thin-client-impl With its U usages repointed to CommonUtils, ClientClusterGroupImpl has no remaining ignite-core dependencies and references no thin class still in core. Pure relocation; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientClusterGroupImpl.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterGroupImpl.java From 664e2e2c1b927f000272308b30aeedb9dbbc831e Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:18:14 +0300 Subject: [PATCH 051/110] IGNITE-28819 Move ClientClusterImpl to ignite-thin-client-impl ClientClusterImpl's only remaining dependency was ClientClusterGroupImpl, now in ignite-thin-client-impl. Pure relocation; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ClientClusterImpl.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterImpl.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientClusterImpl.java From a6873a8e17f398aad4f2e7d4653149635fab2674 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:25:52 +0300 Subject: [PATCH 052/110] IGNITE-28819 Move ClientComputeImpl to ignite-thin-client-impl ClientComputeImpl's U usage was repointed to CommonUtils and its only thin dependency ClientClusterGroupImpl is already moved. Pure relocation; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ClientComputeImpl.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientComputeImpl.java From 96c82df6d7316f0dadf4f61d4a8c2d7845eff6b0 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:25:52 +0300 Subject: [PATCH 053/110] IGNITE-28819 Move GenericQueryPager to ignite-thin-client-impl GenericQueryPager has no ignite-core dependencies and references no thin class still in core. Pure relocation; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/GenericQueryPager.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/GenericQueryPager.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/GenericQueryPager.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/GenericQueryPager.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/GenericQueryPager.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/GenericQueryPager.java From 3cd7562ab8bf998c56621453c6960faa03f802eb Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:25:52 +0300 Subject: [PATCH 054/110] IGNITE-28819 Move ClientFieldsQueryPager to ignite-thin-client-impl ClientFieldsQueryPager's only dependency GenericQueryPager is now moved. Pure relocation; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientFieldsQueryPager.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryPager.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryPager.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryPager.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryPager.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientFieldsQueryPager.java From 9a13972fc681bfd0a3a06790039cfab14dae8b60 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:25:52 +0300 Subject: [PATCH 055/110] IGNITE-28819 Move ClientQueryPager to ignite-thin-client-impl ClientQueryPager's only dependency GenericQueryPager is now moved. Pure relocation; the class still ships in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/internal/client/thin/ClientQueryPager.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryPager.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryPager.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryPager.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryPager.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientQueryPager.java From 8508b74d32b48a23e8efa50c1bb034d41269f1ee Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:32:29 +0300 Subject: [PATCH 056/110] IGNITE-28819 Extract data structures constants to ignite-commons Extract DEFAULT_DS_GROUP_NAME and ATOMICS_CACHE_NAME into a new ignite-commons class DataStructuresConstants so they are available to the thin client implementation (ClientAtomicLongImpl builds the atomics cache name from them). DataStructuresProcessor's public constants now delegate to it; they remain literal compile-time constants, so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../DataStructuresConstants.java | 34 +++++++++++++++++++ .../DataStructuresProcessor.java | 4 +-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 modules/commons/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresConstants.java diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresConstants.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresConstants.java new file mode 100644 index 0000000000000..81833e0df5527 --- /dev/null +++ b/modules/commons/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresConstants.java @@ -0,0 +1,34 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.datastructures; + +/** + * Data structures constants shared between ignite-core and the thin client implementation. + */ +public final class DataStructuresConstants { + /** Default data structures group name. */ + public static final String DEFAULT_DS_GROUP_NAME = "default-ds-group"; + + /** Atomics system cache name. */ + public static final String ATOMICS_CACHE_NAME = "ignite-sys-atomic-cache"; + + /** */ + private DataStructuresConstants() { + // No-op. + } +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java index 5f81792151696..3496874f46003 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java @@ -137,13 +137,13 @@ public final class DataStructuresProcessor extends GridProcessorAdapter implemen public static final String VOLATILE_GRP_NAME = DEFAULT_VOLATILE_DS_GROUP_NAME + "@" + VOLATILE_DATA_REGION_NAME; /** */ - public static final String DEFAULT_DS_GROUP_NAME = "default-ds-group"; + public static final String DEFAULT_DS_GROUP_NAME = DataStructuresConstants.DEFAULT_DS_GROUP_NAME; /** */ private static final String DS_CACHE_NAME_PREFIX = "datastructures_"; /** Atomics system cache name. */ - public static final String ATOMICS_CACHE_NAME = "ignite-sys-atomic-cache"; + public static final String ATOMICS_CACHE_NAME = DataStructuresConstants.ATOMICS_CACHE_NAME; /** */ public static final String QUEUES_VIEW = metricName("ds", "queues"); From 516ac369ee1f450f4c321fb0a7ed8e83e1e2870a Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:32:29 +0300 Subject: [PATCH 057/110] IGNITE-28819 Move ClientAtomicLongImpl to ignite-thin-client-impl ClientAtomicLongImpl now reads DEFAULT_DS_GROUP_NAME / ATOMICS_CACHE_NAME from ignite-commons DataStructuresConstants instead of ignite-core's DataStructuresProcessor, removing its last ignite-core dependency. Relocated to ignite-thin-client-impl; still shipped in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientAtomicLongImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientAtomicLongImpl.java (97%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientAtomicLongImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientAtomicLongImpl.java similarity index 97% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientAtomicLongImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientAtomicLongImpl.java index f7f6f521b2659..d3d606b4655d0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientAtomicLongImpl.java +++ b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientAtomicLongImpl.java @@ -21,7 +21,7 @@ import org.apache.ignite.client.ClientAtomicLong; import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.binary.BinaryWriterEx; -import org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor; +import org.apache.ignite.internal.processors.datastructures.DataStructuresConstants; import org.jetbrains.annotations.Nullable; /** @@ -53,8 +53,8 @@ public ClientAtomicLongImpl(String name, @Nullable String groupName, ReliableCha this.groupName = groupName; this.ch = ch; - String grpNameInternal = groupName == null ? DataStructuresProcessor.DEFAULT_DS_GROUP_NAME : groupName; - cacheId = ClientUtils.cacheId(DataStructuresProcessor.ATOMICS_CACHE_NAME + "@" + grpNameInternal); + String grpNameInternal = groupName == null ? DataStructuresConstants.DEFAULT_DS_GROUP_NAME : groupName; + cacheId = ClientUtils.cacheId(DataStructuresConstants.ATOMICS_CACHE_NAME + "@" + grpNameInternal); } /** {@inheritDoc} */ From 2a3a473d343c8365edc89f4ffd5716c8021585f5 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:51:22 +0300 Subject: [PATCH 058/110] IGNITE-28819 Move IgniteClientException to ignite-commons IgniteClientException is needed by the thin client (ClientIgniteSetImpl, TcpIgniteClient). Its only ignite-core dependency was the server-side helper wrapAuthorizationExeption(SecurityException), which is relocated to ClientRequestHandler (its only callers are server-side request handlers). With that gone, IgniteClientException depends only on IgniteException (already in ignite-commons), so it moves to ignite-commons with its package org.apache.ignite.internal.processors.platform.client preserved; all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../platform/client/IgniteClientException.java | 12 ------------ .../platform/client/ClientRequestHandler.java | 16 +++++++++++++++- .../cache/ClientCacheSqlFieldsQueryRequest.java | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/platform/client/IgniteClientException.java (80%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/IgniteClientException.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/client/IgniteClientException.java similarity index 80% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/IgniteClientException.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/client/IgniteClientException.java index 6b0e5ee2f3116..959c6ca5f95bf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/IgniteClientException.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/processors/platform/client/IgniteClientException.java @@ -19,9 +19,6 @@ import java.sql.SQLException; import org.apache.ignite.IgniteException; -import org.apache.ignite.plugin.security.SecurityException; - -import static org.apache.ignite.internal.processors.platform.client.ClientStatus.SECURITY_VIOLATION; /** * Client exception. @@ -64,13 +61,4 @@ public IgniteClientException(int statusCode, String msg, Throwable cause) { public int statusCode() { return statusCode; } - - /** */ - public static IgniteClientException wrapAuthorizationExeption(SecurityException e) { - return new IgniteClientException( - SECURITY_VIOLATION, - "Client is not authorized to perform this operation [errMsg=" + e.getMessage() + ']', - e - ); - } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java index bd15a26ff0a6a..837cab1666ca7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequestHandler.java @@ -115,7 +115,7 @@ public class ClientRequestHandler implements ClientListenerRequestHandler { return handle0(req); } catch (SecurityException ex) { - throw IgniteClientException.wrapAuthorizationExeption(ex); + throw wrapAuthorizationExeption(ex); } } @@ -229,4 +229,18 @@ private int getStatus(Throwable e) { return ClientStatus.FAILED; } + + /** + * Wraps a security exception into a client authorization exception. + * + * @param e Security exception. + * @return Client exception. + */ + public static IgniteClientException wrapAuthorizationExeption(SecurityException e) { + return new IgniteClientException( + ClientStatus.SECURITY_VIOLATION, + "Client is not authorized to perform this operation [errMsg=" + e.getMessage() + ']', + e + ); + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheSqlFieldsQueryRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheSqlFieldsQueryRequest.java index 972184f9791bd..abc7ed4da0c8d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheSqlFieldsQueryRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheSqlFieldsQueryRequest.java @@ -29,8 +29,8 @@ import org.apache.ignite.internal.processors.platform.client.ClientBitmaskFeature; import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext; import org.apache.ignite.internal.processors.platform.client.ClientProtocolContext; +import org.apache.ignite.internal.processors.platform.client.ClientRequestHandler; import org.apache.ignite.internal.processors.platform.client.ClientResponse; -import org.apache.ignite.internal.processors.platform.client.IgniteClientException; import org.apache.ignite.internal.processors.platform.client.tx.ClientTxAwareRequest; import org.apache.ignite.internal.processors.query.QueryUtils; import org.apache.ignite.internal.util.typedef.X; @@ -174,7 +174,7 @@ public ClientCacheSqlFieldsQueryRequest(BinaryReaderEx reader, SecurityException securityEx = X.cause(e, SecurityException.class); if (securityEx != null) - throw IgniteClientException.wrapAuthorizationExeption(securityEx); + throw ClientRequestHandler.wrapAuthorizationExeption(securityEx); throw e; } From 84041f2befe6bb45b03529f817560751a7a6c78c Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 14:51:31 +0300 Subject: [PATCH 059/110] IGNITE-28819 Move ClientIgniteSetImpl to ignite-thin-client-impl ClientIgniteSetImpl's only ignite-core dependency was IgniteClientException, now in ignite-commons. Pure relocation; still shipped in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../apache/ignite/internal/client/thin/ClientIgniteSetImpl.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java From 5ed0ab78efeb27610f900e7f997eaf2a07796180 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 15:02:44 +0300 Subject: [PATCH 060/110] IGNITE-28819 Move partition/safeAbs helpers to CommonUtils Relocate the static helpers calculateMask(int) and calculatePartition(Object, int, int) from RendezvousAffinityFunction, and safeAbs(int)/safeAbs(long) from IgniteUtils, into ignite-commons CommonUtils, so the thin client (ClientCacheAffinityMapping) can compute partitions without depending on ignite-core. RendezvousAffinityFunction.calculateMask/calculatePartition now delegate to CommonUtils; safeAbs keeps working at existing call sites via IgniteUtils inheriting from CommonUtils. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/util/CommonUtils.java | 52 +++++++++++++++++++ .../RendezvousAffinityFunction.java | 12 ++--- .../ignite/internal/util/IgniteUtils.java | 24 --------- 3 files changed, 55 insertions(+), 33 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index 2365891bfde9a..6e9e101a6e067 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -2422,6 +2422,58 @@ public static T addSuppressed(T root, T err) { return root; } + /** + * Gets absolute value for integer. If integer is {@link Integer#MIN_VALUE}, then {@code 0} is returned. + * + * @param i Integer. + * @return Absolute value. + */ + public static int safeAbs(int i) { + i = Math.abs(i); + + return i < 0 ? 0 : i; + } + + /** + * Gets absolute value for long. If argument is {@link Long#MIN_VALUE}, then {@code 0} is returned. + * + * @param i Argument. + * @return Absolute value. + */ + public static long safeAbs(long i) { + i = Math.abs(i); + + return i < 0 ? 0 : i; + } + + /** + * Helper method to calculates mask. + * + * @param parts Number of partitions. + * @return Mask to use in calculation when partitions count is power of 2. + */ + public static int calculateMask(int parts) { + return (parts & (parts - 1)) == 0 ? parts - 1 : -1; + } + + /** + * Helper method to calculate partition. + * + * @param key Key to get partition for. + * @param mask Mask to use in calculation when partitions count is power of 2. + * @param parts Number of partitions. + * @return Partition number for a given key. + */ + public static int calculatePartition(Object key, int mask, int parts) { + if (mask >= 0) { + int h; + + return ((h = key.hashCode()) ^ (h >>> 16)) & mask; + } + + return safeAbs(key.hashCode() % parts); + } + /** * Unwraps closure exceptions. * diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java index 3c14f5d2615f0..78a776e50c5ce 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java @@ -37,12 +37,12 @@ import org.apache.ignite.failure.FailureType; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.cache.GridCacheUtils; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.LT; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiPredicate; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.resources.IgniteInstanceResource; @@ -117,7 +117,7 @@ public class RendezvousAffinityFunction implements AffinityFunction, Serializabl * @return Mask to use in calculation when partitions count is power of 2. */ public static int calculateMask(int parts) { - return (parts & (parts - 1)) == 0 ? parts - 1 : -1; + return CommonUtils.calculateMask(parts); } /** @@ -129,13 +129,7 @@ public static int calculateMask(int parts) { * @return Partition number for a given key. */ public static int calculatePartition(Object key, int mask, int parts) { - if (mask >= 0) { - int h; - - return ((h = key.hashCode()) ^ (h >>> 16)) & mask; - } - - return U.safeAbs(key.hashCode() % parts); + return CommonUtils.calculatePartition(key, mask, parts); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 312f1f409381d..8c2f934aa4f93 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -5551,30 +5551,6 @@ public static void removeJavaNoOpLogger(Collection rmvHnds) { } } - /** - * Gets absolute value for integer. If integer is {@link Integer#MIN_VALUE}, then {@code 0} is returned. - * - * @param i Integer. - * @return Absolute value. - */ - public static int safeAbs(int i) { - i = Math.abs(i); - - return i < 0 ? 0 : i; - } - - /** - * Gets absolute value for long. If argument is {@link Long#MIN_VALUE}, then {@code 0} is returned. - * - * @param i Argument. - * @return Absolute value. - */ - public static long safeAbs(long i) { - i = Math.abs(i); - - return i < 0 ? 0 : i; - } - /** * When {@code long} value given is positive returns that value, otherwise returns provided default value. * From 8b443670d50f40ec2609efcbc84c3613bea627fa Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 15:02:44 +0300 Subject: [PATCH 061/110] IGNITE-28819 Move ClientCacheAffinityMapping to ignite-thin-client-impl ClientCacheAffinityMapping now uses CommonUtils.calculateMask / calculatePartition (relocated to ignite-commons) instead of RendezvousAffinityFunction, removing its last ignite-core dependency. Relocated to ignite-thin-client-impl; still shipped in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/client/thin/ClientCacheAffinityMapping.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java (98%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java similarity index 98% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java index f35d5b9024d6c..1ee7b28fb7eef 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java +++ b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java @@ -26,7 +26,6 @@ import java.util.UUID; import java.util.function.Function; import org.apache.ignite.IgniteBinary; -import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.client.ClientFeatureNotSupportedByServerException; import org.apache.ignite.client.ClientPartitionAwarenessMapper; import org.apache.ignite.internal.binary.BinaryReaderEx; @@ -384,12 +383,12 @@ private static class RendezvousAffinityKeyMapper implements ClientPartitionAware */ private RendezvousAffinityKeyMapper(int parts) { this.parts = parts; - affinityMask = RendezvousAffinityFunction.calculateMask(parts); + affinityMask = CommonUtils.calculateMask(parts); } /** {@inheritDoc} */ @Override public int partition(Object key) { - return RendezvousAffinityFunction.calculatePartition(key, affinityMask, parts); + return CommonUtils.calculatePartition(key, affinityMask, parts); } } } From e51c3798276ea5e7a9903331f00e5e8942ef845c Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 15:08:35 +0300 Subject: [PATCH 062/110] IGNITE-28819 Move ClientCacheAffinityContext to ignite-thin-client-impl ClientCacheAffinityContext's only remaining dependency was ClientCacheAffinityMapping, now in ignite-thin-client-impl. Pure relocation; still shipped in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientCacheAffinityContext.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityContext.java From 37fb19face7ee475fcfd65e378a166d31e60e9a3 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 15:24:16 +0300 Subject: [PATCH 063/110] IGNITE-28819 Move HostAndPortRange to ignite-commons Relocate HostAndPortRange from ignite-core to ignite-commons so the thin client (ClientDiscoveryContext) can parse address ranges without depending on ignite-core. It depends only on IgniteCheckedException and F, both already in ignite-commons; its package org.apache.ignite.internal.util is preserved, so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../java/org/apache/ignite/internal/util/HostAndPortRange.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/HostAndPortRange.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/HostAndPortRange.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/HostAndPortRange.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/HostAndPortRange.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/HostAndPortRange.java From b52e2ddfa8684ae50b060de2d70161deb57b52cd Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 15:24:17 +0300 Subject: [PATCH 064/110] IGNITE-28819 Move client connector default port constants to CommonUtils Add DFLT_PORT (10800) and DFLT_PORT_RANGE (100) to ignite-commons CommonUtils so the thin client (ClientDiscoveryContext) can default its connection ports without depending on ignite-core. ClientConnectorConfiguration keeps its public DFLT_PORT / DFLT_PORT_RANGE constants, now proxying the CommonUtils values (still literal compile-time constants), so all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../java/org/apache/ignite/internal/util/CommonUtils.java | 6 ++++++ .../ignite/configuration/ClientConnectorConfiguration.java | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index 6e9e101a6e067..b550ff5440fed 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -2422,6 +2422,12 @@ public static T addSuppressed(T root, T err) { return root; } + /** Default client connector port. */ + public static final int DFLT_PORT = 10800; + + /** Default client connector port range. */ + public static final int DFLT_PORT_RANGE = 100; + /** * Gets absolute value for integer. If integer is {@link Integer#MIN_VALUE}, then {@code 0} is returned. * diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectorConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectorConfiguration.java index 8a993bcc5304d..9f5b62b25e729 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectorConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/ClientConnectorConfiguration.java @@ -19,6 +19,7 @@ import javax.cache.configuration.Factory; import javax.net.ssl.SSLContext; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.ssl.SslContextFactory; @@ -29,10 +30,10 @@ */ public class ClientConnectorConfiguration { /** Default port. */ - public static final int DFLT_PORT = 10800; + public static final int DFLT_PORT = CommonUtils.DFLT_PORT; /** Default port range. */ - public static final int DFLT_PORT_RANGE = 100; + public static final int DFLT_PORT_RANGE = CommonUtils.DFLT_PORT_RANGE; /** Default socket send and receive buffer size. */ public static final int DFLT_SOCK_BUF_SIZE = 0; From 33a65eefeb2475b6f0ec7091df6069f8b337908e Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 15:24:27 +0300 Subject: [PATCH 065/110] IGNITE-28819 Move ClientDiscoveryContext to ignite-thin-client-impl ClientDiscoveryContext now uses CommonUtils.DFLT_PORT / DFLT_PORT_RANGE and the relocated HostAndPortRange (both in ignite-commons) instead of ignite-core's ClientConnectorConfiguration, removing its last ignite-core dependency. Relocated to ignite-thin-client-impl; still shipped in ignite-core.jar via the shade. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/ClientDiscoveryContext.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientDiscoveryContext.java (97%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientDiscoveryContext.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientDiscoveryContext.java similarity index 97% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientDiscoveryContext.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientDiscoveryContext.java index 928c00349c860..b09a119d731ea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientDiscoveryContext.java +++ b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientDiscoveryContext.java @@ -37,8 +37,8 @@ import org.apache.ignite.client.ClientAddressFinder; import org.apache.ignite.client.ClientException; import org.apache.ignite.configuration.ClientConfiguration; -import org.apache.ignite.configuration.ClientConnectorConfiguration; import org.apache.ignite.internal.binary.BinaryReaderEx; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.HostAndPortRange; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.logger.NullLogger; @@ -231,8 +231,8 @@ private static Set> parsedAddresses(String[] addrs) thro try { ranges.add(HostAndPortRange.parse( a, - ClientConnectorConfiguration.DFLT_PORT, - ClientConnectorConfiguration.DFLT_PORT + ClientConnectorConfiguration.DFLT_PORT_RANGE, + CommonUtils.DFLT_PORT, + CommonUtils.DFLT_PORT + CommonUtils.DFLT_PORT_RANGE, "Failed to parse Ignite server address" )); } From d0d24a38adfed0bedc655b9a19afc24b622a7128 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 15:39:45 +0300 Subject: [PATCH 066/110] IGNITE-28819 Move IGNITE_DATA_CENTER_ID system property to IgniteCommonsSystemProperties Push the IGNITE_DATA_CENTER_ID system property (with its @IgniteExperimental / @SystemProperty annotations) up from ignite-core's IgniteSystemProperties to the ignite-commons parent IgniteCommonsSystemProperties, so the thin client (ReliableChannelImpl) can read it without depending on ignite-core. IgniteSystemProperties inherits it, so the ~20 existing IgniteSystemProperties.IGNITE_DATA_CENTER_ID call sites are unaffected. ReliableChannelImpl now uses IgniteCommonsSystemProperties.getString / IGNITE_DATA_CENTER_ID. This clears the IgniteSystemProperties blocker for ReliableChannelImpl; its remaining dependency is GridNioClientConnectionMultiplexer (the nio stack), so the class itself is not relocated yet. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/IgniteCommonsSystemProperties.java | 7 +++++++ .../java/org/apache/ignite/IgniteSystemProperties.java | 7 ------- .../ignite/internal/client/thin/ReliableChannelImpl.java | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java b/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java index 6aa8c01e95744..a5eaa0f603298 100644 --- a/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java +++ b/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java @@ -19,6 +19,7 @@ import java.io.Serializable; import org.apache.ignite.internal.util.GridLogThrottle; +import org.apache.ignite.lang.IgniteExperimental; import org.jetbrains.annotations.Nullable; import static org.apache.ignite.internal.util.CommonUtils.DFLT_MARSHAL_BUFFERS_PER_THREAD_POOL_SIZE; @@ -153,6 +154,12 @@ public class IgniteCommonsSystemProperties { "memory block is released. This will help to recognize cases when already released memory is accessed") public static final String IGNITE_OFFHEAP_SAFE_RELEASE = "IGNITE_OFFHEAP_SAFE_RELEASE"; + /** Human-readable ID of a data center where the node is running. */ + @IgniteExperimental + @SystemProperty(value = "Data Center ID where local node is running. Not required for a single Data Center deployments", + type = String.class) + public static final String IGNITE_DATA_CENTER_ID = "IGNITE_DATA_CENTER_ID"; + /** * @param enumCls Enum type. * @param name Name of the system property or environment variable. diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index b1c36a9015827..d2c1690e6ae08 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -41,7 +41,6 @@ import org.apache.ignite.internal.processors.query.schema.SchemaIndexCachePartitionWorker; import org.apache.ignite.internal.processors.rest.GridRestCommand; import org.apache.ignite.internal.util.IgniteUtils; -import org.apache.ignite.lang.IgniteExperimental; import org.apache.ignite.mxbean.MetricsMxBean; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.spi.metric.ReadOnlyMetricRegistry; @@ -744,12 +743,6 @@ public final class IgniteSystemProperties extends IgniteCommonsSystemProperties defaults = "" + DFLT_DISCOVERY_HISTORY_SIZE) public static final String IGNITE_DISCOVERY_HISTORY_SIZE = "IGNITE_DISCOVERY_HISTORY_SIZE"; - /** Human-readable ID of a data center where the node is running. */ - @IgniteExperimental - @SystemProperty(value = "Data Center ID where local node is running. Not required for a single Data Center deployments", - type = String.class) - public static final String IGNITE_DATA_CENTER_ID = "IGNITE_DATA_CENTER_ID"; - /** Maximum number of discovery message history used to support client reconnect. */ @SystemProperty(value = "Maximum number of discovery message history used to support client reconnect", type = Integer.class, defaults = "" + DFLT_DISCOVERY_CLIENT_RECONNECT_HISTORY_SIZE) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java index 931a9dfb772c3..b29bb69629fe3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java @@ -39,8 +39,8 @@ import java.util.function.Function; import java.util.stream.Collectors; import org.apache.ignite.IgniteBinary; +import org.apache.ignite.IgniteCommonsSystemProperties; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.client.ClientAuthenticationException; import org.apache.ignite.client.ClientConnectionException; import org.apache.ignite.client.ClientException; @@ -141,10 +141,10 @@ final class ReliableChannelImpl implements ReliableChannelEx { partitionAwarenessEnabled = clientCfg.isPartitionAwarenessEnabled(); - String dcId = IgniteSystemProperties.getString(IgniteSystemProperties.IGNITE_DATA_CENTER_ID); + String dcId = IgniteCommonsSystemProperties.getString(IgniteCommonsSystemProperties.IGNITE_DATA_CENTER_ID); if (dcId == null && !F.isEmpty(clientCfg.getUserAttributes())) - dcId = clientCfg.getUserAttributes().get(IgniteSystemProperties.IGNITE_DATA_CENTER_ID); + dcId = clientCfg.getUserAttributes().get(IgniteCommonsSystemProperties.IGNITE_DATA_CENTER_ID); affinityCtx = new ClientCacheAffinityContext( binary, From be476b347d9edee0e3066c0ca0f1eeb7b910d59a Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 16:02:02 +0300 Subject: [PATCH 067/110] IGNITE-28819 Split plugin handling out of MarshallerUtils.processSystemClasses PluginProvider must stay in ignite-core, but MarshallerUtils needs to move to ignite-binary-api. Extract the plugin-class-name handling (the only use of PluginProvider in processSystemClasses) into a private helper in MarshallerContextImpl, the sole caller that passes plugins. MarshallerUtils.processSystemClasses now takes only (ClassLoader, Consumer) and processResource is made public so the extracted helper can reuse it. The thin callers (TcpIgniteClient, JdbcThinConnection) previously passed null and now call the two-arg form. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/MarshallerContextImpl.java | 28 ++++++++++++++++++- .../internal/client/thin/TcpIgniteClient.java | 2 +- .../jdbc/thin/JdbcThinConnection.java | 2 +- .../ignite/marshaller/MarshallerUtils.java | 19 ++----------- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java index fda923e3596db..2521be22a8e93 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java @@ -19,10 +19,12 @@ import java.io.File; import java.io.IOException; +import java.net.URL; import java.util.AbstractMap; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -34,6 +36,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ExecutorService; import java.util.function.BiPredicate; +import java.util.function.Consumer; import java.util.function.Function; import javax.management.MBeanServer; import org.apache.ignite.IgniteCheckedException; @@ -125,7 +128,7 @@ public MarshallerContextImpl(@Nullable Collection plugins, Ignit try { ClassLoader ldr = U.gridClassLoader(); - MarshallerUtils.processSystemClasses(ldr, plugins, clsName -> { + processSystemClasses(ldr, plugins, clsName -> { int typeId = clsName.hashCode(); MappedName oldClsName; @@ -709,6 +712,29 @@ public void setMarshallerMappingFileStoreDir(@Nullable final File marshallerMapp this.marshallerMappingFileStoreDir = marshallerMappingFileStoreDir; } + /** + * Finds all system class names (JDK, Ignite and plugin classes) and processes them with the given consumer. + * + * @param ldr Class loader. + * @param plugins Plugins (may be {@code null}). + * @param proc Class processor (class name consumer). + * @throws IOException In case of error. + */ + private static void processSystemClasses(ClassLoader ldr, @Nullable Collection plugins, + Consumer proc) throws IOException { + MarshallerUtils.processSystemClasses(ldr, proc); + + if (plugins != null && !plugins.isEmpty()) { + for (PluginProvider plugin : plugins) { + Enumeration pluginUrls = ldr.getResources("META-INF/" + plugin.name().toLowerCase() + + ".classnames.properties"); + + while (pluginUrls.hasMoreElements()) + MarshallerUtils.processResource(pluginUrls.nextElement(), proc); + } + } + } + /** * */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java index b21eca8578160..30a0a084f05a3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java @@ -792,7 +792,7 @@ private class ClientMarshallerContext implements MarshallerContext { */ public ClientMarshallerContext() { try { - MarshallerUtils.processSystemClasses(U.gridClassLoader(), null, sysTypes::add); + MarshallerUtils.processSystemClasses(U.gridClassLoader(), sysTypes::add); } catch (IOException e) { throw new IllegalStateException("Failed to initialize marshaller context.", e); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java index 619057cd6ce9d..64e1fb2f45c03 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java @@ -2427,7 +2427,7 @@ private class JdbcMarshallerContext extends BlockingJdbcChannel implements Marsh */ public JdbcMarshallerContext() { try { - processSystemClasses(U.gridClassLoader(), null, sysTypes::add); + processSystemClasses(U.gridClassLoader(), sysTypes::add); } catch (IOException e) { throw new IgniteException("Unable to initialize marshaller context", e); diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java index 4d474aa826a46..d53d524e3cbca 100644 --- a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java @@ -26,7 +26,6 @@ import java.io.InputStreamReader; import java.io.ObjectInputFilter; import java.net.URL; -import java.util.Collection; import java.util.Enumeration; import java.util.Objects; import java.util.function.Consumer; @@ -34,8 +33,6 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.internal.ClassSet; -import org.apache.ignite.plugin.PluginProvider; -import org.jetbrains.annotations.Nullable; import static org.apache.ignite.IgniteSystemProperties.IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION; import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHALLER_BLACKLIST; @@ -197,11 +194,9 @@ private static void addClassNames( * Find all system class names (for JDK or Ignite classes) and process them with a given consumer. * * @param ldr Class loader. - * @param plugins Plugins. * @param proc Class processor (class name consumer). */ - public static void processSystemClasses(ClassLoader ldr, @Nullable Collection plugins, - Consumer proc) throws IOException { + public static void processSystemClasses(ClassLoader ldr, Consumer proc) throws IOException { Enumeration urls = ldr.getResources(CLS_NAMES_FILE); boolean foundClsNames = false; @@ -223,16 +218,6 @@ public static void processSystemClasses(ClassLoader ldr, @Nullable Collection proc) throws IOException { + public static void processResource(URL url, Consumer proc) throws IOException { try (BufferedReader rdr = new BufferedReader(new InputStreamReader(url.openStream()))) { String line; From f97fdf56ebe65366c76ae08cf731b798f2af473f Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 16:11:19 +0300 Subject: [PATCH 068/110] IGNITE-28819 Move marshaller system properties to IgniteCommonsSystemProperties Push IGNITE_MARSHALLER_WHITELIST, IGNITE_MARSHALLER_BLACKLIST and IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION (with their @SystemProperty annotations) up from ignite-core's IgniteSystemProperties to the ignite-commons parent IgniteCommonsSystemProperties, so MarshallerUtils can read them without depending on ignite-core. IgniteSystemProperties inherits them, so existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/IgniteCommonsSystemProperties.java | 25 +++++++++++++++++++ .../apache/ignite/IgniteSystemProperties.java | 25 ------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java b/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java index a5eaa0f603298..d424f23cfe735 100644 --- a/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java +++ b/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java @@ -160,6 +160,31 @@ public class IgniteCommonsSystemProperties { type = String.class) public static final String IGNITE_DATA_CENTER_ID = "IGNITE_DATA_CENTER_ID"; + /** Defines path to the file that contains list of classes allowed to safe deserialization.*/ + @SystemProperty(value = "Path to the file that contains list of classes allowed to safe deserialization", + type = String.class) + public static final String IGNITE_MARSHALLER_WHITELIST = "IGNITE_MARSHALLER_WHITELIST"; + + /** Defines path to the file that contains list of classes disallowed to safe deserialization.*/ + @SystemProperty(value = "Path to the file that contains list of classes disallowed to safe deserialization", + type = String.class) + public static final String IGNITE_MARSHALLER_BLACKLIST = "IGNITE_MARSHALLER_BLACKLIST"; + + /** + * If this parameter is set to true, Ignite will automatically configure an ObjectInputFilter instance for the + * current JVM it is running in. + * Default value is {@code true}. + */ + @SystemProperty( + value = "If this parameter is set to true, Ignite will automatically configure an ObjectInputFilter" + + " instance for the current JVM it is running in. Filtering is based on class lists defined by the" + + " `IGNITE_MARSHALLER_WHITELIST` and `IGNITE_MARSHALLER_BLACKLIST` system properties or their default values." + + " Disabling it is not recommended because the Ignite host may be vulnerable to RCE attacks based on Java" + + " serialization mechanisms", + defaults = "true" + ) + public static final String IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION = "IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION"; + /** * @param enumCls Enum type. * @param name Name of the system property or environment variable. diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index d2c1690e6ae08..18b3e0f86fb6c 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -807,31 +807,6 @@ public final class IgniteSystemProperties extends IgniteCommonsSystemProperties @SystemProperty("Enables local store keeps primary only. Backward compatibility flag") public static final String IGNITE_LOCAL_STORE_KEEPS_PRIMARY_ONLY = "IGNITE_LOCAL_STORE_KEEPS_PRIMARY_ONLY"; - /** Defines path to the file that contains list of classes allowed to safe deserialization.*/ - @SystemProperty(value = "Path to the file that contains list of classes allowed to safe deserialization", - type = String.class) - public static final String IGNITE_MARSHALLER_WHITELIST = "IGNITE_MARSHALLER_WHITELIST"; - - /** Defines path to the file that contains list of classes disallowed to safe deserialization.*/ - @SystemProperty(value = "Path to the file that contains list of classes disallowed to safe deserialization", - type = String.class) - public static final String IGNITE_MARSHALLER_BLACKLIST = "IGNITE_MARSHALLER_BLACKLIST"; - - /** - * If this parameter is set to true, Ignite will automatically configure an ObjectInputFilter instance for the - * current JVM it is running in. - * Default value is {@code true}. - */ - @SystemProperty( - value = "If this parameter is set to true, Ignite will automatically configure an ObjectInputFilter" + - " instance for the current JVM it is running in. Filtering is based on class lists defined by the" + - " `IGNITE_MARSHALLER_WHITELIST` and `IGNITE_MARSHALLER_BLACKLIST` system properties or their default values." + - " Disabling it is not recommended because the Ignite host may be vulnerable to RCE attacks based on Java" + - " serialization mechanisms", - defaults = "true" - ) - public static final String IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION = "IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION"; - /** * If set to {@code true}, then default selected keys set is used inside * {@code GridNioServer} which lead to some extra garbage generation when From ff2ff40761fa1c06b3b26a70515ca2af144f61b7 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 16:11:19 +0300 Subject: [PATCH 069/110] IGNITE-28819 Move ClassSet to ignite-commons Relocate the self-contained (pure-JDK) ClassSet from ignite-core to ignite-commons so MarshallerUtils and IgniteMarshallerClassFilter can use it from ignite-binary-api. Package org.apache.ignite.internal is preserved; all existing call sites are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/apache/ignite/internal/ClassSet.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/ClassSet.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/ClassSet.java b/modules/commons/src/main/java/org/apache/ignite/internal/ClassSet.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/ClassSet.java rename to modules/commons/src/main/java/org/apache/ignite/internal/ClassSet.java From fa750f18a444e1a0ed20c23a13416700558b9431 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 16:13:42 +0300 Subject: [PATCH 070/110] IGNITE-28819 Move MarshallerUtils and marshaller class filters to ignite-binary-api Relocate MarshallerUtils, IgniteMarshallerClassFilter and IgniteObjectInputFilter from ignite-core to ignite-binary-api (package org.apache.ignite.marshaller is preserved). MarshallerUtils now reads its system properties from IgniteCommonsSystemProperties and uses ClassSet from ignite-commons; the plugin-specific part of processSystemClasses stays in ignite-core's MarshallerContextImpl. This removes a MarshallerUtils blocker from the thin client implementation classes. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../marshaller/IgniteMarshallerClassFilter.java | 0 .../ignite/marshaller/IgniteObjectInputFilter.java | 0 .../apache/ignite/marshaller/MarshallerUtils.java | 12 ++++++------ 3 files changed, 6 insertions(+), 6 deletions(-) rename modules/{core => binary/api}/src/main/java/org/apache/ignite/marshaller/IgniteMarshallerClassFilter.java (100%) rename modules/{core => binary/api}/src/main/java/org/apache/ignite/marshaller/IgniteObjectInputFilter.java (100%) rename modules/{core => binary/api}/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java (93%) diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/IgniteMarshallerClassFilter.java b/modules/binary/api/src/main/java/org/apache/ignite/marshaller/IgniteMarshallerClassFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/marshaller/IgniteMarshallerClassFilter.java rename to modules/binary/api/src/main/java/org/apache/ignite/marshaller/IgniteMarshallerClassFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/IgniteObjectInputFilter.java b/modules/binary/api/src/main/java/org/apache/ignite/marshaller/IgniteObjectInputFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/marshaller/IgniteObjectInputFilter.java rename to modules/binary/api/src/main/java/org/apache/ignite/marshaller/IgniteObjectInputFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java b/modules/binary/api/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java similarity index 93% rename from modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java rename to modules/binary/api/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java index d53d524e3cbca..9248181aa0711 100644 --- a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java +++ b/modules/binary/api/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java @@ -30,12 +30,12 @@ import java.util.Objects; import java.util.function.Consumer; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.IgniteCommonsSystemProperties; import org.apache.ignite.IgniteException; -import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.internal.ClassSet; -import static org.apache.ignite.IgniteSystemProperties.IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION; -import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHALLER_BLACKLIST; +import static org.apache.ignite.IgniteCommonsSystemProperties.IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION; +import static org.apache.ignite.IgniteCommonsSystemProperties.IGNITE_MARSHALLER_BLACKLIST; /** * Utility marshaller methods. @@ -78,7 +78,7 @@ public static IgniteMarshallerClassFilter classNameFilter(ClassLoader clsLdr) th * @throws IgniteCheckedException if autoconfiguration failed. */ public static void autoconfigureObjectInputFilter(IgniteMarshallerClassFilter clsFilter) throws IgniteCheckedException { - if (!IgniteSystemProperties.getBoolean(IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION, true)) + if (!IgniteCommonsSystemProperties.getBoolean(IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION, true)) return; synchronized (MUX) { @@ -113,7 +113,7 @@ else if (objFilter instanceof IgniteObjectInputFilter) { private static ClassSet classWhiteList(ClassLoader clsLdr) throws IgniteCheckedException { ClassSet clsSet = null; - String fileName = IgniteSystemProperties.getString(IgniteSystemProperties.IGNITE_MARSHALLER_WHITELIST); + String fileName = IgniteCommonsSystemProperties.getString(IgniteCommonsSystemProperties.IGNITE_MARSHALLER_WHITELIST); if (fileName != null) { clsSet = new ClassSet(); @@ -136,7 +136,7 @@ private static ClassSet classBlackList(ClassLoader clsLdr) throws IgniteCheckedE addClassNames(DEFAULT_BLACKLIST_CLS_NAMES_FILE, clsSet, clsLdr); - String blackListFileName = IgniteSystemProperties.getString(IGNITE_MARSHALLER_BLACKLIST); + String blackListFileName = IgniteCommonsSystemProperties.getString(IGNITE_MARSHALLER_BLACKLIST); if (blackListFileName != null) addClassNames(blackListFileName, clsSet, clsLdr); From fd6d21010fdbecf3d326057890c9cdb3f22dc3f4 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 16:22:57 +0300 Subject: [PATCH 071/110] IGNITE-28819 Move PlatformServiceMethod to ignite-commons Relocate the self-contained (pure-JDK) PlatformServiceMethod annotation from ignite-core to ignite-commons (package org.apache.ignite.platform preserved), so ClientServicesImpl can use it without depending on ignite-core. Binary compatibility is preserved via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../java/org/apache/ignite/platform/PlatformServiceMethod.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/platform/PlatformServiceMethod.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/platform/PlatformServiceMethod.java b/modules/commons/src/main/java/org/apache/ignite/platform/PlatformServiceMethod.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/platform/PlatformServiceMethod.java rename to modules/commons/src/main/java/org/apache/ignite/platform/PlatformServiceMethod.java From 00b6cd213bc13e6b9c34bd03cdfff00c78ad07b4 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 16:22:57 +0300 Subject: [PATCH 072/110] IGNITE-28819 Repoint TcpIgniteClient from U to CommonUtils Replace the two ignite-core U (typedef.internal.U) calls in TcpIgniteClient with their ignite-commons CommonUtils equivalents: gridClassLoader() and forName(). forName's 3-arg convenience overload lives in IgniteUtils (it references Marshallers.USE_CACHE, which sits above ignite-commons), so the call now uses CommonUtils' 4-arg forName with Marshallers.USE_CACHE.get() explicitly. This removes the last direct ignite-core import blocker from TcpIgniteClient itself. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/client/thin/TcpIgniteClient.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java index 30a0a084f05a3..3aca5f9fde6b9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java @@ -71,9 +71,9 @@ import org.apache.ignite.internal.client.thin.io.ClientConnectionMultiplexer; import org.apache.ignite.internal.processors.platform.client.ClientStatus; import org.apache.ignite.internal.processors.platform.client.IgniteClientException; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.GridArgumentCheck; import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.logger.NullLogger; import org.apache.ignite.marshaller.MarshallerContext; @@ -792,7 +792,7 @@ private class ClientMarshallerContext implements MarshallerContext { */ public ClientMarshallerContext() { try { - MarshallerUtils.processSystemClasses(U.gridClassLoader(), sysTypes::add); + MarshallerUtils.processSystemClasses(CommonUtils.gridClassLoader(), sysTypes::add); } catch (IOException e) { throw new IllegalStateException("Failed to initialize marshaller context.", e); @@ -858,7 +858,8 @@ public ClientMarshallerContext() { @Override public Class getClass(int typeId, ClassLoader ldr) throws ClassNotFoundException, IgniteCheckedException { - return U.forName(getClassName(MarshallerPlatformIds.JAVA_ID, typeId), ldr, null); + return CommonUtils.forName(getClassName(MarshallerPlatformIds.JAVA_ID, typeId), ldr, null, + Marshallers.USE_CACHE.get()); } /** {@inheritDoc} */ From 756c68124837044c3f0ec8618d7565051eb115e4 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 16:32:36 +0300 Subject: [PATCH 073/110] IGNITE-28819 Move CacheEntryEventAdapter to ignite-commons Relocate the self-contained CacheEntryEventAdapter (depends only on the JCache javax.cache API, which ignite-commons already declares) from ignite-core to ignite-commons (package org.apache.ignite.cache.query preserved, alongside the existing AbstractContinuousQuery). This clears the only ignite-core blocker on the thin client's ClientCacheEntryListenerHandler. Binary compatibility is held via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../org/apache/ignite/cache/query/CacheEntryEventAdapter.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/cache/query/CacheEntryEventAdapter.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheEntryEventAdapter.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/CacheEntryEventAdapter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cache/query/CacheEntryEventAdapter.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/CacheEntryEventAdapter.java From 67c4d49508b14040c4cb4e79a120d11c7b43f62c Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 20:18:34 +0300 Subject: [PATCH 074/110] IGNITE-28819 Move IndexQuery stack to ignite-commons Relocate IndexQuery, IndexQueryCriterion (package org.apache.ignite.cache.query) and RangeIndexQueryCriterion, InIndexQueryCriterion (package org.apache.ignite.internal.cache.query) from ignite-core to ignite-commons. The stack is self-contained: IndexQuery extends Query (already in ignite-commons) and uses only commons typedefs (F, A) and IgniteBiPredicate; the criteria depend only on IndexQueryCriterion. This clears four of TcpClientCache's seven ignite-core blockers. Binary compatibility is preserved via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/apache/ignite/cache/query/IndexQuery.java | 0 .../java/org/apache/ignite/cache/query/IndexQueryCriterion.java | 0 .../apache/ignite/internal/cache/query/InIndexQueryCriterion.java | 0 .../ignite/internal/cache/query/RangeIndexQueryCriterion.java | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/cache/query/IndexQuery.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/cache/query/IndexQueryCriterion.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/cache/query/InIndexQueryCriterion.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/cache/query/RangeIndexQueryCriterion.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/IndexQuery.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/IndexQuery.java diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/IndexQueryCriterion.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/IndexQueryCriterion.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cache/query/IndexQueryCriterion.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/IndexQueryCriterion.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cache/query/InIndexQueryCriterion.java b/modules/commons/src/main/java/org/apache/ignite/internal/cache/query/InIndexQueryCriterion.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/cache/query/InIndexQueryCriterion.java rename to modules/commons/src/main/java/org/apache/ignite/internal/cache/query/InIndexQueryCriterion.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cache/query/RangeIndexQueryCriterion.java b/modules/commons/src/main/java/org/apache/ignite/internal/cache/query/RangeIndexQueryCriterion.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/cache/query/RangeIndexQueryCriterion.java rename to modules/commons/src/main/java/org/apache/ignite/internal/cache/query/RangeIndexQueryCriterion.java From 436c554c4ed62d3bdadfb051fb857f725093e2b9 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 20:52:30 +0300 Subject: [PATCH 075/110] IGNITE-28819 Move QueryUtils.typeName to CommonUtils Relocate the self-contained typeName(String) and typeName(Class) logic from ignite-core's QueryUtils to ignite-commons' CommonUtils (the Class overload's F.isEmpty check is inlined to avoid pulling in the F typedef). QueryUtils.typeName now delegates to CommonUtils.typeName, so the existing callers (TextQuery, IndexQueryReducer, tests) are unaffected. This lets SqlQuery derive its type name without depending on ignite-core's QueryUtils. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/util/CommonUtils.java | 58 +++++++++++++++++++ .../internal/processors/query/QueryUtils.java | 42 +------------- 2 files changed, 60 insertions(+), 40 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index b550ff5440fed..3591c0532b225 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -2522,4 +2522,62 @@ public static IgniteCheckedException cast(Throwable t) { ? (IgniteCheckedException)t : new IgniteCheckedException(t); } + + /** + * Gets type name by class name. + * + * @param clsName Class name. + * @return Type name. + */ + public static String typeName(String clsName) { + int genericStart = clsName.indexOf('`'); // .NET generic, not valid for Java class name. + + if (genericStart >= 0) + clsName = clsName.substring(0, genericStart); + + int pkgEnd = clsName.lastIndexOf('.'); + + if (pkgEnd >= 0 && pkgEnd < clsName.length() - 1) + clsName = clsName.substring(pkgEnd + 1); + + if (clsName.endsWith("[]")) + clsName = clsName.substring(0, clsName.length() - 2) + "_array"; + + int parentEnd = clsName.lastIndexOf('$'); + + if (parentEnd >= 0) + clsName = clsName.substring(parentEnd + 1); + + parentEnd = clsName.lastIndexOf('+'); // .NET parent + + if (parentEnd >= 0) + clsName = clsName.substring(parentEnd + 1); + + return clsName; + } + + /** + * Gets type name by class. + * + * @param cls Class. + * @return Type name. + */ + public static String typeName(Class cls) { + String typeName = cls.getSimpleName(); + + // To protect from failure on anonymous classes. + if (typeName.isEmpty()) { + String pkg = cls.getPackage().getName(); + + typeName = cls.getName().substring(pkg.length() + (pkg.isEmpty() ? 0 : 1)); + } + + if (cls.isArray()) { + assert typeName.endsWith("[]"); + + typeName = typeName.substring(0, typeName.length() - 2) + "_array"; + } + + return typeName; + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java index 332a7d1ab2780..21a16ba4d6151 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java @@ -1138,30 +1138,7 @@ public static boolean isSqlType(Class cls) { * @return Type name. */ public static String typeName(String clsName) { - int genericStart = clsName.indexOf('`'); // .NET generic, not valid for Java class name. - - if (genericStart >= 0) - clsName = clsName.substring(0, genericStart); - - int pkgEnd = clsName.lastIndexOf('.'); - - if (pkgEnd >= 0 && pkgEnd < clsName.length() - 1) - clsName = clsName.substring(pkgEnd + 1); - - if (clsName.endsWith("[]")) - clsName = clsName.substring(0, clsName.length() - 2) + "_array"; - - int parentEnd = clsName.lastIndexOf('$'); - - if (parentEnd >= 0) - clsName = clsName.substring(parentEnd + 1); - - parentEnd = clsName.lastIndexOf('+'); // .NET parent - - if (parentEnd >= 0) - clsName = clsName.substring(parentEnd + 1); - - return clsName; + return CommonUtils.typeName(clsName); } /** @@ -1171,22 +1148,7 @@ public static String typeName(String clsName) { * @return Type name. */ public static String typeName(Class cls) { - String typeName = cls.getSimpleName(); - - // To protect from failure on anonymous classes. - if (F.isEmpty(typeName)) { - String pkg = cls.getPackage().getName(); - - typeName = cls.getName().substring(pkg.length() + (pkg.isEmpty() ? 0 : 1)); - } - - if (cls.isArray()) { - assert typeName.endsWith("[]"); - - typeName = typeName.substring(0, typeName.length() - 2) + "_array"; - } - - return typeName; + return CommonUtils.typeName(cls); } /** From e5188c2b749ced0bc98ef39ed67ed4e7fa2056cc Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 20:55:33 +0300 Subject: [PATCH 076/110] IGNITE-28819 Move SqlQuery to ignite-commons Relocate SqlQuery from ignite-core to ignite-commons (package org.apache.ignite.cache.query preserved, alongside its Query superclass which already lives in ignite-commons). The javadoc-only IgniteCache import is dropped (the @see IgniteCache#query link remains as a cross-module reference), and the QueryUtils.typeName call is repointed to CommonUtils.typeName. This clears one of TcpClientCache's three remaining ignite-core blockers. Binary compatibility is preserved via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/apache/ignite/cache/query/SqlQuery.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/cache/query/SqlQuery.java (97%) diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlQuery.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/SqlQuery.java similarity index 97% rename from modules/core/src/main/java/org/apache/ignite/cache/query/SqlQuery.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/SqlQuery.java index 64864b3510406..b5b1f537c43bd 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlQuery.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/SqlQuery.java @@ -19,8 +19,6 @@ import java.util.concurrent.TimeUnit; import javax.cache.Cache; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.internal.processors.query.QueryUtils; import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.internal.A; @@ -209,7 +207,7 @@ public SqlQuery setTimeout(int timeout, TimeUnit timeUnit) { * @return {@code this} For chaining. */ public SqlQuery setType(Class type) { - return setType(QueryUtils.typeName(type)); + return setType(CommonUtils.typeName(type)); } /** From a1b76d7a5bddd532b4e80f9decfc6d9fcb98682e Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 21:22:26 +0300 Subject: [PATCH 077/110] IGNITE-28819 Move Message and UnknownMessageException to ignite-commons Relocate the Message interface (package org.apache.ignite.plugin.extensions.communication) and its sole non-commons dependency UnknownMessageException (package org.apache.ignite.internal.managers.communication) from ignite-core to ignite-commons. The pair is self-contained: both depend only on IgniteException (already in ignite-commons) and each other; Message's slim contract (directType/registerAsDirectType + REGISTRATIONS) references neither MessageReader/MessageWriter nor any other ignite-core type. Packages are preserved (becoming split packages across ignite-commons/ignite-core, as already done for org.apache.ignite.internal). This removes the Message blocker on GridCacheVersion. Binary compatibility is preserved via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../internal/managers/communication/UnknownMessageException.java | 0 .../apache/ignite/plugin/extensions/communication/Message.java | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/managers/communication/UnknownMessageException.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/plugin/extensions/communication/Message.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/UnknownMessageException.java b/modules/commons/src/main/java/org/apache/ignite/internal/managers/communication/UnknownMessageException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/managers/communication/UnknownMessageException.java rename to modules/commons/src/main/java/org/apache/ignite/internal/managers/communication/UnknownMessageException.java diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/Message.java b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/Message.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/Message.java rename to modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/Message.java From 0c5aab019da5292542f64d9354d91c54689fcf37 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 21:38:32 +0300 Subject: [PATCH 078/110] IGNITE-28819 Move Order annotation to ignite-commons Relocate the @Order direct-marshalling annotation from ignite-codegen to ignite-commons (package org.apache.ignite.internal preserved). ignite-codegen already depends on ignite-commons, so its annotation processor and the six codegen classes that reference @Order continue to resolve it; adding a codegen dependency to ignite-commons would instead have created a cycle. This lets commons-resident messages (e.g. GridCacheVersion) carry @Order field annotations. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/apache/ignite/internal/Order.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{codegen => commons}/src/main/java/org/apache/ignite/internal/Order.java (100%) diff --git a/modules/codegen/src/main/java/org/apache/ignite/internal/Order.java b/modules/commons/src/main/java/org/apache/ignite/internal/Order.java similarity index 100% rename from modules/codegen/src/main/java/org/apache/ignite/internal/Order.java rename to modules/commons/src/main/java/org/apache/ignite/internal/Order.java From 3bb68fb96a4ccb3f75b099ec8c70dec4b32bde66 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 21:38:32 +0300 Subject: [PATCH 079/110] IGNITE-28819 Move CacheEntryVersion to ignite-commons Relocate the CacheEntryVersion interface (extends only Comparable + Serializable) from ignite-core to ignite-commons (package org.apache.ignite.cache preserved). Its three ignite-core imports (CacheConflictResolutionManager, IgniteInternalCache, GridCacheVersionManager) were javadoc-only @see/@link references and are dropped; the links remain as dangling cross-module references (doclint disabled). This is a prerequisite for moving GridCacheVersion, which implements CacheEntryVersion. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../main/java/org/apache/ignite/cache/CacheEntryVersion.java | 3 --- 1 file changed, 3 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/cache/CacheEntryVersion.java (91%) diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheEntryVersion.java b/modules/commons/src/main/java/org/apache/ignite/cache/CacheEntryVersion.java similarity index 91% rename from modules/core/src/main/java/org/apache/ignite/cache/CacheEntryVersion.java rename to modules/commons/src/main/java/org/apache/ignite/cache/CacheEntryVersion.java index 0953740f957c2..ca8eeca2ccf43 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/CacheEntryVersion.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/CacheEntryVersion.java @@ -19,9 +19,6 @@ import java.io.Serializable; import java.util.Map; -import org.apache.ignite.internal.processors.cache.CacheConflictResolutionManager; -import org.apache.ignite.internal.processors.cache.IgniteInternalCache; -import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager; /** * Entry event order. From 75c48dca9b98c2c4493cf1b8ddf756e053e02661 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Mon, 29 Jun 2026 21:43:54 +0300 Subject: [PATCH 080/110] IGNITE-28819 Move GridCacheVersion to ignite-commons; extract asIgniteUuid to BinaryUtils GridCacheVersion's only ignite-binary-api dependency was IgniteUuid, used solely by its asIgniteUuid() method. Extract that logic into a static BinaryUtils.asIgniteUuid(GridCacheVersion) in ignite-binary-api (which already holds IgniteUuid), reading the version via its public accessors (topologyVersion/nodeOrderAndDrIdRaw/order), and repoint all ~25 call sites to it. With asIgniteUuid (and the IgniteUuid/UUID imports) gone, GridCacheVersion depends only on ignite-commons types (CacheEntryVersion, Order, Message), so it moves from ignite-core to ignite-commons (package preserved). This clears GridCacheVersion as a TcpClientCache blocker. Binary compatibility is preserved via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/binary/BinaryUtils.java | 11 ++++++++++ .../cache/version/GridCacheVersion.java | 9 -------- ...ndHandlerCheckIncrementalSnapshotTest.java | 11 +++++----- .../tx/FetchNearXidVersionTask.java | 3 ++- .../ignite/internal/management/tx/TxTask.java | 7 +++--- .../distributed/dht/GridDhtLockFuture.java | 5 +++-- .../cache/transactions/IgniteTxAdapter.java | 3 ++- .../IncrementalSnapshotJoiningClientTest.java | 3 ++- .../IncrementalSnapshotRestoreTest.java | 3 ++- .../TxPartitionCounterStateAbstractTest.java | 22 ++++++++++--------- ...onCounterStateOnePrimaryOneBackupTest.java | 3 ++- 11 files changed, 46 insertions(+), 34 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java (96%) diff --git a/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index bbf642108042b..fcbd74fe0c550 100644 --- a/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -79,6 +79,7 @@ import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.internal.binary.streams.BinaryInputStream; import org.apache.ignite.internal.binary.streams.BinaryOutputStream; +import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.MutableSingletonList; import org.apache.ignite.internal.util.typedef.F; @@ -3283,4 +3284,14 @@ public void clearAllListener() { listeners.clear(); } } + + /** + * Represents the given cache version as an {@link IgniteUuid}. + * + * @param ver Cache version. + * @return Version represented as {@code IgniteUuid}. + */ + public static IgniteUuid asIgniteUuid(GridCacheVersion ver) { + return new IgniteUuid(new UUID(ver.topologyVersion(), ver.nodeOrderAndDrIdRaw()), ver.order()); + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java similarity index 96% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java index d5abdd43f4084..65ac206d5b3f1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java @@ -21,10 +21,8 @@ import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.util.UUID; import org.apache.ignite.cache.CacheEntryVersion; import org.apache.ignite.internal.Order; -import org.apache.ignite.lang.IgniteUuid; import org.apache.ignite.plugin.extensions.communication.Message; /** @@ -173,13 +171,6 @@ public boolean isLess(GridCacheVersion ver) { return compareTo(ver) < 0; } - /** - * @return Version represented as {@code IgniteUuid} - */ - public IgniteUuid asIgniteUuid() { - return new IgniteUuid(new UUID(topVer, nodeOrderDrId), order); - } - /** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(topVer); diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIncrementalSnapshotTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIncrementalSnapshotTest.java index 21fe7d4091304..766d312dbcdaa 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIncrementalSnapshotTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIncrementalSnapshotTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.TestRecordingCommunicationSpi; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.management.cache.IdleVerifyResult; import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager; import org.apache.ignite.internal.pagemem.wal.record.DataRecord; @@ -223,7 +224,7 @@ public void testSecondSnapshotCorrupted() { load(xid -> { if (skipTxRec == null) { skipTxRec = (consId, rec) -> - grid(0).localNode().consistentId().equals(consId) && xid.equals(rec.nearXidVersion().asIgniteUuid()); + grid(0).localNode().consistentId().equals(consId) && xid.equals(BinaryUtils.asIgniteUuid(rec.nearXidVersion())); } }); @@ -248,7 +249,7 @@ public void testSecondSnapshotCorrupted() { load(xid -> { if (skipTxRec == null) { skipTxRec = (consId, rec) -> - grid(0).localNode().consistentId().equals(consId) && xid.equals(rec.nearXidVersion().asIgniteUuid()); + grid(0).localNode().consistentId().equals(consId) && xid.equals(BinaryUtils.asIgniteUuid(rec.nearXidVersion())); } }); @@ -308,7 +309,7 @@ public void testSecondSnapshotCorrupted() { if (skipDataRec == null) { skipDataRec = (consId, rec) -> grid(0).localNode().consistentId().equals(consId) - && xid.equals(rec.writeEntries().get(0).nearXidVersion().asIgniteUuid()); + && xid.equals(BinaryUtils.asIgniteUuid(rec.writeEntries().get(0).nearXidVersion())); } }); @@ -325,14 +326,14 @@ public void testSecondSnapshotCorrupted() { if (skipDataRec == null) { skipDataRec = (consId, rec) -> grid(0).localNode().consistentId().equals(consId) - && xid.equals(rec.writeEntries().get(0).nearXidVersion().asIgniteUuid()); + && xid.equals(BinaryUtils.asIgniteUuid(rec.writeEntries().get(0).nearXidVersion())); return; } if (skipTxRec == null) { skipTxRec = (consId, rec) -> - grid(0).localNode().consistentId().equals(consId) && xid.equals(rec.nearXidVersion().asIgniteUuid()); + grid(0).localNode().consistentId().equals(consId) && xid.equals(BinaryUtils.asIgniteUuid(rec.nearXidVersion())); } }); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/management/tx/FetchNearXidVersionTask.java b/modules/core/src/main/java/org/apache/ignite/internal/management/tx/FetchNearXidVersionTask.java index 519dd55a7564d..7845fbf89982f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/management/tx/FetchNearXidVersionTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/management/tx/FetchNearXidVersionTask.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.compute.ComputeJobResult; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx; import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; @@ -78,7 +79,7 @@ public FetchNearXidVersionJob(TxInfoCommandArg arg, boolean debug) { for (IgniteInternalTx tx : transactions) { if (tx.xid().equals(arg.uuid()) || - tx.nearXidVersion().asIgniteUuid().equals(arg.uuid()) || + BinaryUtils.asIgniteUuid(tx.nearXidVersion()).equals(arg.uuid()) || tx.xidVersion().equals(arg.gridCacheVersion()) || tx.nearXidVersion().equals(arg.gridCacheVersion())) return tx.nearXidVersion(); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/management/tx/TxTask.java b/modules/core/src/main/java/org/apache/ignite/internal/management/tx/TxTask.java index ffd7a6a31ab98..4e07c6525f02c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/management/tx/TxTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/management/tx/TxTask.java @@ -38,6 +38,7 @@ import org.apache.ignite.compute.ComputeJobResult; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.management.tx.TxCommand.AbstractTxCommandArg; import org.apache.ignite.internal.managers.discovery.DiscoCache; import org.apache.ignite.internal.processors.cache.GridCacheContext; @@ -351,7 +352,7 @@ else if (locTx instanceof GridDhtTxRemote) { infos.add(new TxInfo(locTx.xid(), locTx.startTime(), duration, locTx.isolation(), locTx.concurrency(), locTx.timeout(), lb, mappings, locTx.state(), size, - locTx.nearXidVersion().asIgniteUuid(), locTx.masterNodeIds(), locTx.topologyVersionSnapshot(), + BinaryUtils.asIgniteUuid(locTx.nearXidVersion()), locTx.masterNodeIds(), locTx.topologyVersionSnapshot(), verboseInfo)); if (arg.kill()) @@ -367,9 +368,9 @@ else if (locTx instanceof GridDhtTxRemote) { if (completed != null) { if (Boolean.TRUE.equals(completed)) - infos.add(new TxInfo(infoArg.gridCacheVersion().asIgniteUuid(), COMMITTED)); + infos.add(new TxInfo(BinaryUtils.asIgniteUuid(infoArg.gridCacheVersion()), COMMITTED)); else if (Boolean.FALSE.equals(completed)) - infos.add(new TxInfo(infoArg.gridCacheVersion().asIgniteUuid(), ROLLED_BACK)); + infos.add(new TxInfo(BinaryUtils.asIgniteUuid(infoArg.gridCacheVersion()), ROLLED_BACK)); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java index fef43785bef3a..91d018e4c530f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java @@ -34,6 +34,7 @@ import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.NodeStoppingException; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.CacheLockCandidates; @@ -1219,7 +1220,7 @@ private String dumpPendingLocks() { sb.append("Transaction tx=").append(tx.getClass().getSimpleName()); sb.append(" [xid=").append(tx.xid()); sb.append(", xidVer=").append(tx.xidVersion()); - sb.append(", nearXid=").append(tx.nearXidVersion().asIgniteUuid()); + sb.append(", nearXid=").append(BinaryUtils.asIgniteUuid(tx.nearXidVersion())); sb.append(", nearXidVer=").append(tx.nearXidVersion()); sb.append(", nearNodeId=").append(tx.nearNodeId()); sb.append(", label=").append(tx.label()); @@ -1245,7 +1246,7 @@ private String dumpPendingLocks() { sb.append("key=").append(key).append(", owner="); sb.append("[xid=").append(itx.xid()).append(", "); sb.append("xidVer=").append(itx.xidVersion()).append(", "); - sb.append("nearXid=").append(itx.nearXidVersion().asIgniteUuid()).append(", "); + sb.append("nearXid=").append(BinaryUtils.asIgniteUuid(itx.nearXidVersion())).append(", "); sb.append("nearXidVer=").append(itx.nearXidVersion()).append(", "); sb.append("label=").append(itx.label()).append(", "); sb.append("nearNodeId=").append(candidate.otherNodeId()).append("]"); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java index 193eb2a4e8ae0..c9a8890dbae62 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java @@ -41,6 +41,7 @@ import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.events.TransactionStateChangedEvent; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.managers.discovery.ConsistentIdMapper; import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; @@ -693,7 +694,7 @@ public boolean remote() { /** {@inheritDoc} */ @Override public IgniteUuid xid() { - return xidVer.asIgniteUuid(); + return BinaryUtils.asIgniteUuid(xidVer); } /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotJoiningClientTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotJoiningClientTest.java index fd42dc16fbf41..d40a168677626 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotJoiningClientTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotJoiningClientTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.TestRecordingCommunicationSpi; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.pagemem.wal.WALIterator; import org.apache.ignite.internal.pagemem.wal.record.IncrementalSnapshotFinishRecord; import org.apache.ignite.internal.pagemem.wal.record.WALRecord; @@ -183,7 +184,7 @@ private boolean transactionExcluded(int nodeIdx, IgniteUuid txId) throws Excepti if (rec.type() == WALRecord.RecordType.INCREMENTAL_SNAPSHOT_FINISH_RECORD) { IncrementalSnapshotFinishRecord finRec = (IncrementalSnapshotFinishRecord)rec; - assertTrue(finRec.excluded().stream().anyMatch(id -> id.asIgniteUuid().equals(txId))); + assertTrue(finRec.excluded().stream().anyMatch(id -> BinaryUtils.asIgniteUuid(id).equals(txId))); return true; } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotRestoreTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotRestoreTest.java index 5cad5b48d5cd3..d6553f9fa3d39 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotRestoreTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotRestoreTest.java @@ -53,6 +53,7 @@ import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.TestRecordingCommunicationSpi; import org.apache.ignite.internal.binary.BinaryContext; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.management.consistency.ConsistencyRepairCommandArg; import org.apache.ignite.internal.management.consistency.ConsistencyRepairTask; import org.apache.ignite.internal.management.consistency.ConsistencyTaskResult; @@ -675,7 +676,7 @@ public void testNoGapsInCountersAfterRestore() throws Exception { for (int n = 1; n < nodes(); n++) { TestRecordingCommunicationSpi.spi(grid(n)).blockMessages((node, msg) -> msg instanceof GridNearTxPrepareResponse - && ((GridNearTxPrepareResponse)msg).version().asIgniteUuid().equals(exclTxId.get())); + && BinaryUtils.asIgniteUuid(((GridNearTxPrepareResponse)msg).version()).equals(exclTxId.get())); } msgBlkSet.countDown(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateAbstractTest.java index 65ef7afee2c40..232cef9e2a346 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateAbstractTest.java @@ -45,6 +45,7 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgnitionEx; import org.apache.ignite.internal.TestRecordingCommunicationSpi; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.processors.cache.PartitionUpdateCounter; import org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryRequest; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishRequest; @@ -313,7 +314,7 @@ protected Map>> runOnPartition( futMap.put(req.futureId(), req.version()); - return cb.beforePrimaryPrepare(to, req.version().asIgniteUuid(), createSendFuture(clientWrappedSpi, msg)); + return cb.beforePrimaryPrepare(to, BinaryUtils.asIgniteUuid(req.version()), createSendFuture(clientWrappedSpi, msg)); } else if (msg instanceof GridNearTxFinishRequest) { IgniteEx to = IgnitionEx.gridxx(node.id()); @@ -440,7 +441,8 @@ else if (msg instanceof GridDhtTxFinishRequest) { IgniteInternalTx primTx = findTx(from, nearVer, true); IgniteInternalTx backupTx = findTx(to, nearVer, false); - return cb.beforeBackupFinish(from, to, primTx, backupTx, nearVer.asIgniteUuid(), createSendFuture(wrappedPrimSpi, msg)); + return cb.beforeBackupFinish(from, to, primTx, backupTx, BinaryUtils.asIgniteUuid(nearVer), + createSendFuture(wrappedPrimSpi, msg)); } else if (msg instanceof GridNearTxPrepareResponse) { GridNearTxPrepareResponse resp = (GridNearTxPrepareResponse)msg; @@ -451,7 +453,7 @@ else if (msg instanceof GridNearTxPrepareResponse) { IgniteInternalTx primTx = findTx(from, ver, true); - return cb.afterPrimaryPrepare(from, primTx, ver.asIgniteUuid(), createSendFuture(wrappedPrimSpi, msg)); + return cb.afterPrimaryPrepare(from, primTx, BinaryUtils.asIgniteUuid(ver), createSendFuture(wrappedPrimSpi, msg)); } else if (msg instanceof GridNearTxFinishResponse) { IgniteEx to = IgnitionEx.gridxx(node.id()); @@ -460,7 +462,7 @@ else if (msg instanceof GridNearTxFinishResponse) { IgniteEx from = fromNode(wrappedPrimSpi); - IgniteUuid nearVer = futMap.get(req.futureId()).asIgniteUuid(); + IgniteUuid nearVer = BinaryUtils.asIgniteUuid(futMap.get(req.futureId())); return cb.afterPrimaryFinish(from, nearVer, createSendFuture(wrappedPrimSpi, msg)); } @@ -490,7 +492,7 @@ private IgniteBiPredicate createBackupMessagePredicate(Tes IgniteInternalTx backupTx = findTx(from, ver, false); - return cb.afterBackupPrepare(to, from, backupTx, ver.asIgniteUuid(), createSendFuture(wrappedBackupSpi, msg)); + return cb.afterBackupPrepare(to, from, backupTx, BinaryUtils.asIgniteUuid(ver), createSendFuture(wrappedBackupSpi, msg)); } else if (msg instanceof GridDhtTxFinishResponse) { IgniteEx from = fromNode(wrappedBackupSpi); @@ -504,7 +506,7 @@ else if (msg instanceof GridDhtTxFinishResponse) { return false; // Message from parallel partition. // Version is null if message is a response to checkCommittedRequest. - return cb.afterBackupFinish(to, from, ver.asIgniteUuid(), createSendFuture(wrappedBackupSpi, msg)); + return cb.afterBackupFinish(to, from, BinaryUtils.asIgniteUuid(ver), createSendFuture(wrappedBackupSpi, msg)); } return false; @@ -973,7 +975,7 @@ private long countForNode(IgniteEx node, TxState state) { return false; runAsync(() -> { - futures.put(new T3<>(primary, TxState.COMMIT, tx.nearXidVersion().asIgniteUuid()), proceedFut); + futures.put(new T3<>(primary, TxState.COMMIT, BinaryUtils.asIgniteUuid(tx.nearXidVersion())), proceedFut); if (countForNode(primary, TxState.COMMIT) == txCnt) futures.remove(new T3<>(primary, TxState.COMMIT, version(commits.get(primary).poll()))).onDone(); @@ -993,11 +995,11 @@ private long countForNode(IgniteEx node, TxState state) { runAsync(() -> { if (assigns.get(primary) != null) { - int v0 = assignCntr.compute(new T2<>(primary, primaryTx.nearXidVersion().asIgniteUuid()), + int v0 = assignCntr.compute(new T2<>(primary, BinaryUtils.asIgniteUuid(primaryTx.nearXidVersion())), (key, val) -> (val == null ? 0 : val) + 1); if (v0 == 2) { - onCounterAssigned(primary, primaryTx, order(primaryTx.nearXidVersion().asIgniteUuid())); + onCounterAssigned(primary, primaryTx, order(BinaryUtils.asIgniteUuid(primaryTx.nearXidVersion()))); if (!assigns.get(primary).isEmpty()) futures.remove(new T3<>(primary, TxState.ASSIGN, @@ -1006,7 +1008,7 @@ private long countForNode(IgniteEx node, TxState state) { } if (prepares.get(backup) != null) { - futures.put(new T3<>(backup, TxState.PREPARE, primaryTx.nearXidVersion().asIgniteUuid()), proceedFut); + futures.put(new T3<>(backup, TxState.PREPARE, BinaryUtils.asIgniteUuid(primaryTx.nearXidVersion())), proceedFut); // Wait until all prep requests queued and force prepare order. if (countForNode(backup, TxState.PREPARE) == txCnt) { diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateOnePrimaryOneBackupTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateOnePrimaryOneBackupTest.java index cab77867215c0..219f188ded00c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateOnePrimaryOneBackupTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateOnePrimaryOneBackupTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.TestRecordingCommunicationSpi; +import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.processors.cache.PartitionUpdateCounter; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage; import org.apache.ignite.internal.util.future.GridFutureAdapter; @@ -348,7 +349,7 @@ protected void onAllBackupCommitted(IgniteEx backup) { @Override public boolean beforeBackupPrepare(IgniteEx primary, IgniteEx backup, IgniteInternalTx primaryTx, GridFutureAdapter proceedFut) { runAsync(() -> { - IgniteUuid nearXidVer = primaryTx.nearXidVersion().asIgniteUuid(); + IgniteUuid nearXidVer = BinaryUtils.asIgniteUuid(primaryTx.nearXidVersion()); onPrimaryPrepared(primary, primaryTx, order(nearXidVer)); From 26963bc53d0acb3bb41de52a0e43272f6adee5a5 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 00:42:15 +0300 Subject: [PATCH 081/110] IGNITE-28819 Move CacheInvokeResult to ignite-commons CacheInvokeResult's only ignite-binary-api dependency was UnregisteredBinaryTypeException, referenced by CacheInvokeResult.get() to decide whether to rethrow the stored error as-is or wrap it in an EntryProcessorException. Move that wrap/unwrap decision to the creation site: a new GridCacheUtils.prepareEntryProcessorError(Throwable) keeps an UnregisteredClass/ UnregisteredBinaryTypeException or an existing EntryProcessorException unchanged and wraps anything else in an EntryProcessorException. The three ignite-core fromError call sites (GridCacheReturn x2, GridDhtAtomicCache) now pass the prepared exception; TcpClientCache already passes an EntryProcessorException, so it is unaffected. get() simply rethrows the prepared (RuntimeException) error. With its UnregisteredBinaryTypeException / UnregisteredClassException / IgniteException references gone, CacheInvokeResult depends only on ignite-commons types and moves from ignite-core to ignite-commons (package preserved). This clears the last ignite-core blocker on TcpClientCache. Binary compatibility is preserved via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../processors/cache/CacheInvokeResult.java | 19 +++++---------- .../processors/cache/GridCacheReturn.java | 5 ++-- .../processors/cache/GridCacheUtils.java | 23 +++++++++++++++++++ .../dht/atomic/GridDhtAtomicCache.java | 2 +- 4 files changed, 33 insertions(+), 16 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeResult.java (83%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeResult.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeResult.java similarity index 83% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeResult.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeResult.java index 23605aabe2fff..d1d25efc6bc1d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeResult.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeResult.java @@ -25,9 +25,6 @@ import javax.cache.processor.EntryProcessorException; import javax.cache.processor.EntryProcessorResult; import javax.cache.processor.MutableEntry; -import org.apache.ignite.IgniteException; -import org.apache.ignite.internal.UnregisteredBinaryTypeException; -import org.apache.ignite.internal.UnregisteredClassException; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.internal.S; @@ -83,7 +80,10 @@ public Throwable error() { /** * Static constructor. * - * @param err Exception thrown by {@link EntryProcessor#process(MutableEntry, Object...)}. + * @param err Prepared exception to be rethrown as-is by {@link #get()}. For an error thrown by + * {@link EntryProcessor#process(MutableEntry, Object...)}, prepare it at the creation site first + * (e.g. via {@code GridCacheUtils.prepareEntryProcessorError}) so that it is an + * {@link EntryProcessorException} or another exception that must propagate unwrapped. * @return New instance. */ public static CacheInvokeResult fromError(Throwable err) { @@ -98,15 +98,8 @@ public static CacheInvokeResult fromError(Throwable err) { /** {@inheritDoc} */ @Override public T get() throws EntryProcessorException { - if (err != null) { - if (err instanceof UnregisteredClassException || err instanceof UnregisteredBinaryTypeException) - throw (IgniteException)err; - - if (err instanceof EntryProcessorException) - throw (EntryProcessorException)err; - - throw new EntryProcessorException(err); - } + if (err != null) + throw (RuntimeException)err; return res; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 7c78a10a5cf48..b18f4ddef15b7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -259,7 +259,8 @@ else if (err instanceof UnregisteredBinaryTypeException) throw (UnregisteredBinaryTypeException)err; } - CacheInvokeResult res0 = err == null ? CacheInvokeResult.fromResult(res) : CacheInvokeResult.fromError(err); + CacheInvokeResult res0 = err == null ? CacheInvokeResult.fromResult(res) + : CacheInvokeResult.fromError(CU.prepareEntryProcessorError(err)); Object resKey = key0 != null ? key0 : ((keepBinary && key instanceof BinaryObject) ? key : CU.value(key, cctx, true)); @@ -367,7 +368,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult res0 = res.error() == null ? CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false, null)) : - CacheInvokeResult.fromError(res.error()); + CacheInvokeResult.fromError(CU.prepareEntryProcessorError(res.error())); map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false, null), res0); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java index 924bfd3db6d34..ca13b67f54110 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java @@ -41,6 +41,7 @@ import javax.cache.integration.CacheLoader; import javax.cache.integration.CacheWriter; import javax.cache.integration.CacheWriterException; +import javax.cache.processor.EntryProcessorException; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; @@ -65,6 +66,8 @@ import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteNodeAttributes; +import org.apache.ignite.internal.UnregisteredBinaryTypeException; +import org.apache.ignite.internal.UnregisteredClassException; import org.apache.ignite.internal.cluster.ClusterGroupEmptyCheckedException; import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException; @@ -2203,6 +2206,26 @@ public static Map affinityFields(@Nullable IgniteConfiguration c return affFields; } + /** + * Prepares an entry processor error so it can be stored in a {@link CacheInvokeResult} and rethrown + * as-is by {@link CacheInvokeResult#get()}: an {@link UnregisteredClassException} or + * {@link UnregisteredBinaryTypeException} (which must propagate unwrapped) and an existing + * {@link EntryProcessorException} are returned unchanged; any other error is wrapped in an + * {@link EntryProcessorException}. + * + * @param err Error thrown by the entry processor. + * @return Prepared error to store in the cache invoke result. + */ + public static Throwable prepareEntryProcessorError(Throwable err) { + if (err instanceof UnregisteredClassException || err instanceof UnregisteredBinaryTypeException) + return err; + + if (err instanceof EntryProcessorException) + return err; + + return new EntryProcessorException(err); + } + /** * */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index a214cba09be4e..44b463f923bec 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -2236,7 +2236,7 @@ private void updateWithBatch( throw e; } catch (Exception e) { - curInvokeRes = CacheInvokeResult.fromError(e); + curInvokeRes = CacheInvokeResult.fromError(CU.prepareEntryProcessorError(e)); updated = old; From 20d1b052d582e4ad20155e3a1c2674f1f60a1483 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 01:07:54 +0300 Subject: [PATCH 082/110] IGNITE-28819 Scaffold ignite-nio module Add a new ignite-nio module to host the generic NIO engine that will be split out of ignite-core so the thin client implementation can use it without depending on ignite-core. The module is layered ignite-commons(+unsafe) < ignite-nio < {ignite-core, ignite-thin-client-impl}; ignite-core depends on it and bundles it via maven-shade into ignite-core.jar (mirroring ignite-commons / ignite-binary-api / ignite-thin-client-impl), and it is excluded from the binary assemblies for the same reason. The module is empty in this commit (no behavior change); subsequent commits relocate the util.nio engine into it. Co-Authored-By: Claude Opus 4.8 (1M context) --- assembly/dependencies-apache-ignite-lgpl.xml | 1 + assembly/dependencies-apache-ignite-slim.xml | 1 + assembly/dependencies-apache-ignite.xml | 1 + modules/bom/pom.xml | 5 ++ modules/core/pom.xml | 7 +++ modules/nio/pom.xml | 63 ++++++++++++++++++++ pom.xml | 1 + 7 files changed, 79 insertions(+) create mode 100644 modules/nio/pom.xml diff --git a/assembly/dependencies-apache-ignite-lgpl.xml b/assembly/dependencies-apache-ignite-lgpl.xml index 6a12956482793..b6df36f14c7b6 100644 --- a/assembly/dependencies-apache-ignite-lgpl.xml +++ b/assembly/dependencies-apache-ignite-lgpl.xml @@ -120,6 +120,7 @@ ${project.groupId}:ignite-binary-impl ${project.groupId}:ignite-thin-client-api ${project.groupId}:ignite-thin-client-impl + ${project.groupId}:ignite-nio ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/assembly/dependencies-apache-ignite-slim.xml b/assembly/dependencies-apache-ignite-slim.xml index 537d5c55beae4..7f71529afe68a 100644 --- a/assembly/dependencies-apache-ignite-slim.xml +++ b/assembly/dependencies-apache-ignite-slim.xml @@ -120,6 +120,7 @@ ${project.groupId}:ignite-binary-impl ${project.groupId}:ignite-thin-client-api ${project.groupId}:ignite-thin-client-impl + ${project.groupId}:ignite-nio ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/assembly/dependencies-apache-ignite.xml b/assembly/dependencies-apache-ignite.xml index 208fbe8eda207..972c88a0cd57f 100644 --- a/assembly/dependencies-apache-ignite.xml +++ b/assembly/dependencies-apache-ignite.xml @@ -121,6 +121,7 @@ ${project.groupId}:ignite-binary-impl ${project.groupId}:ignite-thin-client-api ${project.groupId}:ignite-thin-client-impl + ${project.groupId}:ignite-nio ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/modules/bom/pom.xml b/modules/bom/pom.xml index 865b97ca23582..b365dac618718 100644 --- a/modules/bom/pom.xml +++ b/modules/bom/pom.xml @@ -191,6 +191,11 @@ ignite-thin-client-impl ${revision}
+ + ${project.groupId} + ignite-nio + ${revision} + ${project.groupId} ignite-codegen diff --git a/modules/core/pom.xml b/modules/core/pom.xml index b4202baf9728f..34eefdae4eceb 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -87,6 +87,12 @@ compile + + ${project.groupId} + ignite-nio + compile + + ${project.groupId} ignite-codegen @@ -367,6 +373,7 @@ ${project.groupId}:ignite-grid-unsafe ${project.groupId}:ignite-thin-client-api ${project.groupId}:ignite-thin-client-impl + ${project.groupId}:ignite-nio diff --git a/modules/nio/pom.xml b/modules/nio/pom.xml new file mode 100644 index 0000000000000..c68cad4a7096d --- /dev/null +++ b/modules/nio/pom.xml @@ -0,0 +1,63 @@ + + + + + + + 4.0.0 + + + org.apache.ignite + ignite-parent-internal + ${revision} + ../../parent-internal/pom.xml + + + ignite-nio + + http://ignite.apache.org + + + + ${project.groupId} + ignite-commons + provided + + + + org.jetbrains + annotations + ${jetbrains.annotations.version} + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + ${maven.deploy.plugin.version} + + false + + + + + diff --git a/pom.xml b/pom.xml index beaba513ff029..13b4ca6e55e23 100644 --- a/pom.xml +++ b/pom.xml @@ -45,6 +45,7 @@ modules/thin-client/api modules/thin-client/impl modules/unsafe + modules/nio modules/core modules/compress modules/dev-utils From ec55d37bb7cffdd3bfbd4d81fdde863e5d672f3b Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 01:12:28 +0300 Subject: [PATCH 083/110] IGNITE-28819 Move FastSizeDeque to ignite-commons Relocate the self-contained FastSizeDeque (package org.apache.ignite.util.deque) from ignite-core to ignite-commons. It is used by GridSelectorNioSessionImpl in the NIO engine that will move to ignite-nio; it has no ignite-core dependencies of its own. Binary compatibility is preserved via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/apache/ignite/util/deque/FastSizeDeque.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/util/deque/FastSizeDeque.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/util/deque/FastSizeDeque.java b/modules/commons/src/main/java/org/apache/ignite/util/deque/FastSizeDeque.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/util/deque/FastSizeDeque.java rename to modules/commons/src/main/java/org/apache/ignite/util/deque/FastSizeDeque.java From b1d30b93560dad3da26f50f2b6a2a297ef48c10b Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 01:15:15 +0300 Subject: [PATCH 084/110] IGNITE-28819 Move GridWorker, GridWorkerListener, WorkProgressDispatcher to ignite-commons Relocate the GridWorker base class together with the WorkProgressDispatcher interface it implements and the GridWorkerListener it references (all package org.apache.ignite.internal.util.worker) from ignite-core to ignite-commons. These form the worker-thread foundation used by the NIO engine (GridNioServer) that will move to ignite-nio. GridWorker's three U calls (currentTimeMillis/error/warn) are repointed to their ignite-commons CommonUtils equivalents. GridWorkerFuture and GridWorkerPool are not referenced by GridWorker and remain in ignite-core. Binary compatibility is preserved via the maven-shade bundling of ignite-commons into ignite-core.jar. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ignite/internal/util/worker/GridWorker.java | 11 ++++++----- .../internal/util/worker/GridWorkerListener.java | 0 .../internal/util/worker/WorkProgressDispatcher.java | 0 3 files changed, 6 insertions(+), 5 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java (96%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerListener.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/worker/WorkProgressDispatcher.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java similarity index 96% rename from modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java index e19e2170aa1db..414b8dac3c704 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java @@ -24,9 +24,9 @@ import org.apache.ignite.IgniteInterruptedException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.IgniteInterruptedCheckedException; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.Nullable; /** @@ -140,9 +140,10 @@ protected GridWorker(@Nullable String igniteInstanceName, String name, IgniteLog if (!X.hasCause(e, InterruptedException.class) && !X.hasCause(e, IgniteInterruptedCheckedException.class) && !X.hasCause(e, IgniteInterruptedException.class)) - U.error(log, "Runtime error caught during grid runnable execution: " + this, e); + CommonUtils.error(log, "Runtime error caught during grid runnable execution: " + this, e); else - U.warn(log, "Runtime exception occurred during grid runnable execution caused by thread interruption: " + e.getMessage()); + CommonUtils.warn(log, + "Runtime exception occurred during grid runnable execution caused by thread interruption: " + e.getMessage()); if (e instanceof Error) throw e; @@ -271,7 +272,7 @@ public boolean isDone() { /** {@inheritDoc} */ @Override public void updateHeartbeat() { - long curTs = U.currentTimeMillis(); + long curTs = CommonUtils.currentTimeMillis(); long hbTs = heartbeatTs; // Avoid heartbeat update while in the blocking section. @@ -290,7 +291,7 @@ public boolean isDone() { /** {@inheritDoc} */ @Override public void blockingSectionEnd() { - heartbeatTs = U.currentTimeMillis(); + heartbeatTs = CommonUtils.currentTimeMillis(); } /** Can be called from {@link #runner()} thread to perform idleness handling. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerListener.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerListener.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerListener.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerListener.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/WorkProgressDispatcher.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/worker/WorkProgressDispatcher.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/worker/WorkProgressDispatcher.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/worker/WorkProgressDispatcher.java From 6bba8734768b51aeea1ac1bac648f6f5bce3b6dc Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 11:21:53 +0300 Subject: [PATCH 085/110] IGNITE-28819 Move tracing classes used by GridNioServer to ignite-commons Move Scope, SpanStatus, SpanType, Span, SpanManager, NoopSpan, SpanTags and MTC to ignite-commons, and add NoopSpanManager (no-op SpanManager). GridNioServer now uses SpanManager/NoopSpanManager instead of Tracing/NoopTracing, removing its dependency on the core tracing manager. NoopTracing extends NoopSpanManager. Co-Authored-By: Claude Opus 4.8 --- .../internal/processors/tracing/MTC.java | 0 .../internal/processors/tracing/NoopSpan.java | 0 .../processors/tracing/NoopSpanManager.java | 52 +++++++++++++++++++ .../internal/processors/tracing/Span.java | 0 .../processors/tracing/SpanManager.java | 0 .../internal/processors/tracing/SpanTags.java | 0 .../internal/processors/tracing/SpanType.java | 0 .../org/apache/ignite/spi/tracing/Scope.java | 0 .../apache/ignite/spi/tracing/SpanStatus.java | 0 .../processors/tracing/NoopTracing.java | 29 +---------- .../internal/util/nio/GridNioServer.java | 20 +++---- 11 files changed, 63 insertions(+), 38 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/tracing/MTC.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpan.java (100%) create mode 100644 modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/tracing/Span.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/tracing/SpanTags.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/tracing/SpanType.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/spi/tracing/Scope.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/spi/tracing/SpanStatus.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/MTC.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/MTC.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/MTC.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/MTC.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpan.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpan.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpan.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpan.java diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java new file mode 100644 index 0000000000000..fd481d30ad92e --- /dev/null +++ b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java @@ -0,0 +1,52 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.tracing; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Noop implementation of {@link SpanManager}. + */ +public class NoopSpanManager implements SpanManager { + /** Noop serialized span. */ + public static final byte[] NOOP_SERIALIZED_SPAN = new byte[0]; + + /** {@inheritDoc} */ + @Override public Span create(@NotNull SpanType spanType, @Nullable Span parentSpan) { + return NoopSpan.INSTANCE; + } + + /** {@inheritDoc} */ + @Override public Span create(@NotNull SpanType spanType, @Nullable byte[] serializedParentSpan) { + return NoopSpan.INSTANCE; + } + + /** {@inheritDoc} */ + @Override public @NotNull Span create( + @NotNull SpanType spanType, + @Nullable Span parentSpan, + @Nullable String lb) { + return NoopSpan.INSTANCE; + } + + /** {@inheritDoc} */ + @Override public byte[] serialize(@NotNull Span span) { + return NOOP_SERIALIZED_SPAN; + } +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/Span.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/Span.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/Span.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/Span.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/SpanTags.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanTags.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/SpanTags.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanTags.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/SpanType.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/SpanType.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanType.java diff --git a/modules/core/src/main/java/org/apache/ignite/spi/tracing/Scope.java b/modules/commons/src/main/java/org/apache/ignite/spi/tracing/Scope.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/spi/tracing/Scope.java rename to modules/commons/src/main/java/org/apache/ignite/spi/tracing/Scope.java diff --git a/modules/core/src/main/java/org/apache/ignite/spi/tracing/SpanStatus.java b/modules/commons/src/main/java/org/apache/ignite/spi/tracing/SpanStatus.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/spi/tracing/SpanStatus.java rename to modules/commons/src/main/java/org/apache/ignite/spi/tracing/SpanStatus.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/NoopTracing.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/NoopTracing.java index 77563757c5742..c7cd10f562629 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/NoopTracing.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/NoopTracing.java @@ -22,15 +22,11 @@ import org.apache.ignite.logger.NullLogger; import org.apache.ignite.spi.tracing.TracingConfigurationManager; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * Noop implementation of {@link Tracing}. */ -public class NoopTracing implements Tracing { - /** Noop serialized span. */ - public static final byte[] NOOP_SERIALIZED_SPAN = new byte[0]; - +public class NoopTracing extends NoopSpanManager implements Tracing { /** Traceable messages handler. */ private final TraceableMessagesHandler msgHnd; @@ -46,29 +42,6 @@ public NoopTracing() { return msgHnd; } - /** {@inheritDoc} */ - @Override public Span create(@NotNull SpanType spanType, @Nullable Span parentSpan) { - return NoopSpan.INSTANCE; - } - - /** {@inheritDoc} */ - @Override public Span create(@NotNull SpanType spanType, @Nullable byte[] serializedParentSpan) { - return NoopSpan.INSTANCE; - } - - /** {@inheritDoc} */ - @Override public @NotNull Span create( - @NotNull SpanType spanType, - @Nullable Span parentSpan, - @Nullable String label) { - return NoopSpan.INSTANCE; - } - - /** {@inheritDoc} */ - @Override public byte[] serialize(@NotNull Span span) { - return NOOP_SERIALIZED_SPAN; - } - /** {@inheritDoc} */ @Override public @NotNull TracingConfigurationManager configuration() { return NoopTracingConfigurationManager.INSTANCE; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index 797290677db52..fab5655d58dfa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -61,11 +61,11 @@ import org.apache.ignite.internal.processors.tracing.MTC; import org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings; import org.apache.ignite.internal.processors.tracing.NoopSpan; -import org.apache.ignite.internal.processors.tracing.NoopTracing; +import org.apache.ignite.internal.processors.tracing.NoopSpanManager; import org.apache.ignite.internal.processors.tracing.Span; +import org.apache.ignite.internal.processors.tracing.SpanManager; import org.apache.ignite.internal.processors.tracing.SpanTags; import org.apache.ignite.internal.processors.tracing.SpanType; -import org.apache.ignite.internal.processors.tracing.Tracing; import org.apache.ignite.internal.util.GridConcurrentHashSet; import org.apache.ignite.internal.util.GridUnsafe; import org.apache.ignite.internal.util.future.GridCompoundFuture; @@ -295,8 +295,8 @@ public class GridNioServer { */ private final boolean readWriteSelectorsAssign; - /** Tracing processor. */ - private Tracing tracing; + /** Span manager. */ + private SpanManager tracing; /** Message factory. */ private final MessageFactory msgFactory; @@ -352,7 +352,7 @@ private GridNioServer( boolean readWriteSelectorsAssign, @Nullable GridWorkerListener workerLsnr, @Nullable MetricRegistryImpl mreg, - Tracing tracing, + SpanManager tracing, MessageFactory msgFactory, GridNioFilter... filters ) throws IgniteCheckedException { @@ -380,7 +380,7 @@ private GridNioServer( this.selectorSpins = selectorSpins; this.readWriteSelectorsAssign = readWriteSelectorsAssign; this.lsnr = lsnr; - this.tracing = tracing == null ? new NoopTracing() : tracing; + this.tracing = tracing == null ? new NoopSpanManager() : tracing; this.msgFactory = msgFactory; filterChain = new GridNioFilterChain<>(log, lsnr, new HeadFilter(), filters); @@ -3949,8 +3949,8 @@ public static class Builder { /** Metrics registry. */ private MetricRegistryImpl mreg; - /** Tracing processor */ - private Tracing tracing; + /** Span manager */ + private SpanManager tracing; /** Message factory. */ private MessageFactory msgFactory; @@ -4010,10 +4010,10 @@ public Builder readWriteSelectorsAssign(boolean readWriteSelectorsAssign) { } /** - * @param tracing Tracing processor. + * @param tracing Span manager. * @return This for chaining. */ - public Builder tracing(Tracing tracing) { + public Builder tracing(SpanManager tracing) { this.tracing = tracing; return this; From 4005186d37c77bf2747e75d3e03eb89ae91dc21d Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 12:08:12 +0300 Subject: [PATCH 086/110] IGNITE-28819 Add SpanManager.traceName(Message) to decouple GridNioServer from TraceableMessagesTable Add traceName(Message) to SpanManager: GridTracingManager delegates to TraceableMessagesTable.traceName, NoopSpanManager returns null. GridNioServer now calls tracing.traceName(msg) instead of the static TraceableMessagesTable.traceName, removing its last dependency on core tracing. Co-Authored-By: Claude Opus 4.8 --- .../internal/processors/tracing/NoopSpanManager.java | 6 ++++++ .../ignite/internal/processors/tracing/SpanManager.java | 7 +++++++ .../internal/managers/tracing/GridTracingManager.java | 7 +++++++ .../org/apache/ignite/internal/util/nio/GridNioServer.java | 5 ++--- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java index fd481d30ad92e..0d948b5d41fb1 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/NoopSpanManager.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.tracing; +import org.apache.ignite.plugin.extensions.communication.Message; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -49,4 +50,9 @@ public class NoopSpanManager implements SpanManager { @Override public byte[] serialize(@NotNull Span span) { return NOOP_SERIALIZED_SPAN; } + + /** {@inheritDoc} */ + @Override public String traceName(Message msg) { + return null; + } } diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java index 010506dca3963..be43ec4cabb7c 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/SpanManager.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.tracing; +import org.apache.ignite.plugin.extensions.communication.Message; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -70,4 +71,10 @@ default Span create(@NotNull SpanType spanType) { * @param span Span. */ byte[] serialize(@NotNull Span span); + + /** + * @param msg Message to resolve a trace name for. + * @return Trace name of the message, or {@code null} if tracing is disabled. + */ + @Nullable String traceName(Message msg); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/tracing/GridTracingManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/tracing/GridTracingManager.java index 4e5e66e692452..4e0871024881c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/tracing/GridTracingManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/tracing/GridTracingManager.java @@ -34,8 +34,10 @@ import org.apache.ignite.internal.processors.tracing.Tracing; import org.apache.ignite.internal.processors.tracing.configuration.GridTracingConfigurationManager; import org.apache.ignite.internal.processors.tracing.messages.TraceableMessagesHandler; +import org.apache.ignite.internal.processors.tracing.messages.TraceableMessagesTable; import org.apache.ignite.internal.util.typedef.internal.LT; import org.apache.ignite.logger.NullLogger; +import org.apache.ignite.plugin.extensions.communication.Message; import org.apache.ignite.spi.IgniteSpiException; import org.apache.ignite.spi.tracing.NoopTracingSpi; import org.apache.ignite.spi.tracing.Scope; @@ -507,6 +509,11 @@ private Span enrichWithLocalNodeParameters(@Nullable Span span) { } } + /** {@inheritDoc} */ + @Override public String traceName(Message msg) { + return TraceableMessagesTable.traceName(msg); + } + /** {@inheritDoc} */ @Override public TraceableMessagesHandler messages() { // Optimization for noop spi. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index fab5655d58dfa..f73a78a8cce94 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -97,7 +97,6 @@ import static org.apache.ignite.failure.FailureType.SYSTEM_WORKER_TERMINATION; import static org.apache.ignite.internal.processors.tracing.SpanTags.SOCKET_WRITE_BYTES; import static org.apache.ignite.internal.processors.tracing.SpanType.COMMUNICATION_SOCKET_WRITE; -import static org.apache.ignite.internal.processors.tracing.messages.TraceableMessagesTable.traceName; import static org.apache.ignite.internal.util.nio.GridNioSessionMetaKey.MSG_WRITER; import static org.apache.ignite.internal.util.nio.GridNioSessionMetaKey.NIO_OPERATION; @@ -1636,7 +1635,7 @@ private boolean writeToBuffer( Span span = tracing.create(SpanType.COMMUNICATION_SOCKET_WRITE, req.span()); try (TraceSurroundings ignore = span.equals(NoopSpan.INSTANCE) ? null : MTC.support(span)) { - span.addTag(SpanTags.MESSAGE, () -> traceName(msg)); + span.addTag(SpanTags.MESSAGE, () -> tracing.traceName(msg)); assert msg != null; @@ -1839,7 +1838,7 @@ private boolean writeToBuffer(GridSelectorNioSessionImpl ses, ByteBuffer buf, Se Span span = tracing.create(SpanType.COMMUNICATION_SOCKET_WRITE, req.span()); try (TraceSurroundings ignore = span.equals(NoopSpan.INSTANCE) ? null : MTC.support(span)) { - span.addTag(SpanTags.MESSAGE, () -> traceName(msg)); + span.addTag(SpanTags.MESSAGE, () -> tracing.traceName(msg)); int startPos = buf.position(); From aba99766b38d15ae2def2fd1ad37b352125a330c Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 12:33:23 +0300 Subject: [PATCH 087/110] IGNITE-28819 Move GridWorker/thread util methods to CommonUtils; GridNioServer uses CommonUtils Move sleep(long), cancel(GridWorker), cancel(Iterable), join(GridWorker, log), join(Iterable, log) and newThread(GridWorker) from IgniteUtils to CommonUtils (commons). IgniteUtils still inherits them via CommonUtils, so existing U.* callers are unaffected. GridNioServer now calls CommonUtils instead of U, removing its dependency on core IgniteUtils. Co-Authored-By: Claude Opus 4.8 --- .../ignite/internal/util/CommonUtils.java | 90 ++++++++++++++ .../ignite/internal/util/IgniteUtils.java | 90 -------------- .../internal/util/nio/GridNioServer.java | 110 +++++++++--------- 3 files changed, 145 insertions(+), 145 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index 3591c0532b225..6579d5e8480e3 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -87,6 +87,7 @@ import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.LT; import org.apache.ignite.internal.util.typedef.internal.SB; +import org.apache.ignite.internal.util.worker.GridWorker; import org.apache.ignite.lang.IgniteFutureCancelledException; import org.apache.ignite.lang.IgniteFutureTimeoutException; import org.apache.ignite.lang.IgnitePredicate; @@ -2580,4 +2581,93 @@ public static String typeName(Class cls) { return typeName; } + + /** + * Cancels given runnable. + * + * @param w Worker to cancel - it's no-op if runnable is {@code null}. + */ + public static void cancel(@Nullable GridWorker w) { + if (w != null) + w.cancel(); + } + + /** + * Cancels collection of runnables. + * + * @param ws Collection of workers - it's no-op if collection is {@code null}. + */ + public static void cancel(Iterable ws) { + if (ws != null) + for (GridWorker w : ws) + w.cancel(); + } + + /** + * Joins runnable. + * + * @param w Worker to join. + * @param log The logger to possible exception. + * @return {@code true} if worker has not been interrupted, {@code false} if it was interrupted. + */ + public static boolean join(@Nullable GridWorker w, @Nullable IgniteLogger log) { + if (w != null) + try { + w.join(); + } + catch (InterruptedException ignore) { + warn(log, "Got interrupted while waiting for completion of runnable: " + w); + + Thread.currentThread().interrupt(); + + return false; + } + + return true; + } + + /** + * Joins given collection of runnables. + * + * @param ws Collection of workers to join. + * @param log The logger to possible exceptions. + * @return {@code true} if none of the worker have been interrupted, + * {@code false} if at least one was interrupted. + */ + public static boolean join(Iterable ws, IgniteLogger log) { + boolean retval = true; + + if (ws != null) + for (GridWorker w : ws) + if (!join(w, log)) + retval = false; + + return retval; + } + + /** + * Creates thread with given worker. + * + * @param worker Runnable to create thread with. + */ + public static IgniteThread newThread(GridWorker worker) { + return new IgniteThread(worker.igniteInstanceName(), worker.name(), worker); + } + + /** + * Sleeps for given number of milliseconds. + * + * @param ms Time to sleep. + * @throws IgniteInterruptedCheckedException Wrapped {@link InterruptedException}. + */ + public static void sleep(long ms) throws IgniteInterruptedCheckedException { + try { + Thread.sleep(ms); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + + throw new IgniteInterruptedCheckedException(e); + } + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 8c2f934aa4f93..ff0f77e86c404 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -222,7 +222,6 @@ import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage; import org.apache.ignite.spi.discovery.DiscoverySpiOrderSupport; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; -import org.apache.ignite.thread.IgniteThread; import org.apache.ignite.transactions.TransactionDeadlockException; import org.apache.ignite.transactions.TransactionHeuristicException; import org.apache.ignite.transactions.TransactionOptimisticException; @@ -3234,69 +3233,6 @@ public static boolean joinThreads(Iterable workers, @Nullable return retval; } - /** - * Cancels given runnable. - * - * @param w Worker to cancel - it's no-op if runnable is {@code null}. - */ - public static void cancel(@Nullable GridWorker w) { - if (w != null) - w.cancel(); - } - - /** - * Cancels collection of runnables. - * - * @param ws Collection of workers - it's no-op if collection is {@code null}. - */ - public static void cancel(Iterable ws) { - if (ws != null) - for (GridWorker w : ws) - w.cancel(); - } - - /** - * Joins runnable. - * - * @param w Worker to join. - * @param log The logger to possible exception. - * @return {@code true} if worker has not been interrupted, {@code false} if it was interrupted. - */ - public static boolean join(@Nullable GridWorker w, @Nullable IgniteLogger log) { - if (w != null) - try { - w.join(); - } - catch (InterruptedException ignore) { - warn(log, "Got interrupted while waiting for completion of runnable: " + w); - - Thread.currentThread().interrupt(); - - return false; - } - - return true; - } - - /** - * Joins given collection of runnables. - * - * @param ws Collection of workers to join. - * @param log The logger to possible exceptions. - * @return {@code true} if none of the worker have been interrupted, - * {@code false} if at least one was interrupted. - */ - public static boolean join(Iterable ws, IgniteLogger log) { - boolean retval = true; - - if (ws != null) - for (GridWorker w : ws) - if (!join(w, log)) - retval = false; - - return retval; - } - /** * Shutdowns given {@code ExecutorService} and wait for executor service to stop. * @@ -5056,23 +4992,6 @@ public static void awaitQuiet(CyclicBarrier barrier) { Thread.currentThread().interrupt(); } - /** - * Sleeps for given number of milliseconds. - * - * @param ms Time to sleep. - * @throws IgniteInterruptedCheckedException Wrapped {@link InterruptedException}. - */ - public static void sleep(long ms) throws IgniteInterruptedCheckedException { - try { - Thread.sleep(ms); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - - throw new IgniteInterruptedCheckedException(e); - } - } - /** * Joins worker. * @@ -7835,15 +7754,6 @@ public static void prepareAffinityField(BinaryObjectBuilder builder, CacheObject } } - /** - * Creates thread with given worker. - * - * @param worker Runnable to create thread with. - */ - public static IgniteThread newThread(GridWorker worker) { - return new IgniteThread(worker.igniteInstanceName(), worker.name(), worker); - } - /** */ public static final IgniteDataTransferObjectSerializer EMPTY_DTO_SERIALIZER = new IgniteDataTransferObjectSerializer() { /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index f73a78a8cce94..c63a7e65ff726 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -66,6 +66,7 @@ import org.apache.ignite.internal.processors.tracing.SpanManager; import org.apache.ignite.internal.processors.tracing.SpanTags; import org.apache.ignite.internal.processors.tracing.SpanType; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.GridConcurrentHashSet; import org.apache.ignite.internal.util.GridUnsafe; import org.apache.ignite.internal.util.future.GridCompoundFuture; @@ -77,7 +78,6 @@ import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.LT; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.internal.util.worker.GridWorker; import org.apache.ignite.internal.util.worker.GridWorkerListener; import org.apache.ignite.lang.IgniteBiInClosure; @@ -432,7 +432,7 @@ private GridNioServer( clientWorkers.add(worker); - clientThreads[i] = U.newThread(worker); + clientThreads[i] = CommonUtils.newThread(worker); clientThreads[i].setDaemon(daemon); } @@ -520,7 +520,7 @@ public void start() { filterChain.start(); if (acceptWorker != null) - U.newThread(acceptWorker).start(); + CommonUtils.newThread(acceptWorker).start(); for (IgniteThread thread : clientThreads) thread.start(); @@ -534,11 +534,11 @@ public void stop() { closed = true; // Make sure to entirely stop acceptor if any. - U.cancel(acceptWorker); - U.join(acceptWorker, log); + CommonUtils.cancel(acceptWorker); + CommonUtils.join(acceptWorker, log); - U.cancel(clientWorkers); - U.join(clientWorkers, log); + CommonUtils.cancel(clientWorkers); + CommonUtils.join(clientWorkers, log); filterChain.stop(); @@ -780,7 +780,7 @@ public void resend(GridNioSession ses) { ses0.offerStateChange((GridNioServer.SessionChangeRequest)fut0); } catch (IgniteCheckedException e) { - U.error(log, "Failed to notify NIO Server while resending messages [rmtNode=" + recoveryDesc.node().id() + ']', e); + CommonUtils.error(log, "Failed to notify NIO Server while resending messages [rmtNode=" + recoveryDesc.node().id() + ']', e); } } } @@ -867,7 +867,7 @@ public IgniteInternalFuture dumpStats(final String msg, IgnitePredicate< if (!F.isEmpty(msg)) { synchronized (sb) { if (sb.length() > 0) - sb.append(U.nl()); + sb.append(CommonUtils.nl()); sb.append(msg); } @@ -917,7 +917,7 @@ public IgniteInternalFuture dumpNodeStats(final String msg, IgnitePredic if (!F.isEmpty(msg)) { synchronized (sb) { if (sb.length() > 0) - sb.append(U.nl()); + sb.append(CommonUtils.nl()); sb.append(msg); } @@ -1096,8 +1096,8 @@ private Selector createSelector(@Nullable SocketAddress addr) throws IgniteCheck return selector; } catch (Throwable e) { - U.close(srvrCh, log); - U.close(selector, log); + CommonUtils.close(srvrCh, log); + CommonUtils.close(selector, log); if (e instanceof Error) throw (Error)e; @@ -1214,10 +1214,10 @@ protected ByteBufferNioClientWorker( @Override protected void processRead(SelectionKey key) throws IOException { if (skipRead) { try { - U.sleep(50); + CommonUtils.sleep(50); } catch (IgniteInterruptedCheckedException ignored) { - U.warn(log, "Sleep has been interrupted."); + CommonUtils.warn(log, "Sleep has been interrupted."); } return; @@ -1323,7 +1323,7 @@ else if (cnt == 0) else { // For test purposes only (skipWrite is set to true in tests only). try { - U.sleep(50); + CommonUtils.sleep(50); } catch (IgniteInterruptedCheckedException e) { throw new IOException("Thread has been interrupted.", e); @@ -1383,10 +1383,10 @@ protected DirectNioClientWorker( @Override protected void processRead(SelectionKey key) throws IOException { if (skipRead) { try { - U.sleep(50); + CommonUtils.sleep(50); } catch (IgniteInterruptedCheckedException ignored) { - U.warn(log, "Sleep has been interrupted."); + CommonUtils.warn(log, "Sleep has been interrupted."); } return; @@ -1584,7 +1584,7 @@ private void processWriteSsl(SelectionKey key) throws IOException { else { // For test purposes only (skipWrite is set to true in tests only). try { - U.sleep(50); + CommonUtils.sleep(50); } catch (IgniteInterruptedCheckedException e) { throw new IOException("Thread has been interrupted.", e); @@ -1785,7 +1785,7 @@ private void processWrite0(SelectionKey key) throws IOException { else { // For test purposes only (skipWrite is set to true in tests only). try { - U.sleep(50); + CommonUtils.sleep(50); } catch (IgniteInterruptedCheckedException e) { throw new IOException("Thread has been interrupted.", e); @@ -1980,10 +1980,10 @@ private abstract class AbstractNioClientWorker extends GridWorker implements Gri } catch (IgniteCheckedException e) { if (!Thread.currentThread().isInterrupted()) { - U.error(log, "Failed to read data from remote connection (will wait for " + + CommonUtils.error(log, "Failed to read data from remote connection (will wait for " + ERR_WAIT_TIME + "ms).", e); - U.sleep(ERR_WAIT_TIME); + CommonUtils.sleep(ERR_WAIT_TIME); reset = true; } @@ -1991,7 +1991,7 @@ private abstract class AbstractNioClientWorker extends GridWorker implements Gri } } catch (Throwable e) { - U.error(log, "Caught unhandled exception in NIO worker thread (restart the node).", e); + CommonUtils.error(log, "Caught unhandled exception in NIO worker thread (restart the node).", e); err = e; @@ -2031,7 +2031,7 @@ private void createSelector() throws IgniteCheckedException { SelectedSelectionKeySet selectedKeySet = new SelectedSelectionKeySet(); Class selectorImplCls = - Class.forName("sun.nio.ch.SelectorImpl", false, U.gridClassLoader()); + Class.forName("sun.nio.ch.SelectorImpl", false, CommonUtils.gridClassLoader()); // Ensure the current selector implementation is what we can instrument. if (!selectorImplCls.isAssignableFrom(selector.getClass())) @@ -2113,7 +2113,7 @@ private void createSelector() throws IgniteCheckedException { */ private void bodyInternal() throws IgniteCheckedException, InterruptedException { try { - long lastIdleCheck = U.currentTimeMillis(); + long lastIdleCheck = CommonUtils.currentTimeMillis(); while (selector.isOpen() && !(isCancelled() && changeReqs.isEmpty())) { SessionChangeRequest req; @@ -2147,7 +2147,7 @@ private void bodyInternal() throws IgniteCheckedException, InterruptedException break; // Just in case we do busy selects. - long now = U.currentTimeMillis(); + long now = CommonUtils.currentTimeMillis(); if (now - lastIdleCheck > 2000) { lastIdleCheck = now; @@ -2196,7 +2196,7 @@ private void bodyInternal() throws IgniteCheckedException, InterruptedException select = false; } - long now = U.currentTimeMillis(); + long now = CommonUtils.currentTimeMillis(); if (now - lastIdleCheck > 2000) { lastIdleCheck = now; @@ -2232,7 +2232,7 @@ private void bodyInternal() throws IgniteCheckedException, InterruptedException if (log.isDebugEnabled()) log.debug("Closing NIO selector."); - U.close(selector, log); + CommonUtils.close(selector, log); } } } @@ -2265,7 +2265,7 @@ private void processSessionChangedRequest(SessionChangeRequest req0) throws Igni if (key != null) key.cancel(); - U.closeQuiet(ch); + CommonUtils.closeQuiet(ch); req.onDone(); @@ -2447,7 +2447,7 @@ private void dumpSelectorInfo(StringBuilder sb, Set keys) { .append(", bytesRcvd0=").append(bytesRcvd0) .append(", bytesSent=").append(bytesSent) .append(", bytesSent0=").append(bytesSent0) - .append("]").append(U.nl()); + .append("]").append(CommonUtils.nl()); } /** @@ -2613,7 +2613,7 @@ private void processSelectedKeysOptimized(SelectionKey[] keys) throws ClosedByIn } catch (Exception | Error e) { // TODO IGNITE-2659. try { - U.sleep(1000); + CommonUtils.sleep(1000); } catch (IgniteInterruptedCheckedException ignore) { // No-op. @@ -2622,7 +2622,7 @@ private void processSelectedKeysOptimized(SelectionKey[] keys) throws ClosedByIn GridSelectorNioSessionImpl ses = attach.session(); if (!closed) - U.error(log, "Failed to process selector key [ses=" + ses + ']', e); + CommonUtils.error(log, "Failed to process selector key [ses=" + ses + ']', e); else if (log.isDebugEnabled()) log.debug("Failed to process selector key [ses=" + ses + ", err=" + e + ']'); @@ -2680,7 +2680,7 @@ private void processSelectedKeys(Set keys) throws ClosedByInterrup } catch (Exception | Error e) { // TODO IGNITE-2659. try { - U.sleep(1000); + CommonUtils.sleep(1000); } catch (IgniteInterruptedCheckedException ignore) { // No-op. @@ -2689,7 +2689,7 @@ private void processSelectedKeys(Set keys) throws ClosedByInterrup GridSelectorNioSessionImpl ses = attach.session(); if (!closed) - U.error(log, "Failed to process selector key [ses=" + ses + ']', e); + CommonUtils.error(log, "Failed to process selector key [ses=" + ses + ']', e); else if (log.isDebugEnabled()) log.debug("Failed to process selector key [ses=" + ses + ", err=" + e + ']'); } @@ -2702,7 +2702,7 @@ else if (log.isDebugEnabled()) * @param keys Keys registered to selector. */ private void checkIdle(Iterable keys) { - long now = U.currentTimeMillis(); + long now = CommonUtils.currentTimeMillis(); for (SelectionKey key : keys) { GridNioKeyAttachment attach = (GridNioKeyAttachment)key.attachment(); @@ -2846,11 +2846,11 @@ private void register(NioOperationFuture fut) { ses.onServerStopped(); } catch (ClosedChannelException e) { - U.warn(log, "Failed to register accepted socket channel to selector (channel was closed): " + CommonUtils.warn(log, "Failed to register accepted socket channel to selector (channel was closed): " + sock.getRemoteSocketAddress(), e); } catch (IOException e) { - U.error(log, "Failed to get socket addresses.", e); + CommonUtils.error(log, "Failed to get socket addresses.", e); } } @@ -2877,8 +2877,8 @@ private void closeKey(SelectionKey key) { } } finally { - U.close(key, log); - U.close(sock, log); + CommonUtils.close(key, log); + CommonUtils.close(sock, log); } } @@ -2907,11 +2907,11 @@ protected boolean close( if (e != null) { // Print stack trace only if has runtime exception in it's cause. if (e.hasCause(IOException.class)) - U.warn(log, "Client disconnected abruptly due to network connection loss or because " + + CommonUtils.warn(log, "Client disconnected abruptly due to network connection loss or because " + "the connection was left open on application shutdown. [cls=" + e.getClass() + ", msg=" + e.getMessage() + ']'); else - U.error(log, "Closing NIO session because of unhandled exception.", e); + CommonUtils.error(log, "Closing NIO session because of unhandled exception.", e); } sessions.remove(ses); @@ -2999,7 +2999,7 @@ private void processConnect(SelectionKey key) throws IOException { register(sesFut); } catch (IOException e) { - U.closeQuiet(ch); + CommonUtils.closeQuiet(ch); sesFut.onDone(new GridNioException("Failed to connect to node", e)); @@ -3120,10 +3120,10 @@ protected GridNioAcceptWorker( } catch (IgniteCheckedException e) { if (!Thread.currentThread().isInterrupted()) { - U.error(log, "Failed to accept remote connection (will wait for " + ERR_WAIT_TIME + "ms).", + CommonUtils.error(log, "Failed to accept remote connection (will wait for " + ERR_WAIT_TIME + "ms).", e); - U.sleep(ERR_WAIT_TIME); + CommonUtils.sleep(ERR_WAIT_TIME); reset = true; } @@ -3212,12 +3212,12 @@ private void closeSelector() { // Close all channels registered with selector. for (SelectionKey key : selector.keys()) - U.close(key.channel(), log); + CommonUtils.close(key.channel(), log); if (log.isDebugEnabled()) log.debug("Closing NIO selector."); - U.close(selector, log); + CommonUtils.close(selector, log); } } @@ -3276,9 +3276,9 @@ private void addRegistrationRequest(SocketChannel sockCh) { offerBalanced(new NioOperationFuture<>(sockCh, true, null), null); } catch (IgniteCheckedException e) { - U.warn(log, "Incoming connection was rejected [addr=" + sockCh.socket().getRemoteSocketAddress() + ']', e); + CommonUtils.warn(log, "Incoming connection was rejected [addr=" + sockCh.socket().getRemoteSocketAddress() + ']', e); - U.close(sockCh, log); + CommonUtils.close(sockCh, log); } } } @@ -4294,7 +4294,7 @@ private class ReadWriteSizeBasedBalancer implements IgniteRunnable { /** {@inheritDoc} */ @Override public void run() { - long now = U.currentTimeMillis(); + long now = CommonUtils.currentTimeMillis(); if (lastBalance + balancePeriod < now) { lastBalance = now; @@ -4357,9 +4357,9 @@ private class ReadWriteSizeBasedBalancer implements IgniteRunnable { long bytesSent0 = ses0.bytesSent0(); if (bytesSent0 < threshold && - (ses == null || delta > U.safeAbs(bytesSent0 - sentDiff / 2))) { + (ses == null || delta > CommonUtils.safeAbs(bytesSent0 - sentDiff / 2))) { ses = ses0; - delta = U.safeAbs(bytesSent0 - sentDiff / 2); + delta = CommonUtils.safeAbs(bytesSent0 - sentDiff / 2); } } @@ -4390,9 +4390,9 @@ private class ReadWriteSizeBasedBalancer implements IgniteRunnable { long bytesRcvd0 = ses0.bytesReceived0(); if (bytesRcvd0 < threshold && - (ses == null || delta > U.safeAbs(bytesRcvd0 - rcvdDiff / 2))) { + (ses == null || delta > CommonUtils.safeAbs(bytesRcvd0 - rcvdDiff / 2))) { ses = ses0; - delta = U.safeAbs(bytesRcvd0 - rcvdDiff / 2); + delta = CommonUtils.safeAbs(bytesRcvd0 - rcvdDiff / 2); } } @@ -4440,7 +4440,7 @@ private class SizeBasedBalancer implements IgniteRunnable { /** {@inheritDoc} */ @Override public void run() { - long now = U.currentTimeMillis(); + long now = CommonUtils.currentTimeMillis(); if (lastBalance + balancePeriod < now) { lastBalance = now; @@ -4484,9 +4484,9 @@ private class SizeBasedBalancer implements IgniteRunnable { long bytesSent0 = ses0.bytesSent0(); if (bytesSent0 < threshold && - (ses == null || delta > U.safeAbs(bytesSent0 - bytesDiff / 2))) { + (ses == null || delta > CommonUtils.safeAbs(bytesSent0 - bytesDiff / 2))) { ses = ses0; - delta = U.safeAbs(bytesSent0 - bytesDiff / 2); + delta = CommonUtils.safeAbs(bytesSent0 - bytesDiff / 2); } } From d37b213b796f1543471e9ce967c642df6a39b29c Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 12:45:22 +0300 Subject: [PATCH 088/110] IGNITE-28819 Move IGNITE_NO_SELECTOR_OPTS, IGNITE_IO_BALANCE_PERIOD and DFLT_IO_BALANCE_PERIOD to IgniteCommonsSystemProperties; GridNioServer uses IgniteCommonsSystemProperties Co-Authored-By: Claude Opus 4.8 --- .../ignite/IgniteCommonsSystemProperties.java | 19 +++++++++++++++++++ .../apache/ignite/IgniteSystemProperties.java | 19 ------------------- .../internal/util/nio/GridNioServer.java | 17 ++++++++--------- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java b/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java index d424f23cfe735..0a691a5de86bd 100644 --- a/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java +++ b/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java @@ -185,6 +185,25 @@ public class IgniteCommonsSystemProperties { ) public static final String IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION = "IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION"; + /** + * Enables default selected keys set to be used inside {@code GridNioServer}. + *

+ * Default value is {@code false}. Should be switched to {@code true} if there are + * any problems in communication layer. + */ + @SystemProperty("Enables default selected keys set to be used inside GridNioServer " + + "which lead to some extra garbage generation when processing selected keys. " + + "Should be switched to true if there are any problems in communication layer") + public static final String IGNITE_NO_SELECTOR_OPTS = "IGNITE_NO_SELECTOR_OPTS"; + + /** Default IO balance period. */ + public static final int DFLT_IO_BALANCE_PERIOD = 5000; + + /** */ + @SystemProperty(value = "IO balance period in milliseconds", type = Long.class, + defaults = "" + DFLT_IO_BALANCE_PERIOD) + public static final String IGNITE_IO_BALANCE_PERIOD = "IGNITE_IO_BALANCE_PERIOD"; + /** * @param enumCls Enum type. * @param name Name of the system property or environment variable. diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index 18b3e0f86fb6c..a7cebfcd022f5 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -134,7 +134,6 @@ import static org.apache.ignite.internal.util.IgniteExceptionRegistry.DEFAULT_QUEUE_SIZE; import static org.apache.ignite.internal.util.IgniteUtils.DFLT_MBEAN_APPEND_CLASS_LOADER_ID; import static org.apache.ignite.internal.util.nio.GridNioRecoveryDescriptor.DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT; -import static org.apache.ignite.internal.util.nio.GridNioServer.DFLT_IO_BALANCE_PERIOD; import static org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.DFLT_DISCOVERY_CLIENT_RECONNECT_HISTORY_SIZE; import static org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.DFLT_DISCOVERY_METRICS_QNT_WARN; import static org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.DFLT_DISCO_FAILED_CLIENT_RECONNECT_DELAY; @@ -807,19 +806,6 @@ public final class IgniteSystemProperties extends IgniteCommonsSystemProperties @SystemProperty("Enables local store keeps primary only. Backward compatibility flag") public static final String IGNITE_LOCAL_STORE_KEEPS_PRIMARY_ONLY = "IGNITE_LOCAL_STORE_KEEPS_PRIMARY_ONLY"; - /** - * If set to {@code true}, then default selected keys set is used inside - * {@code GridNioServer} which lead to some extra garbage generation when - * processing selected keys. - *

- * Default value is {@code false}. Should be switched to {@code true} if there are - * any problems in communication layer. - */ - @SystemProperty("Enables default selected keys set to be used inside GridNioServer " + - "which lead to some extra garbage generation when processing selected keys. " + - "Should be switched to true if there are any problems in communication layer") - public static final String IGNITE_NO_SELECTOR_OPTS = "IGNITE_NO_SELECTOR_OPTS"; - /** * System property to specify period in milliseconds between calls of the SQL statements cache cleanup task. *

@@ -894,11 +880,6 @@ public final class IgniteSystemProperties extends IgniteCommonsSystemProperties + "when resolving local node's addresses", defaults = "true") public static final String IGNITE_IGNORE_LOCAL_HOST_NAME = "IGNITE_IGNORE_LOCAL_HOST_NAME"; - /** */ - @SystemProperty(value = "IO balance period in milliseconds", type = Long.class, - defaults = "" + DFLT_IO_BALANCE_PERIOD) - public static final String IGNITE_IO_BALANCE_PERIOD = "IGNITE_IO_BALANCE_PERIOD"; - /** * When set to {@code true} BinaryObject will be unwrapped before passing to IndexingSpi to preserve * old behavior query processor with IndexingSpi. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index c63a7e65ff726..c002ed5c5f0db 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -48,9 +48,9 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicLong; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.IgniteCommonsSystemProperties; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteInterruptedCheckedException; @@ -144,10 +144,7 @@ public class GridNioServer { /** */ private static final boolean DISABLE_KEYSET_OPTIMIZATION = - IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_NO_SELECTOR_OPTS); - - /** @see IgniteSystemProperties#IGNITE_IO_BALANCE_PERIOD */ - public static final int DFLT_IO_BALANCE_PERIOD = 5000; + IgniteCommonsSystemProperties.getBoolean(IgniteCommonsSystemProperties.IGNITE_NO_SELECTOR_OPTS); /** */ public static final String OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME = "outboundMessagesQueueSize"; @@ -442,13 +439,14 @@ private GridNioServer( this.skipRecoveryPred = skipRecoveryPred != null ? skipRecoveryPred : F.alwaysFalse(); - long balancePeriod = IgniteSystemProperties.getLong( - IgniteSystemProperties.IGNITE_IO_BALANCE_PERIOD, DFLT_IO_BALANCE_PERIOD); + long balancePeriod = IgniteCommonsSystemProperties.getLong( + IgniteCommonsSystemProperties.IGNITE_IO_BALANCE_PERIOD, + IgniteCommonsSystemProperties.DFLT_IO_BALANCE_PERIOD); IgniteRunnable balancer0 = null; if (balancePeriod > 0) { - boolean rndBalance = IgniteSystemProperties.getBoolean(IGNITE_IO_BALANCE_RANDOM_BALANCE, false); + boolean rndBalance = IgniteCommonsSystemProperties.getBoolean(IGNITE_IO_BALANCE_RANDOM_BALANCE, false); if (rndBalance) balancer0 = new RandomBalancer(); @@ -780,7 +778,8 @@ public void resend(GridNioSession ses) { ses0.offerStateChange((GridNioServer.SessionChangeRequest)fut0); } catch (IgniteCheckedException e) { - CommonUtils.error(log, "Failed to notify NIO Server while resending messages [rmtNode=" + recoveryDesc.node().id() + ']', e); + CommonUtils.error(log, + "Failed to notify NIO Server while resending messages [rmtNode=" + recoveryDesc.node().id() + ']', e); } } } From 083a509d7ed9ba459b814c2704c854d8dc9c2464 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 13:12:25 +0300 Subject: [PATCH 089/110] IGNITE-28819 Move DFLT_IDLE_TIMEOUT to GridNioServer; ConnectorConfiguration references it (public API constant kept) Co-Authored-By: Claude Opus 4.8 --- .../ignite/configuration/ConnectorConfiguration.java | 3 ++- .../apache/ignite/internal/util/nio/GridNioServer.java | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java index 00c5413dd374e..238f6ce8c48b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java @@ -21,6 +21,7 @@ import javax.cache.configuration.Factory; import javax.net.ssl.SSLContext; import org.apache.ignite.IgniteSystemProperties; +import org.apache.ignite.internal.util.nio.GridNioServer; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.ssl.SslContextFactory; @@ -40,7 +41,7 @@ public class ConnectorConfiguration { public static final boolean DFLT_TCP_DIRECT_BUF = false; /** Default REST idle timeout. */ - public static final int DFLT_IDLE_TIMEOUT = 7000; + public static final int DFLT_IDLE_TIMEOUT = GridNioServer.DFLT_IDLE_TIMEOUT; /** Default rest port range. */ public static final int DFLT_PORT_RANGE = 100; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index c002ed5c5f0db..d968832bdc5ec 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -51,7 +51,6 @@ import org.apache.ignite.IgniteCommonsSystemProperties; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.managers.communication.GridIoMessage; @@ -118,6 +117,9 @@ public class GridNioServer { /** Default session write timeout. */ public static final int DFLT_SES_WRITE_TIMEOUT = 5000; + /** Default value for {@code idleTimeout} (in milliseconds). */ + public static final int DFLT_IDLE_TIMEOUT = 7000; + /** Default send queue limit. */ public static final int DFLT_SEND_QUEUE_LIMIT = 0; @@ -227,7 +229,7 @@ public class GridNioServer { private volatile long writeTimeout = DFLT_SES_WRITE_TIMEOUT; /** Idle timeout. */ - private volatile long idleTimeout = ConnectorConfiguration.DFLT_IDLE_TIMEOUT; + private volatile long idleTimeout = DFLT_IDLE_TIMEOUT; /** For test purposes only. */ private boolean skipWrite; @@ -1041,7 +1043,7 @@ public void writeTimeout(long writeTimeout) { /** * Gets configurable idle timeout for this session. If not set, default value is - * {@link ConnectorConfiguration#DFLT_IDLE_TIMEOUT}. + * {@link #DFLT_IDLE_TIMEOUT}. * * @return Idle timeout in milliseconds. */ From bf337992a10241f3925f0061e973bb2586ebd3ae Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 13:12:25 +0300 Subject: [PATCH 090/110] IGNITE-28819 Move FailureType to ignite-commons Co-Authored-By: Claude Opus 4.8 --- .../src/main/java/org/apache/ignite/failure/FailureType.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/failure/FailureType.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/failure/FailureType.java b/modules/commons/src/main/java/org/apache/ignite/failure/FailureType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/failure/FailureType.java rename to modules/commons/src/main/java/org/apache/ignite/failure/FailureType.java From 5f33419fb478af41f4316bdeb382c7d1c9d3a01d Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 13:12:25 +0300 Subject: [PATCH 091/110] IGNITE-28819 Move GridCompoundFuture and NodeStoppingException to ignite-commons Introduce ExpectedFailure marker in ignite-commons so GridCompoundFuture can classify benign failures without referencing core exception types. ClusterTopologyCheckedException, IgniteConsistencyViolationException, IgniteTxOptimisticCheckedException and IgniteFutureCancelledCheckedException implement it. Failure-handling behavior is preserved. Co-Authored-By: Claude Opus 4.8 --- .../ignite/internal/ExpectedFailure.java | 29 +++++++++++++++++++ ...IgniteFutureCancelledCheckedException.java | 2 +- .../internal/NodeStoppingException.java | 0 .../util/future/GridCompoundFuture.java | 24 ++++++--------- .../ClusterTopologyCheckedException.java | 3 +- .../IgniteConsistencyViolationException.java | 3 +- .../IgniteTxOptimisticCheckedException.java | 4 ++- 7 files changed, 46 insertions(+), 19 deletions(-) create mode 100644 modules/commons/src/main/java/org/apache/ignite/internal/ExpectedFailure.java rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/NodeStoppingException.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java (92%) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/ExpectedFailure.java b/modules/commons/src/main/java/org/apache/ignite/internal/ExpectedFailure.java new file mode 100644 index 0000000000000..3d632d5cceaaf --- /dev/null +++ b/modules/commons/src/main/java/org/apache/ignite/internal/ExpectedFailure.java @@ -0,0 +1,29 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal; + +/** + * Marker for checked exceptions that represent an expected (benign) failure. + *

+ * Such failures are part of normal operation (e.g. topology changes, optimistic transaction conflicts, + * read-repair consistency violations) and must not be logged as errors when handled generically, + * for example by {@link org.apache.ignite.internal.util.future.GridCompoundFuture}. + */ +public interface ExpectedFailure { + // No-op marker interface. +} diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/IgniteFutureCancelledCheckedException.java b/modules/commons/src/main/java/org/apache/ignite/internal/IgniteFutureCancelledCheckedException.java index 1cec418142dd5..24d712111a8d1 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/IgniteFutureCancelledCheckedException.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/IgniteFutureCancelledCheckedException.java @@ -23,7 +23,7 @@ /** * Future computation cannot be retrieved because it was cancelled. */ -public class IgniteFutureCancelledCheckedException extends IgniteCheckedException { +public class IgniteFutureCancelledCheckedException extends IgniteCheckedException implements ExpectedFailure { /** */ private static final long serialVersionUID = 0L; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/NodeStoppingException.java b/modules/commons/src/main/java/org/apache/ignite/internal/NodeStoppingException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/NodeStoppingException.java rename to modules/commons/src/main/java/org/apache/ignite/internal/NodeStoppingException.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java similarity index 92% rename from modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java index 28e2544921084..8d3b2cefffbb7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java @@ -26,16 +26,13 @@ import java.util.function.Supplier; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.internal.IgniteFutureCancelledCheckedException; +import org.apache.ignite.internal.ExpectedFailure; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.NodeStoppingException; -import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; -import org.apache.ignite.internal.processors.cache.distributed.near.consistency.IgniteConsistencyViolationException; -import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgniteReducer; import org.jetbrains.annotations.Nullable; @@ -117,17 +114,14 @@ public GridCompoundFuture(@Nullable IgniteReducer rdc) { throw e; } } - catch (IgniteTxOptimisticCheckedException | IgniteFutureCancelledCheckedException | - ClusterTopologyCheckedException | IgniteConsistencyViolationException e) { - if (!processFailure(e, fut)) - onDone(e); - } catch (IgniteCheckedException e) { if (!processFailure(e, fut)) { - if (e instanceof NodeStoppingException) - logDebug(logger(), "Failed to execute compound future reducer, node stopped."); - else - logError(null, "Failed to execute compound future reducer: " + this, e); + if (!(e instanceof ExpectedFailure)) { + if (e instanceof NodeStoppingException) + logDebug(logger(), "Failed to execute compound future reducer, node stopped."); + else + logError(null, "Failed to execute compound future reducer: " + this, e); + } onDone(e); } @@ -370,7 +364,7 @@ private void checkComplete() { * @param e Exception. */ protected void logError(IgniteLogger log, String msg, Throwable e) { - U.error(log, msg, e); + CommonUtils.error(log, msg, e); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyCheckedException.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyCheckedException.java index bd194b7acba35..2b7fcab1d26fa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyCheckedException.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterTopologyCheckedException.java @@ -18,13 +18,14 @@ package org.apache.ignite.internal.cluster; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.internal.ExpectedFailure; import org.apache.ignite.internal.IgniteInternalFuture; import org.jetbrains.annotations.Nullable; /** * This exception is used to indicate error with grid topology (e.g., crashed node, etc.). */ -public class ClusterTopologyCheckedException extends IgniteCheckedException { +public class ClusterTopologyCheckedException extends IgniteCheckedException implements ExpectedFailure { /** */ private static final long serialVersionUID = 0L; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/consistency/IgniteConsistencyViolationException.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/consistency/IgniteConsistencyViolationException.java index 95c1a1ea4e1f8..9ba6ed7a6622b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/consistency/IgniteConsistencyViolationException.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/consistency/IgniteConsistencyViolationException.java @@ -19,12 +19,13 @@ import java.util.Set; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.internal.ExpectedFailure; import org.apache.ignite.internal.processors.cache.KeyCacheObject; /** * Consistency violation exception. */ -public abstract class IgniteConsistencyViolationException extends IgniteCheckedException { +public abstract class IgniteConsistencyViolationException extends IgniteCheckedException implements ExpectedFailure { /** * Inconsistent entries keys. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/transactions/IgniteTxOptimisticCheckedException.java b/modules/core/src/main/java/org/apache/ignite/internal/transactions/IgniteTxOptimisticCheckedException.java index 9430dd7c20046..a9b99a841aeee 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/transactions/IgniteTxOptimisticCheckedException.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/transactions/IgniteTxOptimisticCheckedException.java @@ -17,10 +17,12 @@ package org.apache.ignite.internal.transactions; +import org.apache.ignite.internal.ExpectedFailure; + /** * Exception thrown whenever grid transactions fail optimistically. */ -public class IgniteTxOptimisticCheckedException extends TransactionCheckedException { +public class IgniteTxOptimisticCheckedException extends TransactionCheckedException implements ExpectedFailure { /** */ private static final long serialVersionUID = 0L; From c92fea4624ea3e904884977716cd77caeac2895e Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 13:23:05 +0300 Subject: [PATCH 092/110] IGNITE-28819 GridNioServer uses LongConsumer/LongSupplier instead of LongAdderMetric Capture the byte-count metrics as bound method references (longAdderMetric(...)::add) and the outbound queue size as longAdderMetric(...)::value, removing the direct dependency on LongAdderMetric. No boxing and no per-call allocation, so the hot path is unaffected. Co-Authored-By: Claude Opus 4.8 --- .../internal/util/nio/GridNioServer.java | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index d968832bdc5ec..f670c8aca2ccb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -47,6 +47,8 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicLong; +import java.util.function.LongConsumer; +import java.util.function.LongSupplier; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteCommonsSystemProperties; import org.apache.ignite.IgniteException; @@ -55,7 +57,6 @@ import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.managers.communication.GridIoMessage; import org.apache.ignite.internal.processors.metric.MetricRegistryImpl; -import org.apache.ignite.internal.processors.metric.impl.LongAdderMetric; import org.apache.ignite.internal.processors.odbc.ClientMessage; import org.apache.ignite.internal.processors.tracing.MTC; import org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings; @@ -253,13 +254,13 @@ public class GridNioServer { @Nullable private final MetricRegistryImpl mreg; /** Received bytes count metric. */ - @Nullable private final LongAdderMetric rcvdBytesCntMetric; + @Nullable private final LongConsumer rcvdBytesCntMetric; /** Sent bytes count metric. */ - @Nullable private final LongAdderMetric sentBytesCntMetric; + @Nullable private final LongConsumer sentBytesCntMetric; /** Outbound messages queue size. */ - @Nullable private final LongAdderMetric outboundMessagesQueueSizeMetric; + @Nullable private final LongSupplier outboundMessagesQueueSizeMetric; /** Sessions. */ private final GridConcurrentHashSet sessions = new GridConcurrentHashSet<>(); @@ -464,15 +465,15 @@ private GridNioServer( this.mreg = mreg; rcvdBytesCntMetric = mreg == null ? - null : mreg.longAdderMetric(RECEIVED_BYTES_METRIC_NAME, RECEIVED_BYTES_METRIC_DESC); + null : mreg.longAdderMetric(RECEIVED_BYTES_METRIC_NAME, RECEIVED_BYTES_METRIC_DESC)::add; sentBytesCntMetric = mreg == null ? - null : mreg.longAdderMetric(SENT_BYTES_METRIC_NAME, SENT_BYTES_METRIC_DESC); + null : mreg.longAdderMetric(SENT_BYTES_METRIC_NAME, SENT_BYTES_METRIC_DESC)::add; outboundMessagesQueueSizeMetric = mreg == null ? null : mreg.longAdderMetric( OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC - ); + )::value; if (mreg != null) { mreg.register(SESSIONS_CNT_METRIC_NAME, sessions::size, "Active TCP sessions count."); @@ -1249,7 +1250,7 @@ else if (cnt == 0) log.trace("Bytes received [sockCh=" + sockCh + ", cnt=" + cnt + ']'); if (rcvdBytesCntMetric != null) - rcvdBytesCntMetric.add(cnt); + rcvdBytesCntMetric.accept(cnt); ses.bytesReceived(cnt); @@ -1316,7 +1317,7 @@ else if (cnt == 0) span.addTag(SOCKET_WRITE_BYTES, () -> Integer.toString(cnt)); if (sentBytesCntMetric != null) - sentBytesCntMetric.add(cnt); + sentBytesCntMetric.accept(cnt); ses.bytesSent(cnt); } @@ -1418,7 +1419,7 @@ protected DirectNioClientWorker( return; if (rcvdBytesCntMetric != null) - rcvdBytesCntMetric.add(cnt); + rcvdBytesCntMetric.accept(cnt); ses.bytesReceived(cnt); onRead(cnt); @@ -1491,7 +1492,7 @@ private void processWriteSsl(SelectionKey key) throws IOException { int cnt = sockCh.write(sslNetBuf); if (sentBytesCntMetric != null) - sentBytesCntMetric.add(cnt); + sentBytesCntMetric.accept(cnt); ses.bytesSent(cnt); @@ -1578,7 +1579,7 @@ private void processWriteSsl(SelectionKey key) throws IOException { log.trace("Bytes sent [sockCh=" + sockCh + ", cnt=" + cnt + ']'); if (sentBytesCntMetric != null) - sentBytesCntMetric.add(cnt); + sentBytesCntMetric.accept(cnt); ses.bytesSent(cnt); } @@ -1687,7 +1688,7 @@ private boolean writeSslSystem(GridSelectorNioSessionImpl ses, WritableByteChann int cnt = sockCh.write(buf); if (sentBytesCntMetric != null) - sentBytesCntMetric.add(cnt); + sentBytesCntMetric.accept(cnt); ses.bytesSent(cnt); @@ -1778,7 +1779,7 @@ private void processWrite0(SelectionKey key) throws IOException { log.trace("Bytes sent [sockCh=" + sockCh + ", cnt=" + cnt + ']'); if (sentBytesCntMetric != null) - sentBytesCntMetric.add(cnt); + sentBytesCntMetric.accept(cnt); ses.bytesSent(cnt); onWrite(cnt); @@ -3066,7 +3067,7 @@ public int outboundMessagesQueueSize() { if (outboundMessagesQueueSizeMetric == null) return -1; - return (int)outboundMessagesQueueSizeMetric.value(); + return (int)outboundMessagesQueueSizeMetric.getAsLong(); } /** From d4b4e7c42b1995e942cb12a93182d50a4ee5e85f Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 13:40:33 +0300 Subject: [PATCH 093/110] IGNITE-28819 GridSelectorNioSessionImpl takes LongConsumer metrics instead of MetricRegistryImpl Move metric creation to the GridNioServer call site and pass the queue-size and max-queue-size metrics as bound method references (longAdderMetric(...)::add, maxValueMetric(...)::update). Removes LongAdderMetric, MaxValueMetric and MetricRegistryImpl from the session. increment()/decrement()/add()/update() become accept(1)/accept(-1)/accept(n), preserving behavior. Co-Authored-By: Claude Opus 4.8 --- .../internal/util/nio/GridNioServer.java | 5 ++- .../util/nio/GridSelectorNioSessionImpl.java | 45 +++++++------------ 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index f670c8aca2ccb..31b4c1261cb7e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -2783,7 +2783,10 @@ private void register(NioOperationFuture fut) { (InetSocketAddress)sockCh.getRemoteAddress(), fut.accepted(), sndQueueLimit, - mreg, + mreg == null ? null : mreg.longAdderMetric( + OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC)::add, + mreg == null ? null : mreg.maxValueMetric( + MAX_MESSAGES_QUEUE_SIZE_METRIC_NAME, MAX_MESSAGES_QUEUE_SIZE_METRIC_DESC, 60_000, 5)::update, writeBuf, readBuf); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java index 561941903b6b7..9402160a03c65 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java @@ -26,12 +26,10 @@ import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.LongConsumer; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.processors.metric.MetricRegistryImpl; -import org.apache.ignite.internal.processors.metric.impl.LongAdderMetric; -import org.apache.ignite.internal.processors.metric.impl.MaxValueMetric; import org.apache.ignite.internal.processors.tracing.MTC; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.internal.LT; @@ -40,10 +38,6 @@ import org.jetbrains.annotations.Nullable; import static org.apache.ignite.internal.processors.tracing.messages.TraceableMessagesTable.traceName; -import static org.apache.ignite.internal.util.nio.GridNioServer.MAX_MESSAGES_QUEUE_SIZE_METRIC_DESC; -import static org.apache.ignite.internal.util.nio.GridNioServer.MAX_MESSAGES_QUEUE_SIZE_METRIC_NAME; -import static org.apache.ignite.internal.util.nio.GridNioServer.OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC; -import static org.apache.ignite.internal.util.nio.GridNioServer.OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME; /** * Session implementation bound to selector API and socket API. @@ -93,10 +87,10 @@ public class GridSelectorNioSessionImpl extends GridNioSessionImpl implements Gr private volatile boolean closeSocket = true; /** Outbound messages queue size metric. */ - @Nullable private final LongAdderMetric outboundMessagesQueueSizeMetric; + @Nullable private final LongConsumer outboundMessagesQueueSizeMetric; /** Maximum outbound messages queue size metric. */ - @Nullable private final MaxValueMetric maxMessagesQueueSizeMetric; + @Nullable private final LongConsumer maxMessagesQueueSizeMetric; /** * Creates session instance. @@ -108,6 +102,8 @@ public class GridSelectorNioSessionImpl extends GridNioSessionImpl implements Gr * @param rmtAddr Remote address. * @param accepted Accepted flag. * @param sndQueueLimit Send queue limit. + * @param outboundMessagesQueueSizeMetric Outbound messages queue size metric, or {@code null} if metrics disabled. + * @param maxMessagesQueueSizeMetric Maximum outbound messages queue size metric, or {@code null} if metrics disabled. * @param writeBuf Write buffer. * @param readBuf Read buffer. */ @@ -119,7 +115,8 @@ public class GridSelectorNioSessionImpl extends GridNioSessionImpl implements Gr InetSocketAddress rmtAddr, boolean accepted, int sndQueueLimit, - @Nullable MetricRegistryImpl mreg, + @Nullable LongConsumer outboundMessagesQueueSizeMetric, + @Nullable LongConsumer maxMessagesQueueSizeMetric, @Nullable ByteBuffer writeBuf, @Nullable ByteBuffer readBuf ) { @@ -151,17 +148,9 @@ public class GridSelectorNioSessionImpl extends GridNioSessionImpl implements Gr this.readBuf = readBuf; } - outboundMessagesQueueSizeMetric = mreg == null ? null : mreg.longAdderMetric( - OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, - OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC - ); + this.outboundMessagesQueueSizeMetric = outboundMessagesQueueSizeMetric; - maxMessagesQueueSizeMetric = mreg == null ? null : mreg.maxValueMetric( - MAX_MESSAGES_QUEUE_SIZE_METRIC_NAME, - MAX_MESSAGES_QUEUE_SIZE_METRIC_DESC, - 60_000, - 5 - ); + this.maxMessagesQueueSizeMetric = maxMessagesQueueSizeMetric; } /** {@inheritDoc} */ @@ -328,12 +317,12 @@ int offerSystemFuture(SessionWriteRequest writeFut) { assert res : "Future was not added to queue"; if (outboundMessagesQueueSizeMetric != null) - outboundMessagesQueueSizeMetric.increment(); + outboundMessagesQueueSizeMetric.accept(1); if (maxMessagesQueueSizeMetric != null) { int queueSize = queue.sizex(); - maxMessagesQueueSizeMetric.update(queueSize); + maxMessagesQueueSizeMetric.accept(queueSize); return queueSize; } @@ -366,12 +355,12 @@ int offerFuture(SessionWriteRequest writeFut) { assert res : "Future was not added to queue"; if (outboundMessagesQueueSizeMetric != null) - outboundMessagesQueueSizeMetric.increment(); + outboundMessagesQueueSizeMetric.accept(1); if (maxMessagesQueueSizeMetric != null) { int queueSize = queue.sizex(); - maxMessagesQueueSizeMetric.update(queueSize); + maxMessagesQueueSizeMetric.accept(queueSize); return queueSize; } @@ -390,10 +379,10 @@ void resend(Collection futs) { assert add; if (outboundMessagesQueueSizeMetric != null) - outboundMessagesQueueSizeMetric.add(futs.size()); + outboundMessagesQueueSizeMetric.accept(futs.size()); if (maxMessagesQueueSizeMetric != null) - maxMessagesQueueSizeMetric.update(futs.size()); + maxMessagesQueueSizeMetric.accept(futs.size()); } /** @@ -404,7 +393,7 @@ void resend(Collection futs) { if (last != null) { if (outboundMessagesQueueSizeMetric != null) - outboundMessagesQueueSizeMetric.decrement(); + outboundMessagesQueueSizeMetric.accept(-1); if (sem != null && !last.messageThread()) sem.release(); @@ -439,7 +428,7 @@ boolean removeFuture(SessionWriteRequest fut) { boolean rmv = queue.removeLastOccurrence(fut); if (rmv && outboundMessagesQueueSizeMetric != null) - outboundMessagesQueueSizeMetric.decrement(); + outboundMessagesQueueSizeMetric.accept(-1); return rmv; } From cf4954e3a1d21b60568cc2037e9f33b01c6e3b23 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 16:01:02 +0300 Subject: [PATCH 094/110] IGNITE-28819 Read outbound messages queue size from the metric registry, drop GridNioServer.outboundMessagesQueueSize() The size is read in a single place (TcpCommunicationSpi.getOutboundMessagesQueueSize), which already has the communication metric registry via TcpCommunicationMetricsListener. Expose it there and delegate from the SPI, removing the LongSupplier metric and the read method from GridNioServer. Co-Authored-By: Claude Opus 4.8 --- .../internal/util/nio/GridNioServer.java | 21 ------------------- .../tcp/TcpCommunicationMetricsListener.java | 19 +++++++++++++++++ .../tcp/TcpCommunicationSpi.java | 5 +++-- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index 31b4c1261cb7e..f88a01424e9bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -48,7 +48,6 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicLong; import java.util.function.LongConsumer; -import java.util.function.LongSupplier; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteCommonsSystemProperties; import org.apache.ignite.IgniteException; @@ -259,9 +258,6 @@ public class GridNioServer { /** Sent bytes count metric. */ @Nullable private final LongConsumer sentBytesCntMetric; - /** Outbound messages queue size. */ - @Nullable private final LongSupplier outboundMessagesQueueSizeMetric; - /** Sessions. */ private final GridConcurrentHashSet sessions = new GridConcurrentHashSet<>(); @@ -470,11 +466,6 @@ private GridNioServer( sentBytesCntMetric = mreg == null ? null : mreg.longAdderMetric(SENT_BYTES_METRIC_NAME, SENT_BYTES_METRIC_DESC)::add; - outboundMessagesQueueSizeMetric = mreg == null ? null : mreg.longAdderMetric( - OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, - OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC - )::value; - if (mreg != null) { mreg.register(SESSIONS_CNT_METRIC_NAME, sessions::size, "Active TCP sessions count."); @@ -3061,18 +3052,6 @@ final void reset0() { } } - /** - * Gets outbound messages queue size. - * - * @return Write queue size. - */ - public int outboundMessagesQueueSize() { - if (outboundMessagesQueueSizeMetric == null) - return -1; - - return (int)outboundMessagesQueueSizeMetric.getAsLong(); - } - /** * A separate thread that will accept incoming connections and schedule read to some worker. */ diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationMetricsListener.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationMetricsListener.java index 2fb542ceb8be2..4bf17f1a969fd 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationMetricsListener.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationMetricsListener.java @@ -44,6 +44,8 @@ import static java.util.stream.Collectors.toMap; import static org.apache.ignite.internal.processors.metric.impl.MetricUtils.SEPARATOR; import static org.apache.ignite.internal.processors.metric.impl.MetricUtils.metricName; +import static org.apache.ignite.internal.util.nio.GridNioServer.OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC; +import static org.apache.ignite.internal.util.nio.GridNioServer.OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME; import static org.apache.ignite.internal.util.nio.GridNioServer.RECEIVED_BYTES_METRIC_DESC; import static org.apache.ignite.internal.util.nio.GridNioServer.RECEIVED_BYTES_METRIC_NAME; import static org.apache.ignite.internal.util.nio.GridNioServer.SENT_BYTES_METRIC_DESC; @@ -105,6 +107,9 @@ public class TcpCommunicationMetricsListener { /** Received messages count metric. */ private final LongAdderMetric rcvdMsgsMetric; + /** Outbound messages queue size metric. */ + private final LongAdderMetric outboundMessagesQueueSizeMetric; + /** Counters of sent and received messages by direct type. */ private final IntMap> msgCntrsByType; @@ -146,6 +151,11 @@ public TcpCommunicationMetricsListener(Ignite ignite, IgniteSpiContext spiCtx) { sentMsgsMetric = mreg.longAdderMetric(SENT_MESSAGES_METRIC_NAME, SENT_MESSAGES_METRIC_DESC); rcvdMsgsMetric = mreg.longAdderMetric(RECEIVED_MESSAGES_METRIC_NAME, RECEIVED_MESSAGES_METRIC_DESC); + outboundMessagesQueueSizeMetric = mreg.longAdderMetric( + OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, + OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC + ); + spiCtx.addMetricRegistryCreationListener(mreg -> { // Metrics for the specific nodes or other communication metrics. if (!TcpCommunicationSpi.isCommunicationMetrics(mreg.name())) @@ -276,6 +286,15 @@ public long receivedBytesCount() { return rcvdBytesMetric.value(); } + /** + * Gets outbound messages queue size. + * + * @return Outbound messages queue size. + */ + public int outboundMessagesQueueSize() { + return (int)outboundMessagesQueueSizeMetric.value(); + } + /** * Gets received messages counts (grouped by type). * diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java index f9ab18727eada..4bcae5a26a29b 100755 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java @@ -411,9 +411,10 @@ public static boolean isCommunicationMetrics(String metricName) { /** {@inheritDoc} */ @Override public int getOutboundMessagesQueueSize() { - GridNioServer srv = nioSrvWrapper.nio(); + if (metricsLsnr == null) + return 0; - return srv != null ? srv.outboundMessagesQueueSize() : 0; + return metricsLsnr.outboundMessagesQueueSize(); } /** {@inheritDoc} */ From 45ca158d007cbe000a8900e7f3e1f9a182fae522 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 16:35:48 +0300 Subject: [PATCH 095/110] IGNITE-28819 Hoist per-session queue-size metric consumers into GridNioServer fields The outbound and max queue-size metrics were rebuilt from the registry on every session creation; since the metric names are constant the registry returns the same instance, so cache them once as final LongConsumer fields in the constructor and pass them to each session. Removes the last reads of the mreg instance field, so the field is dropped (mreg remains only as a constructor parameter and in the Builder). Co-Authored-By: Claude Opus 4.8 --- .../internal/util/nio/GridNioServer.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index f88a01424e9bb..b3ff7e79df563 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -249,15 +249,18 @@ public class GridNioServer { /** Whether direct mode is used. */ private final boolean directMode; - /** */ - @Nullable private final MetricRegistryImpl mreg; - /** Received bytes count metric. */ @Nullable private final LongConsumer rcvdBytesCntMetric; /** Sent bytes count metric. */ @Nullable private final LongConsumer sentBytesCntMetric; + /** Per-session outbound messages queue size metric. */ + @Nullable private final LongConsumer outboundMessagesQueueSizeMetric; + + /** Per-session maximum outbound messages queue size metric. */ + @Nullable private final LongConsumer maxMessagesQueueSizeMetric; + /** Sessions. */ private final GridConcurrentHashSet sessions = new GridConcurrentHashSet<>(); @@ -458,14 +461,18 @@ private GridNioServer( this.balancer = balancer0; - this.mreg = mreg; - rcvdBytesCntMetric = mreg == null ? null : mreg.longAdderMetric(RECEIVED_BYTES_METRIC_NAME, RECEIVED_BYTES_METRIC_DESC)::add; sentBytesCntMetric = mreg == null ? null : mreg.longAdderMetric(SENT_BYTES_METRIC_NAME, SENT_BYTES_METRIC_DESC)::add; + outboundMessagesQueueSizeMetric = mreg == null ? null : mreg.longAdderMetric( + OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC)::add; + + maxMessagesQueueSizeMetric = mreg == null ? null : mreg.maxValueMetric( + MAX_MESSAGES_QUEUE_SIZE_METRIC_NAME, MAX_MESSAGES_QUEUE_SIZE_METRIC_DESC, 60_000, 5)::update; + if (mreg != null) { mreg.register(SESSIONS_CNT_METRIC_NAME, sessions::size, "Active TCP sessions count."); @@ -2774,10 +2781,8 @@ private void register(NioOperationFuture fut) { (InetSocketAddress)sockCh.getRemoteAddress(), fut.accepted(), sndQueueLimit, - mreg == null ? null : mreg.longAdderMetric( - OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC)::add, - mreg == null ? null : mreg.maxValueMetric( - MAX_MESSAGES_QUEUE_SIZE_METRIC_NAME, MAX_MESSAGES_QUEUE_SIZE_METRIC_DESC, 60_000, 5)::update, + outboundMessagesQueueSizeMetric, + maxMessagesQueueSizeMetric, writeBuf, readBuf); From ded287440af4c07017ae69243a93e735c51d43b8 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 17:34:54 +0300 Subject: [PATCH 096/110] IGNITE-28819 Eliminate MetricRegistryImpl from GridNioServer Move metric registration out of GridNioServer into the callers via IgniteUtils helpers: setNioServerMetrics (byte counters + queue-size consumers), registerSslEnabledMetric (SslEnabled gauge) and registerActiveSessionsMetric (ActiveSessionsCount gauge, backed by the new GridNioServer.activeTcpSessionsCount). GridNioServer no longer references the metric registry: the mreg constructor parameter, Builder field and metricRegistry() setter are removed. Co-Authored-By: Claude Opus 4.8 --- .../odbc/ClientListenerProcessor.java | 10 +- .../protocols/tcp/GridTcpRestProtocol.java | 13 ++- .../ignite/internal/util/IgniteUtils.java | 39 ++++++++ .../internal/util/nio/GridNioServer.java | 94 +++++++++++++------ .../tcp/internal/GridNioServerWrapper.java | 18 +++- 5 files changed, 134 insertions(+), 40 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java index 68af9dfe14aeb..22cc66e1dbb07 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java @@ -194,7 +194,7 @@ public ClientListenerProcessor(GridKernalContext ctx) { for (int port = cliConnCfg.getPort(); port <= portTo && port <= 65535; port++) { try { - srv = GridNioServer.builder() + GridNioServer.Builder builder = GridNioServer.builder() .address(hostAddr) .port(port) .listener(new ClientListenerNioListener(ctx, busyLock, cliConnCfg, metrics, newConnEnabled)) @@ -210,9 +210,11 @@ public ClientListenerProcessor(GridKernalContext ctx) { .filters(filters) .directMode(true) .idleTimeout(idleTimeout > 0 ? idleTimeout : Long.MAX_VALUE) - .metricRegistry(mreg) - .messageQueueSizeListener(msgQueueSizeLsnr) - .build(); + .messageQueueSizeListener(msgQueueSizeLsnr); + + srv = U.setNioServerMetrics(builder, mreg).build(); + + U.registerNioServerMetrics(srv, filters, mreg); ctx.ports().registerPort(port, IgnitePortProtocol.TCP, getClass()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java index a1aaa0910dd55..19cbf94f9e72c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java @@ -36,6 +36,7 @@ import org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller; import org.apache.ignite.internal.client.marshaller.optimized.GridClientOptimizedMarshaller; import org.apache.ignite.internal.client.marshaller.optimized.GridClientZipOptimizedMarshaller; +import org.apache.ignite.internal.processors.metric.MetricRegistryImpl; import org.apache.ignite.internal.processors.rest.GridRestProtocolHandler; import org.apache.ignite.internal.processors.rest.client.message.GridClientMessage; import org.apache.ignite.internal.processors.rest.protocols.GridRestProtocolAdapter; @@ -232,7 +233,9 @@ private boolean startTcpServer(InetAddress hostAddr, int port, GridNioServerList else filters = new GridNioFilter[] { codec }; - srv = GridNioServer.builder() + MetricRegistryImpl mreg = ctx.metric().registry(REST_CONNECTOR_METRIC_REGISTRY_NAME); + + GridNioServer.Builder builder = GridNioServer.builder() .address(hostAddr) .port(port) .listener(lsnr) @@ -247,9 +250,11 @@ private boolean startTcpServer(InetAddress hostAddr, int port, GridNioServerList .socketReceiveBufferSize(cfg.getReceiveBufferSize()) .sendQueueLimit(cfg.getSendQueueLimit()) .filters(filters) - .directMode(false) - .metricRegistry(ctx.metric().registry(REST_CONNECTOR_METRIC_REGISTRY_NAME)) - .build(); + .directMode(false); + + srv = U.setNioServerMetrics(builder, mreg).build(); + + U.registerNioServerMetrics(srv, filters, mreg); srv.idleTimeout(cfg.getIdleTimeout()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index ff0f77e86c404..dcb69d6e03bc7 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -186,6 +186,7 @@ import org.apache.ignite.internal.processors.cache.CacheObjectContext; import org.apache.ignite.internal.processors.cache.GridCacheSharedContext; import org.apache.ignite.internal.processors.cache.IgnitePeerToPeerClassLoadingException; +import org.apache.ignite.internal.processors.metric.MetricRegistryImpl; import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException; import org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException; import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException; @@ -194,6 +195,9 @@ import org.apache.ignite.internal.util.future.IgniteFutureImpl; import org.apache.ignite.internal.util.lang.GridPeerDeployAware; import org.apache.ignite.internal.util.lang.IgniteThrowableFunction; +import org.apache.ignite.internal.util.nio.GridNioFilter; +import org.apache.ignite.internal.util.nio.GridNioServer; +import org.apache.ignite.internal.util.nio.ssl.GridNioSslFilter; import org.apache.ignite.internal.util.typedef.C1; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.G; @@ -7790,4 +7794,39 @@ public static DiscoveryCustomMessage unwrapCustomMessage(DiscoverySpiCustomMessa return msg instanceof SecurityAwareCustomMessageWrapper ? ((SecurityAwareCustomMessageWrapper)msg).delegate() : (DiscoveryCustomMessage)msg; } + + /** + * Sets the received/sent bytes and per-session queue-size metric consumers on the given NIO server builder, + * creating the underlying metrics in the provided registry. + * + * @param builder NIO server builder. + * @param mreg Metric registry. + * @return The given builder for chaining. + */ + public static GridNioServer.Builder setNioServerMetrics(GridNioServer.Builder builder, MetricRegistryImpl mreg) { + return builder + .receivedBytesMetric(mreg.longAdderMetric( + GridNioServer.RECEIVED_BYTES_METRIC_NAME, GridNioServer.RECEIVED_BYTES_METRIC_DESC)::add) + .sentBytesMetric(mreg.longAdderMetric( + GridNioServer.SENT_BYTES_METRIC_NAME, GridNioServer.SENT_BYTES_METRIC_DESC)::add) + .outboundMessagesQueueSizeMetric(mreg.longAdderMetric( + GridNioServer.OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, + GridNioServer.OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC)::add) + .maxMessagesQueueSizeMetric(mreg.maxValueMetric( + GridNioServer.MAX_MESSAGES_QUEUE_SIZE_METRIC_NAME, + GridNioServer.MAX_MESSAGES_QUEUE_SIZE_METRIC_DESC, 60_000, 5)::update); + } + + /** + * Registers the active TCP sessions count metric in the given registry, backed by the NIO server. + * + * @param srv NIO server. + * @param mreg Metric registry. + */ + public static void registerNioServerMetrics(GridNioServer srv, GridNioFilter[] filters, MetricRegistryImpl mreg) { + boolean sslEnabled = Arrays.stream(filters).anyMatch(filter -> filter instanceof GridNioSslFilter); + + mreg.register(GridNioServer.SSL_ENABLED_METRIC_NAME, () -> sslEnabled, "Whether SSL is enabled"); + mreg.register(GridNioServer.SESSIONS_CNT_METRIC_NAME, srv::activeTcpSessionsCount, "Active TCP sessions count."); + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index b3ff7e79df563..670ba06be1bb3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -55,7 +55,6 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.managers.communication.GridIoMessage; -import org.apache.ignite.internal.processors.metric.MetricRegistryImpl; import org.apache.ignite.internal.processors.odbc.ClientMessage; import org.apache.ignite.internal.processors.tracing.MTC; import org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings; @@ -323,7 +322,10 @@ public class GridNioServer { * @param msgQueueLsnr Message queue size listener. * @param readWriteSelectorsAssign If {@code true} then in/out connections are assigned to even/odd workers. * @param workerLsnr Worker lifecycle listener. - * @param mreg Metrics registry. + * @param rcvdBytesCntMetric Received bytes count metric, or {@code null} if metrics disabled. + * @param sentBytesCntMetric Sent bytes count metric, or {@code null} if metrics disabled. + * @param outboundMessagesQueueSizeMetric Per-session outbound messages queue size metric, or {@code null} if metrics disabled. + * @param maxMessagesQueueSizeMetric Per-session maximum outbound messages queue size metric, or {@code null} if metrics disabled. * @param filters Filters for this server. * @throws IgniteCheckedException If failed. */ @@ -349,7 +351,10 @@ private GridNioServer( IgniteBiInClosure msgQueueLsnr, boolean readWriteSelectorsAssign, @Nullable GridWorkerListener workerLsnr, - @Nullable MetricRegistryImpl mreg, + @Nullable LongConsumer rcvdBytesCntMetric, + @Nullable LongConsumer sentBytesCntMetric, + @Nullable LongConsumer outboundMessagesQueueSizeMetric, + @Nullable LongConsumer maxMessagesQueueSizeMetric, SpanManager tracing, MessageFactory msgFactory, GridNioFilter... filters @@ -378,6 +383,10 @@ private GridNioServer( this.selectorSpins = selectorSpins; this.readWriteSelectorsAssign = readWriteSelectorsAssign; this.lsnr = lsnr; + this.rcvdBytesCntMetric = rcvdBytesCntMetric; + this.sentBytesCntMetric = sentBytesCntMetric; + this.outboundMessagesQueueSizeMetric = outboundMessagesQueueSizeMetric; + this.maxMessagesQueueSizeMetric = maxMessagesQueueSizeMetric; this.tracing = tracing == null ? new NoopSpanManager() : tracing; this.msgFactory = msgFactory; @@ -460,26 +469,13 @@ private GridNioServer( } this.balancer = balancer0; + } - rcvdBytesCntMetric = mreg == null ? - null : mreg.longAdderMetric(RECEIVED_BYTES_METRIC_NAME, RECEIVED_BYTES_METRIC_DESC)::add; - - sentBytesCntMetric = mreg == null ? - null : mreg.longAdderMetric(SENT_BYTES_METRIC_NAME, SENT_BYTES_METRIC_DESC)::add; - - outboundMessagesQueueSizeMetric = mreg == null ? null : mreg.longAdderMetric( - OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC)::add; - - maxMessagesQueueSizeMetric = mreg == null ? null : mreg.maxValueMetric( - MAX_MESSAGES_QUEUE_SIZE_METRIC_NAME, MAX_MESSAGES_QUEUE_SIZE_METRIC_DESC, 60_000, 5)::update; - - if (mreg != null) { - mreg.register(SESSIONS_CNT_METRIC_NAME, sessions::size, "Active TCP sessions count."); - - boolean sslEnabled = Arrays.stream(filters).anyMatch(filter -> filter instanceof GridNioSslFilter); - - mreg.register(SSL_ENABLED_METRIC_NAME, () -> sslEnabled, "Whether SSL is enabled"); - } + /** + * @return Number of active TCP sessions. + */ + public int activeTcpSessionsCount() { + return sessions.size(); } /** @@ -3934,8 +3930,17 @@ public static class Builder { /** Worker lifecycle listener to be used by server's worker threads. */ private GridWorkerListener workerLsnr; - /** Metrics registry. */ - private MetricRegistryImpl mreg; + /** Received bytes count metric. */ + private LongConsumer rcvdBytesCntMetric; + + /** Sent bytes count metric. */ + private LongConsumer sentBytesCntMetric; + + /** Per-session outbound messages queue size metric. */ + private LongConsumer outboundMessagesQueueSizeMetric; + + /** Per-session maximum outbound messages queue size metric. */ + private LongConsumer maxMessagesQueueSizeMetric; /** Span manager */ private SpanManager tracing; @@ -3972,7 +3977,10 @@ public GridNioServer build() throws IgniteCheckedException { msgQueueLsnr, readWriteSelectorsAssign, workerLsnr, - mreg, + rcvdBytesCntMetric, + sentBytesCntMetric, + outboundMessagesQueueSizeMetric, + maxMessagesQueueSizeMetric, tracing, msgFactory, filters != null ? Arrays.copyOf(filters, filters.length) : EMPTY_FILTERS @@ -4241,11 +4249,41 @@ public Builder workerListener(GridWorkerListener workerLsnr) { } /** - * @param mreg Metrics registry. + * @param rcvdBytesCntMetric Received bytes count metric. + * @return This for chaining. + */ + public Builder receivedBytesMetric(LongConsumer rcvdBytesCntMetric) { + this.rcvdBytesCntMetric = rcvdBytesCntMetric; + + return this; + } + + /** + * @param sentBytesCntMetric Sent bytes count metric. + * @return This for chaining. + */ + public Builder sentBytesMetric(LongConsumer sentBytesCntMetric) { + this.sentBytesCntMetric = sentBytesCntMetric; + + return this; + } + + /** + * @param outboundMessagesQueueSizeMetric Per-session outbound messages queue size metric. + * @return This for chaining. + */ + public Builder outboundMessagesQueueSizeMetric(LongConsumer outboundMessagesQueueSizeMetric) { + this.outboundMessagesQueueSizeMetric = outboundMessagesQueueSizeMetric; + + return this; + } + + /** + * @param maxMessagesQueueSizeMetric Per-session maximum outbound messages queue size metric. * @return This for chaining. */ - public Builder metricRegistry(MetricRegistryImpl mreg) { - this.mreg = mreg; + public Builder maxMessagesQueueSizeMetric(LongConsumer maxMessagesQueueSizeMetric) { + this.maxMessagesQueueSizeMetric = maxMessagesQueueSizeMetric; return this; } diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java index df7935c6c2f41..30f8f2596d45d 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java @@ -56,6 +56,7 @@ import org.apache.ignite.internal.managers.GridManager; import org.apache.ignite.internal.managers.tracing.GridTracingManager; import org.apache.ignite.internal.processors.metric.GridMetricManager; +import org.apache.ignite.internal.processors.metric.MetricRegistryImpl; import org.apache.ignite.internal.processors.tracing.Tracing; import org.apache.ignite.internal.util.GridConcurrentFactory; import org.apache.ignite.internal.util.IgniteExceptionRegistry; @@ -924,6 +925,11 @@ private MessageFactory get() { filters.add(sslFilter); } + GridNioFilter[] filtersArr = filters.toArray(new GridNioFilter[filters.size()]); + + MetricRegistryImpl mreg = metricMgr != null ? + metricMgr.registry(COMMUNICATION_METRICS_GROUP_NAME) : null; + GridNioServer.Builder builder = GridNioServer.builder() .address(cfg.localHost()) .port(port) @@ -941,7 +947,7 @@ private MessageFactory get() { .directMode(true) .writeTimeout(cfg.socketWriteTimeout()) .selectorSpins(cfg.selectorSpins()) - .filters(filters.toArray(new GridNioFilter[filters.size()])) + .filters(filtersArr) .writerFactory(writerFactory) .skipRecoveryPredicate(skipRecoveryPred) .messageQueueSizeListener(queueSizeMonitor) @@ -949,13 +955,17 @@ private MessageFactory get() { .readWriteSelectorsAssign(cfg.usePairedConnections()) .messageFactory(msgFactory); - if (metricMgr != null) { - builder.workerListener(workersRegistry) - .metricRegistry(metricMgr.registry(COMMUNICATION_METRICS_GROUP_NAME)); + if (mreg != null) { + builder.workerListener(workersRegistry); + + U.setNioServerMetrics(builder, mreg); } GridNioServer srvr = builder.build(); + if (mreg != null) + U.registerNioServerMetrics(srvr, filtersArr, mreg); + cfg.boundTcpPort(port); // Ack Port the TCP server was bound to. From d7037f56e6259c31adb81858538df40d028de41b Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 19:47:22 +0300 Subject: [PATCH 097/110] IGNITE-28819 Move communication Message API interfaces to ignite-binary-api and shared types to ignite-commons Move MessageFactory, MessageReader, MessageWriter and MessageSerializer to ignite-binary-api (they reference IgniteUuid/CacheObject/KeyCacheObject which live there). Move the shared MessageType, MessageCollectionItemType, MessageArrayType, MessageCollectionType, MessageMapType enums and GridLongList to ignite-commons, and relocate EMPTY_LONGS from IgniteUtils to CommonUtils (still inherited by IgniteUtils). Co-Authored-By: Claude Opus 4.8 --- .../ignite/plugin/extensions/communication/MessageFactory.java | 0 .../ignite/plugin/extensions/communication/MessageReader.java | 0 .../plugin/extensions/communication/MessageSerializer.java | 0 .../ignite/plugin/extensions/communication/MessageWriter.java | 0 .../main/java/org/apache/ignite/internal/util/CommonUtils.java | 3 +++ .../java/org/apache/ignite/internal/util/GridLongList.java | 2 +- .../plugin/extensions/communication/MessageArrayType.java | 0 .../extensions/communication/MessageCollectionItemType.java | 0 .../plugin/extensions/communication/MessageCollectionType.java | 0 .../ignite/plugin/extensions/communication/MessageMapType.java | 0 .../ignite/plugin/extensions/communication/MessageType.java | 0 .../main/java/org/apache/ignite/internal/util/IgniteUtils.java | 3 --- 12 files changed, 4 insertions(+), 4 deletions(-) rename modules/{core => binary/api}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageFactory.java (100%) rename modules/{core => binary/api}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java (100%) rename modules/{core => binary/api}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageSerializer.java (100%) rename modules/{core => binary/api}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/GridLongList.java (99%) rename modules/{core => commons}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageArrayType.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionItemType.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionType.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageMapType.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageType.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageFactory.java b/modules/binary/api/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageFactory.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageFactory.java rename to modules/binary/api/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageFactory.java diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java b/modules/binary/api/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java rename to modules/binary/api/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageSerializer.java b/modules/binary/api/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageSerializer.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageSerializer.java rename to modules/binary/api/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageSerializer.java diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java b/modules/binary/api/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java rename to modules/binary/api/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index 6579d5e8480e3..3f9371fc79476 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -102,6 +102,9 @@ * Collection of utility methods used in 'ignite-commons' and throughout the system. */ public abstract class CommonUtils { + /** Empty longs array. */ + public static final long[] EMPTY_LONGS = new long[0]; + /** */ public static final long KB = 1024L; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/GridLongList.java similarity index 99% rename from modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/GridLongList.java index 27f5dfc13b5a2..ba69dcaba6d0a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/GridLongList.java @@ -26,7 +26,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.SB; -import static org.apache.ignite.internal.util.IgniteUtils.EMPTY_LONGS; +import static org.apache.ignite.internal.util.CommonUtils.EMPTY_LONGS; /** * Minimal list API to work with primitive longs. This list exists diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageArrayType.java b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageArrayType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageArrayType.java rename to modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageArrayType.java diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionItemType.java b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionItemType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionItemType.java rename to modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionItemType.java diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionType.java b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionType.java rename to modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageCollectionType.java diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageMapType.java b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageMapType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageMapType.java rename to modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageMapType.java diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageType.java b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageType.java rename to modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageType.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index dcb69d6e03bc7..de291ac036f3b 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -294,9 +294,6 @@ public abstract class IgniteUtils extends CommonUtils { /** Empty integers array. */ public static final int[] EMPTY_INTS = new int[0]; - /** Empty longs array. */ - public static final long[] EMPTY_LONGS = new long[0]; - /** Empty strings array. */ public static final String[] EMPTY_STRS = new String[0]; From 62b6f5a5b8f4cb64a45f9eee893933379d5f65dc Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 19:53:13 +0300 Subject: [PATCH 098/110] IGNITE-28819 ignite-nio depends on ignite-binary-api Add the ignite-binary-api dependency to the ignite-nio module so the communication Message API (MessageFactory/Reader/Writer/Serializer, now in binary-api) is visible to NIO classes that will be moved into this module. Co-Authored-By: Claude Opus 4.8 --- modules/nio/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/nio/pom.xml b/modules/nio/pom.xml index c68cad4a7096d..7462683449e82 100644 --- a/modules/nio/pom.xml +++ b/modules/nio/pom.xml @@ -41,6 +41,12 @@ provided + + ${project.groupId} + ignite-binary-api + provided + + org.jetbrains annotations From ed52c0a9929616f95d67c5477ea632ce69ce990b Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 20:01:29 +0300 Subject: [PATCH 099/110] IGNITE-28819 Decouple GridNioServer from GridIoMessage and ClientMessage via marker interfaces Introduce two marker interfaces in ignite-commons: MessageContainer (a message that wraps another message, implemented by GridIoMessage) and SelfSerializingMessage (a message that serializes itself directly to a ByteBuffer, implemented by ClientMessage). GridNioServer now references the markers instead of the concrete core message classes, removing its last cross-module core dependencies (only same-package nio types remain). Co-Authored-By: Claude Opus 4.8 --- .../communication/MessageContainer.java | 28 ++++++++++++++++ .../communication/SelfSerializingMessage.java | 33 +++++++++++++++++++ .../managers/communication/GridIoMessage.java | 9 +++-- .../processors/odbc/ClientMessage.java | 13 +++----- .../internal/util/nio/GridNioServer.java | 20 +++++------ 5 files changed, 79 insertions(+), 24 deletions(-) create mode 100644 modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageContainer.java create mode 100644 modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/SelfSerializingMessage.java diff --git a/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageContainer.java b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageContainer.java new file mode 100644 index 0000000000000..43c8f180de2d4 --- /dev/null +++ b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageContainer.java @@ -0,0 +1,28 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.plugin.extensions.communication; + +/** + * A message that wraps (contains) another message. + */ +public interface MessageContainer { + /** + * @return The wrapped message. + */ + public Message message(); +} diff --git a/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/SelfSerializingMessage.java b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/SelfSerializingMessage.java new file mode 100644 index 0000000000000..f7a8cc80ff6a6 --- /dev/null +++ b/modules/commons/src/main/java/org/apache/ignite/plugin/extensions/communication/SelfSerializingMessage.java @@ -0,0 +1,33 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.plugin.extensions.communication; + +import java.nio.ByteBuffer; + +/** + * A message that serializes itself directly to a {@link ByteBuffer}, without a message factory or serializer. + */ +public interface SelfSerializingMessage extends Message { + /** + * Writes this message to the provided byte buffer. + * + * @param buf Byte buffer. + * @return {@code True} if the message was fully written. + */ + public boolean writeTo(ByteBuffer buf); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java index cb09122415def..846b3c721ea1f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java @@ -27,12 +27,13 @@ import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.plugin.extensions.communication.Message; +import org.apache.ignite.plugin.extensions.communication.MessageContainer; import org.jetbrains.annotations.Nullable; /** * Wrapper for all grid messages. */ -public class GridIoMessage implements Message, SpanTransport { +public class GridIoMessage implements Message, SpanTransport, MessageContainer { /** */ public static final Integer STRIPE_DISABLED_PART = Integer.MIN_VALUE; @@ -125,10 +126,8 @@ int topicOrdinal() { return GridTopicMessage.ordinal(topicMsg); } - /** - * @return Message. - */ - public Message message() { + /** {@inheritDoc} */ + @Override public Message message() { return msg; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientMessage.java index ec592ad63f1c7..4e8a3a9187da3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientMessage.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientMessage.java @@ -24,10 +24,10 @@ import java.nio.ByteBuffer; import org.apache.ignite.internal.binary.streams.BinaryOutputStream; import org.apache.ignite.internal.util.typedef.internal.U; -import org.apache.ignite.plugin.extensions.communication.Message; +import org.apache.ignite.plugin.extensions.communication.SelfSerializingMessage; /** */ -public class ClientMessage implements Message, Externalizable { +public class ClientMessage implements SelfSerializingMessage, Externalizable { /** */ private static final long serialVersionUID = -4609408156037304495L; @@ -81,13 +81,8 @@ public ClientMessage(BinaryOutputStream stream) { isFirstMessage = false; } - /** - * Writes this message to provided byte buffer. - * - * @param buf Byte buffer. - * @return Whether message was fully written. - */ - public boolean writeTo(ByteBuffer buf) { + /** {@inheritDoc} */ + @Override public boolean writeTo(ByteBuffer buf) { assert stream != null || data != null; byte[] data = stream != null ? stream.array() : this.data; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index 670ba06be1bb3..4849946d76d4c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -54,8 +54,6 @@ import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteInterruptedCheckedException; -import org.apache.ignite.internal.managers.communication.GridIoMessage; -import org.apache.ignite.internal.processors.odbc.ClientMessage; import org.apache.ignite.internal.processors.tracing.MTC; import org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings; import org.apache.ignite.internal.processors.tracing.NoopSpan; @@ -84,10 +82,12 @@ import org.apache.ignite.lang.IgniteReducer; import org.apache.ignite.lang.IgniteRunnable; import org.apache.ignite.plugin.extensions.communication.Message; +import org.apache.ignite.plugin.extensions.communication.MessageContainer; import org.apache.ignite.plugin.extensions.communication.MessageFactory; import org.apache.ignite.plugin.extensions.communication.MessageReader; import org.apache.ignite.plugin.extensions.communication.MessageSerializer; import org.apache.ignite.plugin.extensions.communication.MessageWriter; +import org.apache.ignite.plugin.extensions.communication.SelfSerializingMessage; import org.apache.ignite.thread.IgniteThread; import org.jetbrains.annotations.Nullable; @@ -1638,9 +1638,9 @@ private boolean writeToBuffer( int startPos = buf.position(); if (messageFactory() == null) { - assert msg instanceof ClientMessage; // TODO: Will refactor in IGNITE-26554. + assert msg instanceof SelfSerializingMessage; // TODO: Will refactor in IGNITE-26554. - finished = ((ClientMessage)msg).writeTo(buf); + finished = ((SelfSerializingMessage)msg).writeTo(buf); } else { MessageSerializer msgSer = messageFactory().serializer(msg.directType()); @@ -1839,9 +1839,9 @@ private boolean writeToBuffer(GridSelectorNioSessionImpl ses, ByteBuffer buf, Se int startPos = buf.position(); if (msgFactory == null) { - assert msg instanceof ClientMessage; // TODO: Will refactor in IGNITE-26554. + assert msg instanceof SelfSerializingMessage; // TODO: Will refactor in IGNITE-26554. - finished = ((ClientMessage)msg).writeTo(buf); + finished = ((SelfSerializingMessage)msg).writeTo(buf); } else { MessageSerializer msgSer = msgFactory.serializer(msg.directType()); @@ -2501,8 +2501,8 @@ private void dumpStats(StringBuilder sb, Object msg = req.message(); - if (shortInfo && msg instanceof GridIoMessage) - msg = ((GridIoMessage)msg).message().getClass().getSimpleName(); + if (shortInfo && msg instanceof MessageContainer) + msg = ((MessageContainer)msg).message().getClass().getSimpleName(); sb.append(msg); @@ -2545,8 +2545,8 @@ private void dumpStats(StringBuilder sb, for (SessionWriteRequest req : ses.writeQueue()) { Object msg = req.message(); - if (shortInfo && msg instanceof GridIoMessage) - msg = ((GridIoMessage)msg).message().getClass().getSimpleName(); + if (shortInfo && msg instanceof MessageContainer) + msg = ((MessageContainer)msg).message().getClass().getSimpleName(); if (cnt == 0) sb.append(",\n opQueue=[").append(msg); From 363502593dd82df9fa9f571efd7e4e8ff86123c1 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 20:06:07 +0300 Subject: [PATCH 100/110] IGNITE-28819 Move IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT to IgniteCommonsSystemProperties Relocate the property and its DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT default to IgniteCommonsSystemProperties; GridNioRecoveryDescriptor uses IgniteCommonsSystemProperties, removing its IgniteSystemProperties dependency. Co-Authored-By: Claude Opus 4.8 --- .../apache/ignite/IgniteCommonsSystemProperties.java | 11 +++++++++++ .../org/apache/ignite/IgniteSystemProperties.java | 8 -------- .../internal/util/nio/GridNioRecoveryDescriptor.java | 10 ++++------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java b/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java index 0a691a5de86bd..ec443398ce3e4 100644 --- a/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java +++ b/modules/commons/src/main/java/org/apache/ignite/IgniteCommonsSystemProperties.java @@ -204,6 +204,17 @@ public class IgniteCommonsSystemProperties { defaults = "" + DFLT_IO_BALANCE_PERIOD) public static final String IGNITE_IO_BALANCE_PERIOD = "IGNITE_IO_BALANCE_PERIOD"; + /** Default timeout for TCP client recovery descriptor reservation. */ + public static final int DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT = 5_000; + + /** + * Sets timeout for TCP client recovery descriptor reservation. + */ + @SystemProperty(value = "Timeout for TCP client recovery descriptor reservation in milliseconds", + type = Long.class, defaults = "" + DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT) + public static final String IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT = + "IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT"; + /** * @param enumCls Enum type. * @param name Name of the system property or environment variable. diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java index a7cebfcd022f5..430f5bfbf734f 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java @@ -133,7 +133,6 @@ import static org.apache.ignite.internal.util.GridReflectionCache.DFLT_REFLECTION_CACHE_SIZE; import static org.apache.ignite.internal.util.IgniteExceptionRegistry.DEFAULT_QUEUE_SIZE; import static org.apache.ignite.internal.util.IgniteUtils.DFLT_MBEAN_APPEND_CLASS_LOADER_ID; -import static org.apache.ignite.internal.util.nio.GridNioRecoveryDescriptor.DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT; import static org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.DFLT_DISCOVERY_CLIENT_RECONNECT_HISTORY_SIZE; import static org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.DFLT_DISCOVERY_METRICS_QNT_WARN; import static org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.DFLT_DISCO_FAILED_CLIENT_RECONNECT_DELAY; @@ -1300,13 +1299,6 @@ public final class IgniteSystemProperties extends IgniteCommonsSystemProperties public static final String IGNITE_DISABLE_REBALANCING_CANCELLATION_OPTIMIZATION = "IGNITE_DISABLE_REBALANCING_CANCELLATION_OPTIMIZATION"; - /** - * Sets timeout for TCP client recovery descriptor reservation. - */ - @SystemProperty(value = "Timeout for TCP client recovery descriptor reservation in milliseconds", - type = Long.class, defaults = "" + DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT) - public static final String IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT = - "IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT"; /** * When set to {@code true}, Ignite will skip partitions sizes check on partition validation after rebalance has finished. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java index 1cedb7d800ee4..4223821a42eb9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.util.ArrayDeque; import java.util.Deque; +import org.apache.ignite.IgniteCommonsSystemProperties; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.internal.S; @@ -30,18 +30,16 @@ import org.apache.ignite.lang.IgniteInClosure; import org.jetbrains.annotations.Nullable; -import static org.apache.ignite.IgniteSystemProperties.IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT; +import static org.apache.ignite.IgniteCommonsSystemProperties.DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT; +import static org.apache.ignite.IgniteCommonsSystemProperties.IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT; /** * Recovery information for single node. */ public class GridNioRecoveryDescriptor { - /** @see IgniteSystemProperties#IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT */ - public static final int DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT = 5_000; - /** Timeout for outgoing recovery descriptor reservation. */ private static final long DESC_RESERVATION_TIMEOUT = Math.max(1_000, - IgniteSystemProperties.getLong(IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT, + IgniteCommonsSystemProperties.getLong(IGNITE_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT, DFLT_NIO_RECOVERY_DESCRIPTOR_RESERVATION_TIMEOUT)); /** Number of acknowledged messages. */ From 48e842c40d7c2b3e1a86759dcc4642f319d1ea96 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 20:27:29 +0300 Subject: [PATCH 101/110] IGNITE-28819 NIO classes use CommonUtils instead of U; move IGNITE_HEADER/writeFully/bytesEqual to CommonUtils Relocate IGNITE_HEADER, writeFully(SocketChannel,ByteBuffer) and bytesEqual(...) from IgniteUtils to CommonUtils (still inherited by IgniteUtils) and repoint the nio package classes from U to CommonUtils, removing their dependency on core's typedef U. Co-Authored-By: Claude Opus 4.8 --- .../ignite/internal/util/CommonUtils.java | 49 ++++++++++++++++++ .../ignite/internal/util/IgniteUtils.java | 50 ------------------- .../nio/GridAbstractCommunicationClient.java | 8 +-- .../nio/GridConnectionBytesVerifyFilter.java | 16 +++--- .../internal/util/nio/GridDirectParser.java | 4 +- .../util/nio/GridNioAsyncNotifyFilter.java | 4 +- .../internal/util/nio/GridNioSessionImpl.java | 12 ++--- .../nio/GridTcpNioCommunicationClient.java | 4 +- .../util/nio/ssl/BlockingSslHandler.java | 8 +-- .../util/nio/ssl/GridNioSslFilter.java | 8 +-- .../util/nio/ssl/GridNioSslHandler.java | 10 ++-- 11 files changed, 86 insertions(+), 87 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index 3f9371fc79476..e816543d32282 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -37,9 +37,11 @@ import java.net.URISyntaxException; import java.net.URL; import java.net.URLClassLoader; +import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; +import java.nio.channels.SocketChannel; import java.nio.file.Files; import java.nio.file.Path; import java.security.AccessController; @@ -105,6 +107,9 @@ public abstract class CommonUtils { /** Empty longs array. */ public static final long[] EMPTY_LONGS = new long[0]; + /** Network packet header (corresponds to {@code 0x0149474E}). */ + public static final byte[] IGNITE_HEADER = new byte[] {0x01, 0x49, 0x47, 0x4E}; + /** */ public static final long KB = 1024L; @@ -2673,4 +2678,48 @@ public static void sleep(long ms) throws IgniteInterruptedCheckedException { throw new IgniteInterruptedCheckedException(e); } } + + /** + * Safely write buffer fully to blocking socket channel. + * Will throw assert if non blocking channel passed. + * + * @param sockCh WritableByteChannel. + * @param buf Buffer. + * @throws IOException IOException. + */ + public static void writeFully(SocketChannel sockCh, ByteBuffer buf) throws IOException { + int totalWritten = 0; + + assert sockCh.isBlocking() : "SocketChannel should be in blocking mode " + sockCh; + + while (buf.hasRemaining()) { + int written = sockCh.write(buf); + + if (written < 0) + throw new IOException("Error writing buffer to channel " + + "[written = " + written + ", buf " + buf + ", totalWritten = " + totalWritten + "]"); + + totalWritten += written; + } + } + + /** + * @param a First byte array. + * @param aOff First byte array offset. + * @param b Second byte array. + * @param bOff Second byte array offset. + * @param len Number of bytes to compare. + * @return {@code True} if the specified sub-arrays are equal. + */ + public static boolean bytesEqual(byte[] a, int aOff, byte[] b, int bOff, int len) { + if (aOff + len > a.length || bOff + len > b.length) + return false; + else { + for (int i = 0; i < len; i++) + if (a[aOff + i] != b[bOff + i]) + return false; + + return true; + } + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index de291ac036f3b..fa29d8f96ca51 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -65,7 +65,6 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.FileLock; -import java.nio.channels.SocketChannel; import java.nio.charset.Charset; import java.nio.file.DirectoryStream; import java.nio.file.Files; @@ -341,9 +340,6 @@ public abstract class IgniteUtils extends CommonUtils { public static final String JMX_DOMAIN = IgniteUtils.class.getName().substring(0, IgniteUtils.class.getName(). indexOf('.', IgniteUtils.class.getName().indexOf('.') + 1)); - /** Network packet header. */ - public static final byte[] IGNITE_HEADER = intToBytes(0x0149474E); - /** Default buffer size = 4K. */ private static final int BUF_SIZE = 4096; @@ -2117,28 +2113,6 @@ private static long fromBytes(byte[] bytes, int off, int limit) { return res; } - /** - * Compares fragments of byte arrays. - * - * @param a First array. - * @param aOff First array offset. - * @param b Second array. - * @param bOff Second array offset. - * @param len Length of fragments. - * @return {@code true} if fragments are equal, {@code false} otherwise. - */ - public static boolean bytesEqual(byte[] a, int aOff, byte[] b, int bOff, int len) { - if (aOff + len > a.length || bOff + len > b.length) - return false; - else { - for (int i = 0; i < len; i++) - if (a[aOff + i] != b[bOff + i]) - return false; - - return true; - } - } - /** * @param bytes Number of bytes to display. * @param si If {@code true}, then unit base is 1000, otherwise unit base is 1024. @@ -7224,30 +7198,6 @@ public static Runnable wrapIgniteFuture(Runnable r, GridFutureAdapter fut) { }; } - /** - * Safely write buffer fully to blocking socket channel. - * Will throw assert if non blocking channel passed. - * - * @param sockCh WritableByteChannel. - * @param buf Buffer. - * @throws IOException IOException. - */ - public static void writeFully(SocketChannel sockCh, ByteBuffer buf) throws IOException { - int totalWritten = 0; - - assert sockCh.isBlocking() : "SocketChannel should be in blocking mode " + sockCh; - - while (buf.hasRemaining()) { - int written = sockCh.write(buf); - - if (written < 0) - throw new IOException("Error writing buffer to channel " + - "[written = " + written + ", buf " + buf + ", totalWritten = " + totalWritten + "]"); - - totalWritten += written; - } - } - /** * @return New identity hash set. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java index 79de224b7772a..267d43156f0c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java @@ -18,15 +18,15 @@ package org.apache.ignite.internal.util.nio; import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; /** * Implements basic lifecycle for communication clients. */ public abstract class GridAbstractCommunicationClient implements GridCommunicationClient { /** Time when this client was last used. */ - private volatile long lastUsed = U.currentTimeMillis(); + private volatile long lastUsed = CommonUtils.currentTimeMillis(); /** Reservations. */ private final AtomicBoolean closed = new AtomicBoolean(); @@ -73,14 +73,14 @@ protected GridAbstractCommunicationClient(int connIdx) { /** {@inheritDoc} */ @Override public long getIdleTime() { - return U.currentTimeMillis() - lastUsed; + return CommonUtils.currentTimeMillis() - lastUsed; } /** * Updates used time. */ protected void markUsed() { - lastUsed = U.currentTimeMillis(); + lastUsed = CommonUtils.currentTimeMillis(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java index 3829aaa6aa0e5..49eca090eaa33 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java @@ -22,15 +22,15 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.internal.LT; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; /** * Verifies that first bytes received in accepted (incoming) * NIO session are equal to {@link U#IGNITE_HEADER}. *

- * First {@code U.IGNITE_HEADER.length} bytes are consumed by this filter + * First {@code CommonUtils.IGNITE_HEADER.length} bytes are consumed by this filter * and all other bytes are forwarded through chain without any modification. */ public class GridConnectionBytesVerifyFilter extends GridNioFilterAdapter { @@ -99,27 +99,27 @@ public GridConnectionBytesVerifyFilter(IgniteLogger log) { Integer magic = ses.meta(MAGIC_META_KEY); - if (magic == null || magic < U.IGNITE_HEADER.length) { + if (magic == null || magic < CommonUtils.IGNITE_HEADER.length) { byte[] magicBuf = ses.meta(MAGIC_BUF_KEY); if (magicBuf == null) - magicBuf = new byte[U.IGNITE_HEADER.length]; + magicBuf = new byte[CommonUtils.IGNITE_HEADER.length]; int magicRead = magic == null ? 0 : magic; int cnt = buf.remaining(); - buf.get(magicBuf, magicRead, Math.min(U.IGNITE_HEADER.length - magicRead, cnt)); + buf.get(magicBuf, magicRead, Math.min(CommonUtils.IGNITE_HEADER.length - magicRead, cnt)); - if (cnt + magicRead < U.IGNITE_HEADER.length) { + if (cnt + magicRead < CommonUtils.IGNITE_HEADER.length) { // Magic bytes are not fully read. ses.addMeta(MAGIC_META_KEY, cnt + magicRead); ses.addMeta(MAGIC_BUF_KEY, magicBuf); } - else if (U.bytesEqual(magicBuf, 0, U.IGNITE_HEADER, 0, U.IGNITE_HEADER.length)) { + else if (CommonUtils.bytesEqual(magicBuf, 0, CommonUtils.IGNITE_HEADER, 0, CommonUtils.IGNITE_HEADER.length)) { // Magic bytes read and equal to IGNITE_HEADER. ses.removeMeta(MAGIC_BUF_KEY); - ses.addMeta(MAGIC_META_KEY, U.IGNITE_HEADER.length); + ses.addMeta(MAGIC_META_KEY, CommonUtils.IGNITE_HEADER.length); proceedMessageReceived(ses, buf); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java index faf416dfdbee7..f17a4289bba60 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java @@ -23,7 +23,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.direct.DirectMessageReader; -import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.plugin.extensions.communication.Message; import org.apache.ignite.plugin.extensions.communication.MessageFactory; import org.apache.ignite.plugin.extensions.communication.MessageSerializer; @@ -105,7 +105,7 @@ public GridDirectParser(IgniteLogger log, MessageFactory msgFactory, GridNioMess } } catch (Throwable e) { - U.error(log, "Failed to read message [msg=" + msg + + CommonUtils.error(log, "Failed to read message [msg=" + msg + ", buf=" + buf + ", reader=" + reader + ", ses=" + ses + "]", diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java index 3fb1ec5dd4a8c..4a5889f17dfb3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java @@ -22,7 +22,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.worker.GridWorker; import org.apache.ignite.internal.util.worker.GridWorkerPool; import org.apache.ignite.lang.IgniteInClosure; @@ -144,7 +144,7 @@ protected void handleException(GridNioSession ses, IgniteCheckedException ex) { proceedExceptionCaught(ses, ex); } catch (IgniteCheckedException e) { - U.warn(log, "Failed to forward exception to the underlying filter (will ignore) [ses=" + ses + ", " + + CommonUtils.warn(log, "Failed to forward exception to the underlying filter (will ignore) [ses=" + ses + ", " + "originalEx=" + ex + ", ex=" + e + ']'); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java index 0211eb85dcae1..56638bcefe97a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java @@ -24,10 +24,10 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.nio.ssl.GridSslMeta; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.jetbrains.annotations.Nullable; @@ -103,7 +103,7 @@ public GridNioSessionImpl( this.rmtAddr = rmtAddr; this.accepted = accepted; - long now = U.currentTimeMillis(); + long now = CommonUtils.currentTimeMillis(); sndSchedTime = now; createTime = now; @@ -317,7 +317,7 @@ public void bytesSent(int cnt) { bytesSent += cnt; bytesSent0 += cnt; - lastSndTime = U.currentTimeMillis(); + lastSndTime = CommonUtils.currentTimeMillis(); } /** @@ -331,14 +331,14 @@ public void bytesReceived(int cnt) { bytesRcvd += cnt; bytesRcvd0 += cnt; - lastRcvTime = U.currentTimeMillis(); + lastRcvTime = CommonUtils.currentTimeMillis(); } /** * Resets send schedule time to avoid multiple idle notifications. */ public void resetSendScheduleTime() { - sndSchedTime = U.currentTimeMillis(); + sndSchedTime = CommonUtils.currentTimeMillis(); } /** @@ -348,7 +348,7 @@ public void resetSendScheduleTime() { * {@code false} if session was already closed. */ public boolean setClosed() { - return closeTime.compareAndSet(0, U.currentTimeMillis()); + return closeTime.compareAndSet(0, CommonUtils.currentTimeMillis()); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java index 4ff126fa4cf91..f553f8d97e583 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java @@ -25,9 +25,9 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.lang.IgniteInClosure2X; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.plugin.extensions.communication.Message; import org.jetbrains.annotations.Nullable; @@ -135,7 +135,7 @@ public GridNioSession session() { /** {@inheritDoc} */ @Override public long getIdleTime() { - long now = U.currentTimeMillis(); + long now = CommonUtils.currentTimeMillis(); // Session can be used for receiving and sending. return Math.min(Math.min(now - ses.lastReceiveTime(), now - ses.lastSendScheduleTime()), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java index 1da7c8ab62ae3..bcf85808db758 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java @@ -28,8 +28,8 @@ import javax.net.ssl.SSLException; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.nio.GridNioException; -import org.apache.ignite.internal.util.typedef.internal.U; import static javax.net.ssl.SSLEngineResult.HandshakeStatus.FINISHED; import static javax.net.ssl.SSLEngineResult.HandshakeStatus.NEED_TASK; @@ -171,7 +171,7 @@ public boolean handshake() throws IgniteCheckedException, SSLException { case NEED_WRAP: { // If the output buffer has remaining data, clear it. if (outNetBuf.hasRemaining()) - U.warn(log, "Output net buffer has unsent bytes during handshake (will clear). "); + CommonUtils.warn(log, "Output net buffer has unsent bytes during handshake (will clear). "); outNetBuf.clear(); @@ -301,7 +301,7 @@ public ByteBuffer decode(ByteBuffer buf) throws IgniteCheckedException, SSLExcep // If we received close_notify but not all bytes has been read by SSL engine, print a warning. if (buf.hasRemaining()) - U.warn(log, "Got unread bytes after receiving close_notify message (will ignore)."); + CommonUtils.warn(log, "Got unread bytes after receiving close_notify message (will ignore)."); } inNetBuf.clear(); @@ -539,7 +539,7 @@ private void readFromNet() throws IgniteCheckedException { */ private void writeNetBuffer() throws IgniteCheckedException { try { - U.writeFully(ch, outNetBuf); + CommonUtils.writeFully(ch, outNetBuf); } catch (IOException e) { throw new IgniteCheckedException("Failed to write byte to socket.", e); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java index ab9f29946999b..bde0c0e710dcc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java @@ -30,13 +30,13 @@ import org.apache.ignite.internal.processors.metric.MetricRegistryImpl; import org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl; import org.apache.ignite.internal.processors.metric.impl.IntMetricImpl; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.nio.GridNioException; import org.apache.ignite.internal.util.nio.GridNioFilterAdapter; import org.apache.ignite.internal.util.nio.GridNioSession; import org.apache.ignite.internal.util.nio.GridNioSessionMetaKey; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.jetbrains.annotations.Nullable; @@ -253,7 +253,7 @@ public void enabledProtocols(String... enabledProtos) { long startTime = System.nanoTime(); - fut.listen(() -> handshakeDuration.value(U.nanosToMillis(System.nanoTime() - startTime))); + fut.listen(() -> handshakeDuration.value(CommonUtils.nanosToMillis(System.nanoTime() - startTime))); } hnd.handshake(); @@ -262,7 +262,7 @@ public void enabledProtocols(String... enabledProtos) { } catch (SSLException e) { onSessionOpenedException = e; - U.error(log, "Failed to start SSL handshake (will close inbound connection): " + ses, e); + CommonUtils.error(log, "Failed to start SSL handshake (will close inbound connection): " + ses, e); ses.close(); } @@ -455,7 +455,7 @@ private IgniteInternalFuture shutdownSession(GridNioSession ses, GridNi hnd.writeNetBuffer(null); } catch (SSLException e) { - U.warn(log, "Failed to shutdown SSL session gracefully (will force close) [ex=" + e + ", ses=" + ses + ']'); + CommonUtils.warn(log, "Failed to shutdown SSL session gracefully (will force close) [ex=" + e + ", ses=" + ses + ']'); } return proceedSessionClose(ses); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java index 13cf4ab96bed6..0b225256c29fe 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java @@ -30,10 +30,10 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.nio.GridNioException; import org.apache.ignite.internal.util.nio.GridNioSession; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.jetbrains.annotations.Nullable; @@ -197,7 +197,7 @@ void handshake() throws IgniteCheckedException, SSLException { if (log.isDebugEnabled()) log.debug("Entered handshake(): [handshakeStatus=" + handshakeStatus + ", ses=" + ses + ']'); - long startTs = U.currentTimeMillis(); + long startTs = CommonUtils.currentTimeMillis(); lock(); @@ -258,7 +258,7 @@ void handshake() throws IgniteCheckedException, SSLException { case NEED_WRAP: { // If the output buffer has remaining data, clear it. if (outNetBuf.hasRemaining()) - U.warn(log, "Output net buffer has unsent bytes during handshake (will clear): " + ses); + CommonUtils.warn(log, "Output net buffer has unsent bytes during handshake (will clear): " + ses); outNetBuf.clear(); @@ -287,7 +287,7 @@ void handshake() throws IgniteCheckedException, SSLException { finally { unlock(); - long elapsed = U.currentTimeMillis() - startTs; + long elapsed = CommonUtils.currentTimeMillis() - startTs; if (elapsed > LONG_HANDSHAKE_THRESHOLD_MS && log.isInfoEnabled()) { log.info("Handshake took too long: [millis=" + elapsed + ", handshakeStatus=" + handshakeStatus + @@ -334,7 +334,7 @@ void messageReceived(ByteBuffer buf) throws IgniteCheckedException, SSLException // If we received close_notify but not all bytes has been read by SSL engine, print a warning. if (buf.hasRemaining()) - U.warn(log, "Got unread bytes after receiving close_notify message (will ignore): " + ses); + CommonUtils.warn(log, "Got unread bytes after receiving close_notify message (will ignore): " + ses); } inNetBuf.clear(); From 01f89b433b5488c983869a59260ba8595b07dff6 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 23:00:57 +0300 Subject: [PATCH 102/110] IGNITE-28819 Move IgniteInClosure2X to ignite-commons Its only core tie was an @see CIX2 javadoc reference; drop it (F.wrap is inherited from commons GridFunc) and move the class to ignite-commons so the NIO communication clients no longer depend on a core type for it. Co-Authored-By: Claude Opus 4.8 --- .../org/apache/ignite/internal/util/lang/IgniteInClosure2X.java | 2 -- 1 file changed, 2 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/lang/IgniteInClosure2X.java (96%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/IgniteInClosure2X.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/lang/IgniteInClosure2X.java similarity index 96% rename from modules/core/src/main/java/org/apache/ignite/internal/util/lang/IgniteInClosure2X.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/lang/IgniteInClosure2X.java index cd8e041203436..bc72ad168e73e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/IgniteInClosure2X.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/lang/IgniteInClosure2X.java @@ -18,7 +18,6 @@ package org.apache.ignite.internal.util.lang; import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.internal.util.typedef.CIX2; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.lang.IgniteBiInClosure; @@ -26,7 +25,6 @@ * Convenient in-closure subclass that allows for thrown grid exception. This class * implements {@link #apply(Object, Object)} method that calls {@link #applyx(Object, Object)} * method and properly wraps {@link IgniteCheckedException} into {@link GridClosureException} instance. - * @see CIX2 */ public abstract class IgniteInClosure2X implements IgniteBiInClosure { /** */ From 623855795f06a88916065ad4345470da92f68198 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 23:03:51 +0300 Subject: [PATCH 103/110] IGNITE-28819 Move GridWorkerPool and ComputeExecutionRejectedException to ignite-commons GridWorkerPool uses CommonUtils.cancel/join (already in commons) instead of U, and the ComputeExecutionRejectedException it throws moves to ignite-commons as well (FQN preserved). Removes GridNioAsyncNotifyFilter's dependency on a core worker-pool type. Co-Authored-By: Claude Opus 4.8 --- .../ignite/compute/ComputeExecutionRejectedException.java | 0 .../apache/ignite/internal/util/worker/GridWorkerPool.java | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/compute/ComputeExecutionRejectedException.java (100%) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerPool.java (95%) diff --git a/modules/core/src/main/java/org/apache/ignite/compute/ComputeExecutionRejectedException.java b/modules/commons/src/main/java/org/apache/ignite/compute/ComputeExecutionRejectedException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/compute/ComputeExecutionRejectedException.java rename to modules/commons/src/main/java/org/apache/ignite/compute/ComputeExecutionRejectedException.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerPool.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerPool.java similarity index 95% rename from modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerPool.java rename to modules/commons/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerPool.java index 83f8fd8a30872..51b6a97bd3265 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerPool.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/worker/GridWorkerPool.java @@ -23,8 +23,8 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.compute.ComputeExecutionRejectedException; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.GridConcurrentHashSet; -import org.apache.ignite.internal.util.typedef.internal.U; /** * Pool of runnable workers. This class automatically takes care of @@ -102,9 +102,9 @@ public void join(boolean cancel) { for (GridWorker worker : workers) { try { if (cancel) - U.cancel(worker); + CommonUtils.cancel(worker); - U.join(worker, log); + CommonUtils.join(worker, log); } catch (Exception e) { if (log != null) From de3e6b1b33553725d0a7e7ef8b5b10b3b3793983 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 23:05:57 +0300 Subject: [PATCH 104/110] IGNITE-28819 Move SpanTransport to ignite-commons; GridNioTracerFilter uses SpanManager Move the self-contained SpanTransport marker interface to ignite-commons and retype GridNioTracerFilter's tracer to SpanManager (serialize/create are SpanManager methods), defaulting to NoopSpanManager. Removes the filter's Tracing/NoopTracing/SpanTransport core dependencies. Co-Authored-By: Claude Opus 4.8 --- .../processors/tracing/messages/SpanTransport.java | 0 .../ignite/internal/util/nio/GridNioTracerFilter.java | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename modules/{core => commons}/src/main/java/org/apache/ignite/internal/processors/tracing/messages/SpanTransport.java (100%) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/messages/SpanTransport.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/messages/SpanTransport.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/messages/SpanTransport.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/tracing/messages/SpanTransport.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java index 650aeb2cc7ce3..47644636def68 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java @@ -23,9 +23,9 @@ import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.tracing.MTC; import org.apache.ignite.internal.processors.tracing.NoopSpan; -import org.apache.ignite.internal.processors.tracing.NoopTracing; +import org.apache.ignite.internal.processors.tracing.NoopSpanManager; import org.apache.ignite.internal.processors.tracing.Span; -import org.apache.ignite.internal.processors.tracing.Tracing; +import org.apache.ignite.internal.processors.tracing.SpanManager; import org.apache.ignite.internal.processors.tracing.messages.SpanTransport; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.internal.S; @@ -42,7 +42,7 @@ public class GridNioTracerFilter extends GridNioFilterAdapter { private IgniteLogger log; /** Tracing processor. */ - private final Tracing tracer; + private final SpanManager tracer; /** * Creates a tracer filter. @@ -50,11 +50,11 @@ public class GridNioTracerFilter extends GridNioFilterAdapter { * @param log Log instance to use. * @param tracer Tracing processor. */ - public GridNioTracerFilter(IgniteLogger log, Tracing tracer) { + public GridNioTracerFilter(IgniteLogger log, SpanManager tracer) { super("GridNioTracerFilter"); this.log = log; - this.tracer = tracer == null ? new NoopTracing() : tracer; + this.tracer = tracer == null ? new NoopSpanManager() : tracer; } /** {@inheritDoc} */ From 1cbefdc31c41d437e3d30007dcb896f65582b47b Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 23:09:31 +0300 Subject: [PATCH 105/110] IGNITE-28819 GridSelectorNioSessionImpl resolves trace names via SpanManager Pass the SpanManager from GridNioServer into the session and resolve trace names through SpanManager.traceName instead of the static TraceableMessagesTable.traceName, removing the session's dependency on the core TraceableMessagesTable. Co-Authored-By: Claude Opus 4.8 --- .../ignite/internal/util/nio/GridNioServer.java | 1 + .../util/nio/GridSelectorNioSessionImpl.java | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index 4849946d76d4c..d6a4ee038f0c5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -2779,6 +2779,7 @@ private void register(NioOperationFuture fut) { sndQueueLimit, outboundMessagesQueueSizeMetric, maxMessagesQueueSizeMetric, + tracing, writeBuf, readBuf); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java index 9402160a03c65..aa03d919cfca3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java @@ -31,14 +31,14 @@ import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.tracing.MTC; +import org.apache.ignite.internal.processors.tracing.SpanManager; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.internal.LT; import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.plugin.extensions.communication.Message; import org.apache.ignite.util.deque.FastSizeDeque; import org.jetbrains.annotations.Nullable; -import static org.apache.ignite.internal.processors.tracing.messages.TraceableMessagesTable.traceName; - /** * Session implementation bound to selector API and socket API. * Note that this implementation requires non-null values for local and remote @@ -92,6 +92,9 @@ public class GridSelectorNioSessionImpl extends GridNioSessionImpl implements Gr /** Maximum outbound messages queue size metric. */ @Nullable private final LongConsumer maxMessagesQueueSizeMetric; + /** Span manager used to resolve trace names for logging. */ + private final SpanManager tracer; + /** * Creates session instance. * @@ -104,6 +107,7 @@ public class GridSelectorNioSessionImpl extends GridNioSessionImpl implements Gr * @param sndQueueLimit Send queue limit. * @param outboundMessagesQueueSizeMetric Outbound messages queue size metric, or {@code null} if metrics disabled. * @param maxMessagesQueueSizeMetric Maximum outbound messages queue size metric, or {@code null} if metrics disabled. + * @param tracer Span manager used to resolve trace names for logging. * @param writeBuf Write buffer. * @param readBuf Read buffer. */ @@ -117,6 +121,7 @@ public class GridSelectorNioSessionImpl extends GridNioSessionImpl implements Gr int sndQueueLimit, @Nullable LongConsumer outboundMessagesQueueSizeMetric, @Nullable LongConsumer maxMessagesQueueSizeMetric, + SpanManager tracer, @Nullable ByteBuffer writeBuf, @Nullable ByteBuffer readBuf ) { @@ -151,6 +156,8 @@ public class GridSelectorNioSessionImpl extends GridNioSessionImpl implements Gr this.outboundMessagesQueueSizeMetric = outboundMessagesQueueSizeMetric; this.maxMessagesQueueSizeMetric = maxMessagesQueueSizeMetric; + + this.tracer = tracer; } /** {@inheritDoc} */ @@ -312,7 +319,7 @@ int offerSystemFuture(SessionWriteRequest writeFut) { boolean res = queue.offerFirst(writeFut); - MTC.span().addLog(() -> "Added to system queue - " + traceName(writeFut.message())); + MTC.span().addLog(() -> "Added to system queue - " + tracer.traceName((Message)writeFut.message())); assert res : "Future was not added to queue"; @@ -350,7 +357,7 @@ int offerFuture(SessionWriteRequest writeFut) { boolean res = queue.offer(writeFut); - MTC.span().addLog(() -> "Added to queue - " + traceName(writeFut.message())); + MTC.span().addLog(() -> "Added to queue - " + tracer.traceName((Message)writeFut.message())); assert res : "Future was not added to queue"; From ce249213dbc94f0e33fc68b2aae18ff40f46158d Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 23:14:23 +0300 Subject: [PATCH 106/110] IGNITE-28819 GridNioSslFilter takes functional metrics instead of MetricRegistryImpl Retype the filter's handshake-duration metric to LongConsumer and the rejected-sessions counter to Runnable; metric creation moves to a new IgniteUtils.sslFilter(...) factory that the four construction sites now call. Removes GridNioSslFilter's dependency on MetricRegistryImpl/HistogramMetricImpl/IntMetricImpl. Co-Authored-By: Claude Opus 4.8 --- .../GridNioClientConnectionMultiplexer.java | 3 +- .../odbc/ClientListenerProcessor.java | 2 +- .../protocols/tcp/GridTcpRestProtocol.java | 2 +- .../ignite/internal/util/IgniteUtils.java | 31 +++++++++++++++++ .../util/nio/ssl/GridNioSslFilter.java | 33 +++++++------------ .../tcp/internal/GridNioServerWrapper.java | 2 +- 6 files changed, 48 insertions(+), 25 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java index a26a6f2dac7e7..a1505e9c7f11b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java @@ -43,6 +43,7 @@ import org.apache.ignite.internal.util.nio.GridNioServer; import org.apache.ignite.internal.util.nio.GridNioSession; import org.apache.ignite.internal.util.nio.ssl.GridNioSslFilter; +import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.logger.NullLogger; /** @@ -82,7 +83,7 @@ public GridNioClientConnectionMultiplexer(ClientConfiguration cfg) { sslCtx = ClientSslUtils.getSslContext(cfg); if (sslCtx != null) { - GridNioSslFilter sslFilter = new GridNioSslFilter(sslCtx, true, ByteOrder.nativeOrder(), gridLog, null); + GridNioSslFilter sslFilter = U.sslFilter(sslCtx, true, ByteOrder.nativeOrder(), gridLog, null); sslFilter.directMode(false); filters = new GridNioFilter[] {codecFilter, sslFilter}; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java index 22cc66e1dbb07..808437eb1719a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/ClientListenerProcessor.java @@ -494,7 +494,7 @@ else if (connCtx.managementClient()) { throw new IgniteCheckedException("Failed to create client listener " + "(SSL is enabled but factory is null). Check the ClientConnectorConfiguration"); - GridNioSslFilter sslFilter = new GridNioSslFilter(sslCtxFactory.create(), + GridNioSslFilter sslFilter = U.sslFilter(sslCtxFactory.create(), true, ByteOrder.nativeOrder(), log, ctx.metric().registry(CLIENT_CONNECTOR_METRICS)); sslFilter.directMode(true); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java index 19cbf94f9e72c..38c0ef625e44e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java @@ -210,7 +210,7 @@ private boolean startTcpServer(InetAddress hostAddr, int port, GridNioServerList GridNioFilter[] filters; if (sslCtx != null) { - GridNioSslFilter sslFilter = new GridNioSslFilter( + GridNioSslFilter sslFilter = U.sslFilter( sslCtx, cfg.isDirectBuffer(), ByteOrder.nativeOrder(), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index fa29d8f96ca51..1f722faffc8de 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -113,6 +113,7 @@ import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReadWriteLock; import java.util.function.Consumer; +import java.util.function.LongConsumer; import java.util.jar.JarFile; import java.util.logging.ConsoleHandler; import java.util.logging.Handler; @@ -133,6 +134,7 @@ import javax.management.ObjectName; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; @@ -7776,4 +7778,33 @@ public static void registerNioServerMetrics(GridNioServer srv, GridNioFilter[ mreg.register(GridNioServer.SSL_ENABLED_METRIC_NAME, () -> sslEnabled, "Whether SSL is enabled"); mreg.register(GridNioServer.SESSIONS_CNT_METRIC_NAME, srv::activeTcpSessionsCount, "Active TCP sessions count."); } + + /** + * Creates an SSL NIO filter, wiring its metrics from the given registry. + * + * @param sslCtx SSL context. + * @param directBuf Direct buffer flag. + * @param order Byte order. + * @param log Logger to use. + * @param mreg Optional metric registry; if {@code null}, the filter is created without metrics. + * @return SSL NIO filter. + */ + public static GridNioSslFilter sslFilter( + SSLContext sslCtx, + boolean directBuf, + ByteOrder order, + IgniteLogger log, + @Nullable MetricRegistryImpl mreg + ) { + LongConsumer handshakeDuration = mreg == null ? null : mreg.histogram( + GridNioSslFilter.SSL_HANDSHAKE_DURATION_HISTOGRAM_METRIC_NAME, + new long[] {250, 500, 1000}, + "SSL handshake duration in milliseconds.")::value; + + Runnable rejectedSesCnt = mreg == null ? null : mreg.intMetric( + GridNioSslFilter.SSL_REJECTED_SESSIONS_CNT_METRIC_NAME, + "TCP sessions count that were rejected due to SSL errors.")::increment; + + return new GridNioSslFilter(sslCtx, directBuf, order, log, handshakeDuration, rejectedSesCnt); + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java index bde0c0e710dcc..b2994a874a6c3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.util.function.LongConsumer; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLException; @@ -27,9 +28,6 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.processors.metric.MetricRegistryImpl; -import org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl; -import org.apache.ignite.internal.processors.metric.impl.IntMetricImpl; import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; @@ -86,10 +84,10 @@ public class GridNioSslFilter extends GridNioFilterAdapter { @Nullable private Exception onSessionOpenedException; /** Metric that indicates sessions count that were rejected due to SSL errors. */ - @Nullable private final IntMetricImpl rejectedSesCnt; + @Nullable private final Runnable rejectedSesCnt; - /** Histogram that provides distribution of SSL handshake duration. */ - @Nullable private final HistogramMetricImpl handshakeDuration; + /** Records the SSL handshake duration (in milliseconds). */ + @Nullable private final LongConsumer handshakeDuration; /** * Creates SSL filter. @@ -98,14 +96,16 @@ public class GridNioSslFilter extends GridNioFilterAdapter { * @param directBuf Direct buffer flag. * @param order Byte order. * @param log Logger to use. - * @param mreg Optional metric registry. + * @param handshakeDuration Records SSL handshake duration (ms), or {@code null} if metrics disabled. + * @param rejectedSesCnt Increments the rejected-sessions counter, or {@code null} if metrics disabled. */ public GridNioSslFilter( SSLContext sslCtx, boolean directBuf, ByteOrder order, IgniteLogger log, - @Nullable MetricRegistryImpl mreg + @Nullable LongConsumer handshakeDuration, + @Nullable Runnable rejectedSesCnt ) { super("SSL filter"); @@ -113,17 +113,8 @@ public GridNioSslFilter( this.sslCtx = sslCtx; this.directBuf = directBuf; this.order = order; - - handshakeDuration = mreg == null ? null : mreg.histogram( - SSL_HANDSHAKE_DURATION_HISTOGRAM_METRIC_NAME, - new long[] {250, 500, 1000}, - "SSL handshake duration in milliseconds." - ); - - rejectedSesCnt = mreg == null ? null : mreg.intMetric( - SSL_REJECTED_SESSIONS_CNT_METRIC_NAME, - "TCP sessions count that were rejected due to SSL errors." - ); + this.handshakeDuration = handshakeDuration; + this.rejectedSesCnt = rejectedSesCnt; } /** @@ -253,7 +244,7 @@ public void enabledProtocols(String... enabledProtos) { long startTime = System.nanoTime(); - fut.listen(() -> handshakeDuration.value(CommonUtils.nanosToMillis(System.nanoTime() - startTime))); + fut.listen(() -> handshakeDuration.accept(CommonUtils.nanosToMillis(System.nanoTime() - startTime))); } hnd.handshake(); @@ -275,7 +266,7 @@ public void enabledProtocols(String... enabledProtos) { if (fut != null) { if (rejectedSesCnt != null) - rejectedSesCnt.increment(); + rejectedSesCnt.run(); fut.onDone(new IgniteCheckedException("SSL handshake failed (connection closed).", onSessionOpenedException)); } diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java index 30f8f2596d45d..eb90f002a240f 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java @@ -910,7 +910,7 @@ private MessageFactory get() { filters.add(new GridConnectionBytesVerifyFilter(log)); if (stateProvider.isSslEnabled()) { - GridNioSslFilter sslFilter = new GridNioSslFilter( + GridNioSslFilter sslFilter = U.sslFilter( igniteCfg.getSslContextFactory().create(), true, ByteOrder.LITTLE_ENDIAN, From 81db8c8221286c8358cac11cd69568dfe44ba894 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 23:17:13 +0300 Subject: [PATCH 107/110] IGNITE-28819 Decouple GridDirectParser from DirectMessageReader and TcpCommunicationSpi Type the reader as MessageReader (setBuffer/reset suffice, the DirectMessageReader cast was redundant) and inline the 2-byte direct-type decoding instead of using TcpCommunicationSpi.makeMessageType. Co-Authored-By: Claude Opus 4.8 --- .../ignite/internal/util/nio/GridDirectParser.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java index f17a4289bba60..76b0d60ad7463 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java @@ -22,15 +22,13 @@ import java.nio.ByteBuffer; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.internal.direct.DirectMessageReader; import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.plugin.extensions.communication.Message; import org.apache.ignite.plugin.extensions.communication.MessageFactory; +import org.apache.ignite.plugin.extensions.communication.MessageReader; import org.apache.ignite.plugin.extensions.communication.MessageSerializer; import org.jetbrains.annotations.Nullable; -import static org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.makeMessageType; - /** * Parser for direct messages. */ @@ -67,10 +65,10 @@ public GridDirectParser(IgniteLogger log, MessageFactory msgFactory, GridNioMess /** {@inheritDoc} */ @Nullable @Override public Object decode(GridNioSession ses, ByteBuffer buf) throws IOException, IgniteCheckedException { - DirectMessageReader reader = ses.meta(READER_META_KEY); + MessageReader reader = ses.meta(READER_META_KEY); if (reader == null) - ses.addMeta(READER_META_KEY, reader = (DirectMessageReader)readerFactory.reader(ses, msgFactory)); + ses.addMeta(READER_META_KEY, reader = readerFactory.reader(ses, msgFactory)); Message msg = ses.removeMeta(MSG_META_KEY); @@ -79,7 +77,7 @@ public GridDirectParser(IgniteLogger log, MessageFactory msgFactory, GridNioMess byte b0 = buf.get(); byte b1 = buf.get(); - msg = msgFactory.create(makeMessageType(b0, b1)); + msg = msgFactory.create((short)((b1 & 0xFF) << 8 | b0 & 0xFF)); } boolean finished = false; From ef6995f58a5c08ef3cfb2f7eb0b3f236395434d6 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 23:20:00 +0300 Subject: [PATCH 108/110] IGNITE-28819 Move the internal.util.nio package to the ignite-nio module Relocate GridNioServer and the entire org.apache.ignite.internal.util.nio package (39 classes, including the ssl subpackage) from ignite-core to the ignite-nio module, now that the package depends only on ignite-commons, ignite-binary-api and ignite-grid-unsafe. Add the ignite-grid-unsafe dependency to ignite-nio. ignite-core continues to depend on ignite-nio, so all existing references resolve. Co-Authored-By: Claude Opus 4.8 --- modules/nio/pom.xml | 6 ++++++ .../internal/util/nio/GridAbstractCommunicationClient.java | 0 .../apache/ignite/internal/util/nio/GridBufferedParser.java | 0 .../ignite/internal/util/nio/GridCommunicationClient.java | 0 .../internal/util/nio/GridConnectionBytesVerifyFilter.java | 0 .../ignite/internal/util/nio/GridDelimitedParser.java | 0 .../apache/ignite/internal/util/nio/GridDirectParser.java | 0 .../ignite/internal/util/nio/GridNioAsyncNotifyFilter.java | 0 .../internal/util/nio/GridNioBackPressureControl.java | 0 .../apache/ignite/internal/util/nio/GridNioCodecFilter.java | 0 .../ignite/internal/util/nio/GridNioDelimitedBuffer.java | 0 .../apache/ignite/internal/util/nio/GridNioException.java | 0 .../org/apache/ignite/internal/util/nio/GridNioFilter.java | 0 .../ignite/internal/util/nio/GridNioFilterAdapter.java | 0 .../apache/ignite/internal/util/nio/GridNioFilterChain.java | 0 .../ignite/internal/util/nio/GridNioKeyAttachment.java | 0 .../internal/util/nio/GridNioMessageReaderFactory.java | 0 .../ignite/internal/util/nio/GridNioMessageTracker.java | 0 .../internal/util/nio/GridNioMessageWriterFactory.java | 0 .../org/apache/ignite/internal/util/nio/GridNioParser.java | 0 .../ignite/internal/util/nio/GridNioRecoveryDescriptor.java | 0 .../org/apache/ignite/internal/util/nio/GridNioServer.java | 0 .../ignite/internal/util/nio/GridNioServerBuffer.java | 0 .../ignite/internal/util/nio/GridNioServerListener.java | 0 .../internal/util/nio/GridNioServerListenerAdapter.java | 0 .../org/apache/ignite/internal/util/nio/GridNioSession.java | 0 .../apache/ignite/internal/util/nio/GridNioSessionImpl.java | 0 .../ignite/internal/util/nio/GridNioSessionMetaKey.java | 0 .../ignite/internal/util/nio/GridNioTracerFilter.java | 0 .../org/apache/ignite/internal/util/nio/GridNioWorker.java | 0 .../internal/util/nio/GridSelectorNioSessionImpl.java | 0 .../internal/util/nio/GridTcpNioCommunicationClient.java | 0 .../ignite/internal/util/nio/SelectedSelectionKeySet.java | 0 .../ignite/internal/util/nio/SessionWriteRequest.java | 0 .../org/apache/ignite/internal/util/nio/package-info.java | 0 .../ignite/internal/util/nio/ssl/BlockingSslHandler.java | 0 .../ignite/internal/util/nio/ssl/GridNioSslFilter.java | 0 .../ignite/internal/util/nio/ssl/GridNioSslHandler.java | 0 .../apache/ignite/internal/util/nio/ssl/GridSslMeta.java | 0 .../apache/ignite/internal/util/nio/ssl/package-info.java | 0 40 files changed, 6 insertions(+) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridCommunicationClient.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioCodecFilter.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioException.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilter.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterAdapter.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterChain.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioKeyAttachment.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageReaderFactory.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageWriterFactory.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioParser.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerBuffer.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListener.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListenerAdapter.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioSession.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKey.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridNioWorker.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/SelectedSelectionKeySet.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/SessionWriteRequest.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/package-info.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridSslMeta.java (100%) rename modules/{core => nio}/src/main/java/org/apache/ignite/internal/util/nio/ssl/package-info.java (100%) diff --git a/modules/nio/pom.xml b/modules/nio/pom.xml index 7462683449e82..c6247439fee3d 100644 --- a/modules/nio/pom.xml +++ b/modules/nio/pom.xml @@ -47,6 +47,12 @@ provided + + ${project.groupId} + ignite-grid-unsafe + provided + + org.jetbrains annotations diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridAbstractCommunicationClient.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridBufferedParser.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridCommunicationClient.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridCommunicationClient.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridCommunicationClient.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridCommunicationClient.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioAsyncNotifyFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioBackPressureControl.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioCodecFilter.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioCodecFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioCodecFilter.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioCodecFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioDelimitedBuffer.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioException.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioException.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioException.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilter.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilter.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterAdapter.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterAdapter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterAdapter.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterAdapter.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterChain.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterChain.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterChain.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilterChain.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioKeyAttachment.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioKeyAttachment.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioKeyAttachment.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioKeyAttachment.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageReaderFactory.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageReaderFactory.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageReaderFactory.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageReaderFactory.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageWriterFactory.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageWriterFactory.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageWriterFactory.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageWriterFactory.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioParser.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioParser.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioParser.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioParser.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerBuffer.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerBuffer.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerBuffer.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerBuffer.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListener.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListener.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListener.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListener.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListenerAdapter.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListenerAdapter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListenerAdapter.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioServerListenerAdapter.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSession.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioSession.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSession.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioSession.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionImpl.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKey.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKey.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKey.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioSessionMetaKey.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioTracerFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioWorker.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioWorker.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioWorker.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridNioWorker.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridSelectorNioSessionImpl.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/GridTcpNioCommunicationClient.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/SelectedSelectionKeySet.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/SelectedSelectionKeySet.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/SelectedSelectionKeySet.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/SelectedSelectionKeySet.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/SessionWriteRequest.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/SessionWriteRequest.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/SessionWriteRequest.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/SessionWriteRequest.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/package-info.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/package-info.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/package-info.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/package-info.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/BlockingSslHandler.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridSslMeta.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridSslMeta.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridSslMeta.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridSslMeta.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/package-info.java b/modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/package-info.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/package-info.java rename to modules/nio/src/main/java/org/apache/ignite/internal/util/nio/ssl/package-info.java From 43c13b99f804f54c4f8629b8f42198a2360176ca Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Tue, 30 Jun 2026 23:30:18 +0300 Subject: [PATCH 109/110] IGNITE-28819 Move remaining thin-client implementation classes to ignite-thin-client-impl With the NIO package now in ignite-nio, add an ignite-nio dependency to ignite-thin-client-impl and move the last 11 thin-client implementation classes (TcpIgniteClient, TcpClientCache, ReliableChannelImpl, ClientServicesImpl, the continuous-query/listener classes and the client-side gridnioserver multiplexer/connection/parser/listener) out of ignite-core. GridNioClientConnectionMultiplexer builds its SSL filter directly (no metrics) instead of via the core IgniteUtils.sslFilter factory. ignite-core keeps a compile dependency on ignite-thin-client-impl, so Ignition and platform-client references still resolve. Co-Authored-By: Claude Opus 4.8 --- .../apache/ignite/internal/util/nio/GridNioSslSelfTest.java | 2 +- modules/thin-client/impl/pom.xml | 6 ++++++ .../client/thin/ClientCacheEntryListenerHandler.java | 0 .../client/thin/ClientCacheEntryListenersRegistry.java | 0 .../internal/client/thin/ClientContinuousQueryCursor.java | 0 .../ignite/internal/client/thin/ClientServicesImpl.java | 0 .../ignite/internal/client/thin/ReliableChannelImpl.java | 0 .../apache/ignite/internal/client/thin/TcpClientCache.java | 0 .../apache/ignite/internal/client/thin/TcpIgniteClient.java | 0 .../thin/io/gridnioserver/GridNioClientConnection.java | 0 .../gridnioserver/GridNioClientConnectionMultiplexer.java | 3 +-- .../client/thin/io/gridnioserver/GridNioClientListener.java | 0 .../client/thin/io/gridnioserver/GridNioClientParser.java | 0 13 files changed, 8 insertions(+), 3 deletions(-) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenersRegistry.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnection.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java (97%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientListener.java (100%) rename modules/{core => thin-client/impl}/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientParser.java (100%) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java index 79bc9f0ef82e7..9b2199f213e94 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java @@ -71,7 +71,7 @@ public class GridNioSslSelfTest extends GridNioSelfTest { .sendQueueLimit(0) .filters( new GridNioCodecFilter(parser, log, false), - new GridNioSslFilter(sslCtx, true, ByteOrder.nativeOrder(), log, null)); + new GridNioSslFilter(sslCtx, true, ByteOrder.nativeOrder(), log, null, null)); } /** {@inheritDoc} */ diff --git a/modules/thin-client/impl/pom.xml b/modules/thin-client/impl/pom.xml index 49bf4aeca4e5d..d19ba53ec78a8 100644 --- a/modules/thin-client/impl/pom.xml +++ b/modules/thin-client/impl/pom.xml @@ -53,6 +53,12 @@ provided + + ${project.groupId} + ignite-nio + provided + + org.jetbrains annotations diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenerHandler.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenersRegistry.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenersRegistry.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenersRegistry.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheEntryListenersRegistry.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientContinuousQueryCursor.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannelImpl.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/TcpIgniteClient.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnection.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnection.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnection.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnection.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java similarity index 97% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java index a1505e9c7f11b..5d157fe725178 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java +++ b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java @@ -43,7 +43,6 @@ import org.apache.ignite.internal.util.nio.GridNioServer; import org.apache.ignite.internal.util.nio.GridNioSession; import org.apache.ignite.internal.util.nio.ssl.GridNioSslFilter; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.logger.NullLogger; /** @@ -83,7 +82,7 @@ public GridNioClientConnectionMultiplexer(ClientConfiguration cfg) { sslCtx = ClientSslUtils.getSslContext(cfg); if (sslCtx != null) { - GridNioSslFilter sslFilter = U.sslFilter(sslCtx, true, ByteOrder.nativeOrder(), gridLog, null); + GridNioSslFilter sslFilter = new GridNioSslFilter(sslCtx, true, ByteOrder.nativeOrder(), gridLog, null, null); sslFilter.directMode(false); filters = new GridNioFilter[] {codecFilter, sslFilter}; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientListener.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientListener.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientListener.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientListener.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientParser.java b/modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientParser.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientParser.java rename to modules/thin-client/impl/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientParser.java From 05387cd165478cb4950318178c7c788f11d001a7 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Wed, 1 Jul 2026 10:25:40 +0300 Subject: [PATCH 110/110] IGNITE-28819 Fix github checks after modules edits --- .github/workflows/commit-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml index 7f91087932874..715e7b6fb7380 100644 --- a/.github/workflows/commit-check.yml +++ b/.github/workflows/commit-check.yml @@ -104,7 +104,7 @@ jobs: - name: Check javadocs. run : | - ./mvnw -DskipTests install -pl modules/tools,modules/codegen -B -V && ./mvnw initialize -Pjavadoc -B -V + ./mvnw -DskipTests install -pl modules/tools,modules/commons,modules/codegen -B -V && ./mvnw initialize -Pjavadoc -B -V check-dotnet: name: Сheck .NET code