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 bf7467e44ac IGNITE-28257 Remove PartitionsToReload and
CachePartitionsToReloadMap (#12923)
bf7467e44ac is described below
commit bf7467e44aceff78aaece934106d7842948489dc
Author: Dmitry Werner <[email protected]>
AuthorDate: Thu Mar 26 12:36:31 2026 +0500
IGNITE-28257 Remove PartitionsToReload and CachePartitionsToReloadMap
(#12923)
---
.../communication/GridIoMessageFactory.java | 6 ---
.../dht/preloader/CachePartitionsToReloadMap.java | 61 ----------------------
.../preloader/IgniteDhtPartitionsToReloadMap.java | 25 +++------
.../dht/preloader/PartitionsToReload.java | 55 -------------------
.../communication/CompressedMessageTest.java | 17 +++---
5 files changed, 14 insertions(+), 150 deletions(-)
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 c9e5e347891..91961dcd8af 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
@@ -167,8 +167,6 @@ import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Cac
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionFullCountersMapSerializer;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionPartialCountersMap;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionPartialCountersMapSerializer;
-import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionsToReloadMap;
-import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionsToReloadMapSerializer;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtForceKeysRequest;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtForceKeysRequestSerializer;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtForceKeysResponse;
@@ -203,8 +201,6 @@ import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Int
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.IntLongMapSerializer;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionReservationsMap;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionReservationsMapSerializer;
-import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionsToReload;
-import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionsToReloadSerializer;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch.LatchAckMessage;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch.LatchAckMessageSerializer;
import
org.apache.ignite.internal.processors.cache.distributed.near.CacheVersionedValue;
@@ -577,8 +573,6 @@ public class GridIoMessageFactory implements
MessageFactoryProvider {
factory.register(PartitionReservationsMap.TYPE_CODE,
PartitionReservationsMap::new, new PartitionReservationsMapSerializer());
factory.register(IgniteDhtPartitionHistorySuppliersMap.TYPE_CODE,
IgniteDhtPartitionHistorySuppliersMap::new,
new IgniteDhtPartitionHistorySuppliersMapSerializer());
- factory.register(PartitionsToReload.TYPE_CODE,
PartitionsToReload::new, new PartitionsToReloadSerializer());
- factory.register(CachePartitionsToReloadMap.TYPE_CODE,
CachePartitionsToReloadMap::new, new CachePartitionsToReloadMapSerializer());
factory.register(IgniteDhtPartitionsToReloadMap.TYPE_CODE,
IgniteDhtPartitionsToReloadMap::new,
new IgniteDhtPartitionsToReloadMapSerializer());
factory.register(IntLongMap.TYPE_CODE, IntLongMap::new, new
IntLongMapSerializer());
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionsToReloadMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionsToReloadMap.java
deleted file mode 100644
index 049cb682b85..00000000000
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/CachePartitionsToReloadMap.java
+++ /dev/null
@@ -1,61 +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.processors.cache.distributed.dht.preloader;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.ignite.internal.Order;
-import org.apache.ignite.plugin.extensions.communication.Message;
-import org.jetbrains.annotations.Nullable;
-
-/** Partition reload map for cache. */
-public class CachePartitionsToReloadMap implements Message {
- /** Type code. */
- public static final short TYPE_CODE = 512;
-
- /** Partition reload map for cache. */
- @Order(0)
- Map<Integer, PartitionsToReload> map;
-
- /**
- * @param cacheId Cache id.
- * @return Partitions to reload for this cache.
- */
- public @Nullable PartitionsToReload get(int cacheId) {
- if (map == null)
- return null;
-
- return map.get(cacheId);
- }
-
- /**
- * @param cacheId Cache id.
- * @param parts Partitions to reload.
- */
- public void put(int cacheId, PartitionsToReload parts) {
- if (map == null)
- map = new HashMap<>();
-
- map.put(cacheId, parts);
- }
-
- /** {@inheritDoc} */
- @Override public short directType() {
- return TYPE_CODE;
- }
-}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/IgniteDhtPartitionsToReloadMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/IgniteDhtPartitionsToReloadMap.java
index e71ee686919..7e67e554278 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/IgniteDhtPartitionsToReloadMap.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/IgniteDhtPartitionsToReloadMap.java
@@ -20,6 +20,7 @@ package
org.apache.ignite.internal.processors.cache.distributed.dht.preloader;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
@@ -37,7 +38,7 @@ public class IgniteDhtPartitionsToReloadMap implements
Message {
/** */
@Order(0)
- Map<UUID, CachePartitionsToReloadMap> map;
+ Map<UUID, Map<Integer, Set<Integer>>> map;
/**
* @param nodeId Node ID.
@@ -48,17 +49,9 @@ public class IgniteDhtPartitionsToReloadMap implements
Message {
if (map == null)
return Collections.emptySet();
- CachePartitionsToReloadMap nodeMap = map.get(nodeId);
+ Map<Integer, Set<Integer>> nodeMap = map.get(nodeId);
- if (nodeMap == null)
- return Collections.emptySet();
-
- PartitionsToReload partsToReload = nodeMap.get(cacheId);
-
- if (partsToReload == null)
- return Collections.emptySet();
-
- return (Set<Integer>)F.emptyIfNull(partsToReload.partitions());
+ return nodeMap == null ? Collections.emptySet() :
(Set<Integer>)F.emptyIfNull(nodeMap.get(cacheId));
}
/**
@@ -70,15 +63,9 @@ public class IgniteDhtPartitionsToReloadMap implements
Message {
if (map == null)
map = new HashMap<>();
- CachePartitionsToReloadMap nodeMap = map.computeIfAbsent(nodeId, k ->
new CachePartitionsToReloadMap());
-
- PartitionsToReload parts = nodeMap.get(cacheId);
-
- if (parts == null) {
- parts = new PartitionsToReload();
+ Map<Integer, Set<Integer>> nodeMap = map.computeIfAbsent(nodeId, k ->
new HashMap<>());
- nodeMap.put(cacheId, parts);
- }
+ Set<Integer> parts = nodeMap.computeIfAbsent(cacheId, k -> new
HashSet<>());
parts.add(partId);
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/PartitionsToReload.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/PartitionsToReload.java
deleted file mode 100644
index 63faa89841e..00000000000
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/PartitionsToReload.java
+++ /dev/null
@@ -1,55 +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.processors.cache.distributed.dht.preloader;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.ignite.internal.Order;
-import org.apache.ignite.plugin.extensions.communication.Message;
-
-/** Partitions to reload. */
-public class PartitionsToReload implements Message {
- /** Type code. */
- public static final short TYPE_CODE = 511;
-
- /** Set of partitions to reload. */
- @Order(0)
- Set<Integer> parts;
-
- /**
- * @return Set of partitions to reload.
- */
- public Set<Integer> partitions() {
- return parts;
- }
-
- /**
- * @param partId Partition ID.
- */
- public void add(int partId) {
- if (parts == null)
- parts = new HashSet<>();
-
- parts.add(partId);
- }
-
- /** {@inheritDoc} */
- @Override public short directType() {
- return TYPE_CODE;
- }
-}
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/CompressedMessageTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/CompressedMessageTest.java
index e5d8ca19307..66397139ad4 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/CompressedMessageTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/CompressedMessageTest.java
@@ -19,18 +19,17 @@ package org.apache.ignite.internal.managers.communication;
import java.nio.ByteBuffer;
import java.util.Map;
+import java.util.Set;
import java.util.UUID;
import org.apache.ignite.internal.direct.DirectMessageReader;
import org.apache.ignite.internal.direct.DirectMessageWriter;
import org.apache.ignite.internal.direct.state.DirectMessageState;
import org.apache.ignite.internal.direct.stream.DirectByteBufferStream;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionsToReloadMap;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.IgniteDhtPartitionHistorySuppliersMap;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.IgniteDhtPartitionsToReloadMap;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionReservationsMap;
-import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionsToReload;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.plugin.extensions.communication.MessageFactory;
@@ -131,19 +130,19 @@ public class CompressedMessageTest {
for (Map.Entry<UUID, PartitionReservationsMap> entry :
expHistSuppliers.entrySet())
assertEquals(entry.getValue().reservations(),
actHistSuppliers.get(entry.getKey()).reservations());
- Map<UUID, CachePartitionsToReloadMap> expPartsToReload =
U.field((Object)U.field(expected, "partsToReload"), "map");
- Map<UUID, CachePartitionsToReloadMap> actPartsToReload =
U.field((Object)U.field(actual, "partsToReload"), "map");
+ Map<UUID, Map<Integer, Set<Integer>>> expPartsToReload =
U.field((Object)U.field(expected, "partsToReload"), "map");
+ Map<UUID, Map<Integer, Set<Integer>>> actPartsToReload =
U.field((Object)U.field(actual, "partsToReload"), "map");
assertEquals(expPartsToReload.size(), actPartsToReload.size());
- for (Map.Entry<UUID, CachePartitionsToReloadMap> entry :
expPartsToReload.entrySet()) {
- Map<Integer, PartitionsToReload> expCachePartitions =
U.field(entry.getValue(), "map");
- Map<Integer, PartitionsToReload> actCachePartitions =
U.field(actPartsToReload.get(entry.getKey()), "map");
+ for (Map.Entry<UUID, Map<Integer, Set<Integer>>> entry :
expPartsToReload.entrySet()) {
+ Map<Integer, Set<Integer>> expCachePartitions = entry.getValue();
+ Map<Integer, Set<Integer>> actCachePartitions =
actPartsToReload.get(entry.getKey());
assertEquals(expCachePartitions.size(), actCachePartitions.size());
- for (Map.Entry<Integer, PartitionsToReload> partsEntry :
expCachePartitions.entrySet())
- assertEquals(partsEntry.getValue().partitions(),
actCachePartitions.get(partsEntry.getKey()).partitions());
+ for (Map.Entry<Integer, Set<Integer>> partsEntry :
expCachePartitions.entrySet())
+ assertEquals(partsEntry.getValue(),
actCachePartitions.get(partsEntry.getKey()));
}
}
}