This is an automated email from the ASF dual-hosted git repository.
namelchev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 7f636097681 IGNITE-28262 Remove UUIDCollectionMessage (#12924)
7f636097681 is described below
commit 7f63609768198f66765a9e50819ceb680d603af8
Author: Dmitry Werner <[email protected]>
AuthorDate: Wed Mar 25 20:46:47 2026 +0500
IGNITE-28262 Remove UUIDCollectionMessage (#12924)
---
.../calcite/metadata/FragmentDescription.java | 32 +--------
.../communication/GridIoMessageFactory.java | 3 -
.../GridDistributedTxPrepareRequest.java | 20 +-----
.../internal/util/UUIDCollectionMessage.java | 83 ----------------------
.../main/resources/META-INF/classnames.properties | 1 -
.../TxDeadlockOnEntryToStringTest.java | 6 +-
...mmunicationSpiInverseConnectionLoggingTest.java | 15 +---
.../TcpCommunicationSpiNodeLeftLoggingTest.java | 15 +---
8 files changed, 8 insertions(+), 167 deletions(-)
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/FragmentDescription.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/FragmentDescription.java
index ebba0459e4f..009a9c6c9e3 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/FragmentDescription.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/FragmentDescription.java
@@ -17,7 +17,6 @@
package org.apache.ignite.internal.processors.query.calcite.metadata;
-import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@@ -26,8 +25,6 @@ import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import
org.apache.ignite.internal.processors.query.calcite.message.CalciteMarshalableMessage;
import org.apache.ignite.internal.processors.query.calcite.message.MessageType;
-import org.apache.ignite.internal.util.UUIDCollectionMessage;
-import org.apache.ignite.internal.util.typedef.internal.U;
/** */
public class FragmentDescription implements CalciteMarshalableMessage {
@@ -41,15 +38,12 @@ public class FragmentDescription implements
CalciteMarshalableMessage {
/** */
@Order(2)
- Map<Long, UUIDCollectionMessage> remoteSources0;
+ Map<Long, List<UUID>> remoteSources;
/** */
@Order(3)
ColocationGroup target;
- /** */
- private Map<Long, List<UUID>> remoteSources;
-
/** */
public FragmentDescription() {
}
@@ -103,16 +97,6 @@ public class FragmentDescription implements
CalciteMarshalableMessage {
this.mapping = mapping;
}
- /** */
- public Map<Long, UUIDCollectionMessage> remoteSources0() {
- return remoteSources0;
- }
-
- /** */
- public void remoteSources0(Map<Long, UUIDCollectionMessage>
remoteSources0) {
- this.remoteSources0 = remoteSources0;
- }
-
/** {@inheritDoc} */
@Override public MessageType type() {
return MessageType.FRAGMENT_DESCRIPTION;
@@ -128,13 +112,6 @@ public class FragmentDescription implements
CalciteMarshalableMessage {
if (mapping != null)
mapping.prepareMarshal(ctx);
-
- if (remoteSources0 == null && remoteSources != null) {
- remoteSources0 = U.newHashMap(remoteSources.size());
-
- for (Map.Entry<Long, List<UUID>> e : remoteSources.entrySet())
- remoteSources0.put(e.getKey(), new
UUIDCollectionMessage(e.getValue()));
- }
}
/** {@inheritDoc} */
@@ -142,12 +119,5 @@ public class FragmentDescription implements
CalciteMarshalableMessage {
target.prepareUnmarshal(ctx);
mapping.prepareUnmarshal(ctx);
-
- if (remoteSources == null && remoteSources0 != null) {
- remoteSources = U.newHashMap(remoteSources0.size());
-
- for (Map.Entry<Long, UUIDCollectionMessage> e :
remoteSources0.entrySet())
- remoteSources.put(e.getKey(), new
ArrayList<>(e.getValue().uuids()));
- }
}
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
index fabc60b48ab..c9e5e347891 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
@@ -349,8 +349,6 @@ import org.apache.ignite.internal.util.GridByteArrayList;
import org.apache.ignite.internal.util.GridByteArrayListSerializer;
import org.apache.ignite.internal.util.GridPartitionStateMap;
import org.apache.ignite.internal.util.GridPartitionStateMapSerializer;
-import org.apache.ignite.internal.util.UUIDCollectionMessage;
-import org.apache.ignite.internal.util.UUIDCollectionMessageSerializer;
import org.apache.ignite.internal.util.distributed.SingleNodeMessage;
import org.apache.ignite.internal.util.distributed.SingleNodeMessageSerializer;
import org.apache.ignite.marshaller.Marshaller;
@@ -512,7 +510,6 @@ public class GridIoMessageFactory implements
MessageFactoryProvider {
factory.register((short)112, GridCacheSqlQuery::new, new
GridCacheSqlQuerySerializer());
factory.register((short)113, IndexKeyDefinition::new, new
IndexKeyDefinitionSerializer());
factory.register((short)114, GridDhtPartitionSupplyMessage::new, new
GridDhtPartitionSupplyMessageSerializer());
- factory.register((short)115, UUIDCollectionMessage::new, new
UUIDCollectionMessageSerializer());
factory.register((short)116, GridNearSingleGetRequest::new, new
GridNearSingleGetRequestSerializer());
factory.register((short)117, GridNearSingleGetResponse::new, new
GridNearSingleGetResponseSerializer());
factory.register((short)118, CacheContinuousQueryBatchAck::new, new
CacheContinuousQueryBatchAckSerializer());
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index f59d7fd6543..e1ca8e0938a 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -34,12 +34,9 @@ import
org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxState;
import
org.apache.ignite.internal.processors.cache.transactions.IgniteTxStateAware;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.UUIDCollectionMessage;
import org.apache.ignite.internal.util.tostring.GridToStringBuilder;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
-import org.apache.ignite.internal.util.typedef.C1;
-import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
@@ -68,12 +65,6 @@ public class GridDistributedTxPrepareRequest extends
GridDistributedBaseMessage
/** */
public static final int STORE_WRITE_THROUGH_FLAG_MASK = 0x20;
- /** Collection to message converter. */
- private static final C1<Collection<UUID>, UUIDCollectionMessage>
COL_TO_MSG = UUIDCollectionMessage::new;
-
- /** Message to collection converter. */
- private static final C1<UUIDCollectionMessage, Collection<UUID>>
MSG_TO_COL = UUIDCollectionMessage::uuids;
-
/** Thread ID. */
@Order(0)
@GridToStringInclude
@@ -126,11 +117,8 @@ public class GridDistributedTxPrepareRequest extends
GridDistributedBaseMessage
public int txSize;
/** Transaction nodes mapping (primary node -> related backup nodes). */
- private Map<UUID, Collection<UUID>> txNodes;
-
- /** Tx nodes direct marshallable message. */
@Order(10)
- public Map<UUID, UUIDCollectionMessage> txNodesMsg;
+ public Map<UUID, Collection<UUID>> txNodes;
/** IO policy. */
@Order(11)
@@ -403,9 +391,6 @@ public class GridDistributedTxPrepareRequest extends
GridDistributedBaseMessage
dhtVerKeys = dhtVers.keySet();
dhtVerVals = dhtVers.values();
}
-
- if (txNodesMsg == null)
- txNodesMsg = F.viewReadOnly(txNodes, COL_TO_MSG);
}
/** {@inheritDoc} */
@@ -435,9 +420,6 @@ public class GridDistributedTxPrepareRequest extends
GridDistributedBaseMessage
dhtVers.put(key, verIt.next());
}
}
-
- if (txNodesMsg != null)
- txNodes = F.viewReadOnly(txNodesMsg, MSG_TO_COL);
}
/** {@inheritDoc} */
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/util/UUIDCollectionMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/UUIDCollectionMessage.java
deleted file mode 100644
index ac538225568..00000000000
---
a/modules/core/src/main/java/org/apache/ignite/internal/util/UUIDCollectionMessage.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.util;
-
-import java.util.Collection;
-import java.util.Objects;
-import java.util.UUID;
-import org.apache.ignite.internal.Order;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.plugin.extensions.communication.Message;
-
-/**
- * Collection of UUIDs.
- */
-public class UUIDCollectionMessage implements Message {
- /** The collection of UUIDs that was wrapped. */
- @Order(0)
- Collection<UUID> uuids;
-
- /**
- * Empty constructor required for direct marshalling.
- */
- public UUIDCollectionMessage() {
- // No-op.
- }
-
- /**
- * @param uuids UUIDs to wrap.
- */
- public UUIDCollectionMessage(Collection<UUID> uuids) {
- this.uuids = uuids;
- }
-
- /**
- * @return The collection of UUIDs that was wrapped.
- */
- public Collection<UUID> uuids() {
- return uuids;
- }
-
- /** {@inheritDoc} */
- @Override public short directType() {
- return 115;
- }
-
- /** {@inheritDoc} */
- @Override public boolean equals(Object o) {
- if (this == o)
- return true;
-
- if (o == null || getClass() != o.getClass())
- return false;
-
- UUIDCollectionMessage that = (UUIDCollectionMessage)o;
-
- return Objects.equals(uuids, that.uuids);
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- return uuids != null ? uuids.hashCode() : 0;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(UUIDCollectionMessage.class, this, "uuidsSize",
uuids == null ? null : uuids.size());
- }
-}
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties
b/modules/core/src/main/resources/META-INF/classnames.properties
index f97c0ff4698..61624a6225c 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -1994,7 +1994,6 @@
org.apache.ignite.internal.util.ReentrantReadWriteLockWithTracking$1
org.apache.ignite.internal.util.ReentrantReadWriteLockWithTracking$2
org.apache.ignite.internal.util.ReentrantReadWriteLockWithTracking$ReadLockWithTracking
org.apache.ignite.internal.util.StripedCompositeReadWriteLock$ReadLock
-org.apache.ignite.internal.util.UUIDCollectionMessage
org.apache.ignite.internal.util.collection.BitSetIntSet
org.apache.ignite.internal.util.distributed.DistributedProcess$DistributedProcessType
org.apache.ignite.internal.util.distributed.FullMessage
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockOnEntryToStringTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockOnEntryToStringTest.java
index 7bfd06fc017..489ef520d4a 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockOnEntryToStringTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockOnEntryToStringTest.java
@@ -17,8 +17,6 @@
package org.apache.ignite.internal.processors.cache.transactions;
-import java.util.Collections;
-import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.ignite.cache.CacheAtomicityMode;
@@ -30,7 +28,7 @@ import
org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.resource.DependencyResolver;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
-import org.apache.ignite.internal.util.UUIDCollectionMessage;
+import org.apache.ignite.internal.util.GridByteArrayList;
import org.apache.ignite.internal.util.nio.GridNioSession;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.extensions.communication.Message;
@@ -104,7 +102,7 @@ public class TxDeadlockOnEntryToStringTest extends
GridCommonAbstractTest {
nearNode.configuration().getCommunicationSpi().sendMessage(
incomingNode.localNode(),
- new
UUIDCollectionMessage(Collections.singletonList(UUID.randomUUID()))
+ new GridByteArrayList()
);
// Check
diff --git
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiInverseConnectionLoggingTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiInverseConnectionLoggingTest.java
index de48a6972d4..79b698a790d 100644
---
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiInverseConnectionLoggingTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiInverseConnectionLoggingTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.spi.communication.tcp;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import java.util.UUID;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
@@ -28,7 +27,7 @@ import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.managers.communication.GridIoMessage;
-import org.apache.ignite.internal.util.UUIDCollectionMessage;
+import org.apache.ignite.internal.util.GridByteArrayList;
import org.apache.ignite.internal.util.nio.GridCommunicationClient;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.plugin.extensions.communication.Message;
@@ -42,7 +41,6 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.LogEvent;
import org.junit.Test;
-import static java.util.Collections.singletonList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@@ -141,21 +139,12 @@ public class
TcpCommunicationSpiInverseConnectionLoggingTest extends GridCommonA
private void sendFailingMessage(Ignite sourceIgnite, ClusterNode
targetNode) {
GridTestUtils.assertThrows(
log,
- () ->
sourceIgnite.configuration().getCommunicationSpi().sendMessage(targetNode,
someMessage()),
+ () ->
sourceIgnite.configuration().getCommunicationSpi().sendMessage(targetNode, new
GridByteArrayList()),
Exception.class,
null
);
}
- /**
- * Returns some message.
- *
- * @return Some message.
- */
- private UUIDCollectionMessage someMessage() {
- return new UUIDCollectionMessage(singletonList(UUID.randomUUID()));
- }
-
/**
* A custom {@link TcpCommunicationSpi} that allows to model the situation
when an inverse connection must be
* established, but it cannot be.
diff --git
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiNodeLeftLoggingTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiNodeLeftLoggingTest.java
index b17b4fb85f9..6e590e41d94 100644
---
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiNodeLeftLoggingTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiNodeLeftLoggingTest.java
@@ -17,12 +17,11 @@
package org.apache.ignite.spi.communication.tcp;
-import java.util.UUID;
import org.apache.ignite.Ignite;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.util.UUIDCollectionMessage;
+import org.apache.ignite.internal.util.GridByteArrayList;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.MemorizingAppender;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
@@ -30,7 +29,6 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.LogEvent;
import org.junit.Test;
-import static java.util.Collections.singletonList;
import static org.apache.ignite.cluster.ClusterState.ACTIVE;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@@ -110,21 +108,12 @@ public class TcpCommunicationSpiNodeLeftLoggingTest
extends GridCommonAbstractTe
private void sendFailingMessage(Ignite sourceIgnite, ClusterNode
targetNode) {
GridTestUtils.assertThrows(
log,
- () ->
sourceIgnite.configuration().getCommunicationSpi().sendMessage(targetNode,
someMessage()),
+ () ->
sourceIgnite.configuration().getCommunicationSpi().sendMessage(targetNode, new
GridByteArrayList()),
Exception.class,
null
);
}
- /**
- * Returns some message.
- *
- * @return Some message.
- */
- private UUIDCollectionMessage someMessage() {
- return new UUIDCollectionMessage(singletonList(UUID.randomUUID()));
- }
-
/**
* Tests that when we cannot send a message to a client node that left the
topology, then we log this at WARN level.
*