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 d66ff3abc7d IGNITE-26568 Remove CacheEntryInfoCollection (#12908)
d66ff3abc7d is described below
commit d66ff3abc7d679e5a3bdd66d81415cf0f1f58c26
Author: Aleksandr Chesnokov <[email protected]>
AuthorDate: Thu Mar 26 10:57:53 2026 +0300
IGNITE-26568 Remove CacheEntryInfoCollection (#12908)
---
.../communication/GridIoMessageFactory.java | 3 -
.../processors/cache/CacheEntryInfoCollection.java | 68 ----------------------
.../dht/preloader/GridDhtPartitionDemander.java | 8 +--
.../preloader/GridDhtPartitionSupplyMessage.java | 16 +++--
.../main/resources/META-INF/classnames.properties | 1 -
.../rebalancing/RebalanceStatisticsTest.java | 23 ++++----
.../TxPartitionCounterStateConsistencyTest.java | 4 +-
7 files changed, 24 insertions(+), 99 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 91961dcd8af..236763e0949 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
@@ -67,8 +67,6 @@ import
org.apache.ignite.internal.processors.authentication.UserAuthenticateResp
import
org.apache.ignite.internal.processors.authentication.UserAuthenticateResponseMessageSerializer;
import
org.apache.ignite.internal.processors.authentication.UserManagementOperationFinishedMessage;
import
org.apache.ignite.internal.processors.authentication.UserManagementOperationFinishedMessageSerializer;
-import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection;
-import
org.apache.ignite.internal.processors.cache.CacheEntryInfoCollectionSerializer;
import org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapter;
import
org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapterMarshallableSerializer;
import org.apache.ignite.internal.processors.cache.CacheEvictionEntry;
@@ -487,7 +485,6 @@ public class GridIoMessageFactory implements
MessageFactoryProvider {
factory.register((short)87, GridDhtPartitionExchangeId::new, new
GridDhtPartitionExchangeIdSerializer());
factory.register((short)88, GridCacheReturn::new, new
GridCacheReturnSerializer());
factory.register((short)91, GridCacheEntryInfo::new, new
GridCacheEntryInfoSerializer());
- factory.register((short)92, CacheEntryInfoCollection::new, new
CacheEntryInfoCollectionSerializer());
factory.register((short)93, CacheInvokeDirectResult::new, new
CacheInvokeDirectResultSerializer());
factory.register((short)94, IgniteTxKey::new, new
IgniteTxKeySerializer());
factory.register((short)95, DataStreamerEntry::new, new
DataStreamerEntrySerializer());
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryInfoCollection.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryInfoCollection.java
deleted file mode 100644
index e9e6e6da26d..00000000000
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryInfoCollection.java
+++ /dev/null
@@ -1,68 +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;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.ignite.internal.Order;
-import org.apache.ignite.plugin.extensions.communication.Message;
-
-/** TODO : IGNITE-26568. Revise, remove. */
-public class CacheEntryInfoCollection implements Message {
- /** */
- @Order(0)
- List<GridCacheEntryInfo> infos = new ArrayList<>();
-
- /**
- * @return Entries.
- */
- public List<GridCacheEntryInfo> infos() {
- return infos;
- }
-
- /**
- * @param info Entry.
- */
- public void add(GridCacheEntryInfo info) {
- infos.add(info);
- }
-
- /** {@inheritDoc} */
- @Override public short directType() {
- return 92;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- StringBuilder b = new StringBuilder();
- b.append("[");
-
- for (int i = 0; i < infos().size(); i++) {
- GridCacheEntryInfo info = infos().get(i);
-
- Object k = info.key().value(null, false);
-
- b.append("[key=").append(k == null ? "null" : k).append(", ver=").
- append(info.version()).append(",
val=").append(info.value()).append(']');
- }
-
- b.append(']');
-
- return b.toString();
- }
-}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index 5ee97669c93..f106d804430 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -22,6 +22,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.NavigableSet;
import java.util.Set;
@@ -48,7 +49,6 @@ import
org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.processors.affinity.AffinityAssignment;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.CacheMetricsImpl;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
@@ -573,7 +573,7 @@ public class GridDhtPartitionDemander {
AffinityAssignment aff = grp.affinity().cachedAffinity(topVer);
// Preload.
- for (Map.Entry<Integer, CacheEntryInfoCollection> e :
supplyMsg.getInfosSafe().entrySet()) {
+ for (Map.Entry<Integer, List<GridCacheEntryInfo>> e :
supplyMsg.getInfosSafe().entrySet()) {
int p = e.getKey();
if (aff.get(p).contains(ctx.localNode())) {
@@ -613,7 +613,7 @@ public class GridDhtPartitionDemander {
long[] byteRcv = {0};
GridIterableAdapter<GridCacheEntryInfo>
infosWrap = new GridIterableAdapter<>(
- new
IteratorWrapper<GridCacheEntryInfo>(e.getValue().infos().iterator()) {
+ new
IteratorWrapper<>(e.getValue().iterator()) {
/** {@inheritDoc} */
@Override public GridCacheEntryInfo
nextX() throws IgniteCheckedException {
GridCacheEntryInfo i =
super.nextX();
@@ -628,7 +628,7 @@ public class GridDhtPartitionDemander {
try {
preloadEntries(topVer, part, infosWrap);
- rebalanceFut.onReceivedKeys(p,
e.getValue().infos().size(), node);
+ rebalanceFut.onReceivedKeys(p,
e.getValue().size(), node);
}
catch (GridDhtInvalidPartitionException
ignored) {
if (log.isDebugEnabled())
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
index cee4b4ba773..f583e8192d9 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.cache.distributed.dht.preloader;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -26,7 +27,6 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.managers.communication.ErrorMessage;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.CacheObjectContext;
import org.apache.ignite.internal.processors.cache.GridCacheDeployable;
@@ -61,7 +61,7 @@ public class GridDhtPartitionSupplyMessage extends
GridCacheGroupIdMessage imple
/** Entries. */
@Order(4)
- Map<Integer, CacheEntryInfoCollection> infos;
+ Map<Integer, List<GridCacheEntryInfo>> infos;
/** Message size. */
@Order(5)
@@ -156,7 +156,7 @@ public class GridDhtPartitionSupplyMessage extends
GridCacheGroupIdMessage imple
// If partition is empty, we need to add it.
if (!getInfosSafe().containsKey(p))
- getInfosSafe().put(p, new CacheEntryInfoCollection());
+ getInfosSafe().put(p, new ArrayList<>());
}
}
@@ -181,7 +181,7 @@ public class GridDhtPartitionSupplyMessage extends
GridCacheGroupIdMessage imple
/**
* @return Entries.
*/
- public Map<Integer, CacheEntryInfoCollection> getInfosSafe() {
+ public Map<Integer, List<GridCacheEntryInfo>> getInfosSafe() {
if (infos == null)
infos = new HashMap<>();
@@ -219,12 +219,12 @@ public class GridDhtPartitionSupplyMessage extends
GridCacheGroupIdMessage imple
msgSize += info.marshalledSize(cacheObjCtx);
- CacheEntryInfoCollection infoCol = getInfosSafe().get(p);
+ List<GridCacheEntryInfo> infoCol = getInfosSafe().get(p);
if (infoCol == null) {
msgSize += 4;
- getInfosSafe().put(p, infoCol = new CacheEntryInfoCollection());
+ getInfosSafe().put(p, infoCol = new ArrayList<>());
}
infoCol.add(info);
@@ -239,9 +239,7 @@ public class GridDhtPartitionSupplyMessage extends
GridCacheGroupIdMessage imple
if (grp == null)
return;
- for (CacheEntryInfoCollection col : getInfosSafe().values()) {
- List<GridCacheEntryInfo> entries = col.infos();
-
+ for (List<GridCacheEntryInfo> entries : getInfosSafe().values()) {
for (int i = 0; i < entries.size(); i++)
entries.get(i).unmarshal(grp.cacheObjectContext(), ldr);
}
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties
b/modules/core/src/main/resources/META-INF/classnames.properties
index 61624a6225c..03bdf2e6e8a 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -807,7 +807,6 @@ org.apache.ignite.internal.processors.cache.CacheData
org.apache.ignite.internal.processors.cache.CacheDefaultBinaryAffinityKeyMapper
org.apache.ignite.internal.processors.cache.CacheEntryImpl
org.apache.ignite.internal.processors.cache.CacheEntryImplEx
-org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection
org.apache.ignite.internal.processors.cache.CacheEntryPredicate
org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapter
org.apache.ignite.internal.processors.cache.CacheEvictionEntry
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/RebalanceStatisticsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/RebalanceStatisticsTest.java
index eb614bab253..cfdeded5862 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/RebalanceStatisticsTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/RebalanceStatisticsTest.java
@@ -35,7 +35,6 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.TestRecordingCommunicationSpi;
-import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.CacheObjectContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
@@ -155,26 +154,26 @@ public class RebalanceStatisticsTest extends
GridCommonAbstractTest {
assertEquals(msgs.size(), supplierMsgs.size());
for (GridDhtPartitionSupplyMessage msg : msgs) {
- Map<Integer, CacheEntryInfoCollection> infos = U.field(msg,
"infos");
+ Map<Integer, List<GridCacheEntryInfo>> infos = U.field(msg,
"infos");
CacheGroupContext grpCtx =
node.context().cache().cacheGroup(msg.groupId());
long bytes = 0;
- for (CacheEntryInfoCollection c : infos.values()) {
- for (GridCacheEntryInfo i : c.infos())
+ for (List<GridCacheEntryInfo> entries : infos.values()) {
+ for (GridCacheEntryInfo i : entries)
bytes += getSize.apply(i, grpCtx.cacheObjectContext());
}
String[] checVals = {
"grp=" + grpCtx.cacheOrGroupName(),
"partitions=" + infos.size(),
- "entries=" + infos.values().stream().mapToInt(i ->
i.infos().size()).sum(),
+ "entries=" +
infos.values().stream().mapToInt(List::size).sum(),
"topVer=" + msg.topologyVersion(),
"rebalanceId=" + U.field(msg, "rebalanceId"),
"bytesRcvd=" + U.humanReadableByteCount(bytes),
"fullPartitions=" + infos.size(),
- "fullEntries=" + infos.values().stream().mapToInt(i ->
i.infos().size()).sum(),
+ "fullEntries=" +
infos.values().stream().mapToInt(List::size).sum(),
"fullBytesRcvd=" + U.humanReadableByteCount(bytes),
"histPartitions=0",
"histEntries=0",
@@ -192,21 +191,21 @@ public class RebalanceStatisticsTest extends
GridCommonAbstractTest {
long rebId = -1;
int parts = 0;
- int entries = 0;
+ int entriesCnt = 0;
long bytes = 0;
for (List<GridDhtPartitionSupplyMessage> msgs : supplyMsgs.values()) {
for (GridDhtPartitionSupplyMessage msg : msgs) {
- Map<Integer, CacheEntryInfoCollection> infos = U.field(msg,
"infos");
+ Map<Integer, List<GridCacheEntryInfo>> infos = U.field(msg,
"infos");
rebId = U.field(msg, "rebalanceId");
parts += infos.size();
- entries += infos.values().stream().mapToInt(i ->
i.infos().size()).sum();
+ entriesCnt +=
infos.values().stream().mapToInt(List::size).sum();
CacheObjectContext cacheObjCtx =
node.context().cache().cacheGroup(msg.groupId()).cacheObjectContext();
- for (CacheEntryInfoCollection c : infos.values()) {
- for (GridCacheEntryInfo i : c.infos())
+ for (List<GridCacheEntryInfo> entries : infos.values()) {
+ for (GridCacheEntryInfo i : entries)
bytes += getSize.apply(i, cacheObjCtx);
}
}
@@ -214,7 +213,7 @@ public class RebalanceStatisticsTest extends
GridCommonAbstractTest {
String[] checVals = {
"partitions=" + parts,
- "entries=" + entries,
+ "entries=" + entriesCnt,
"rebalanceId=" + rebId,
"bytesRcvd=" + U.humanReadableByteCount(bytes),
};
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateConsistencyTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateConsistencyTest.java
index 2d409eb3616..28b53c3cb36 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateConsistencyTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateConsistencyTest.java
@@ -57,8 +57,8 @@ import
org.apache.ignite.internal.pagemem.wal.record.DataRecord;
import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage;
-import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection;
import org.apache.ignite.internal.processors.cache.CacheInvalidStateException;
+import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
import org.apache.ignite.internal.processors.cache.GridCacheOperation;
import org.apache.ignite.internal.processors.cache.PartitionUpdateCounter;
import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage;
@@ -1532,7 +1532,7 @@ public class TxPartitionCounterStateConsistencyTest
extends TxPartitionCounterSt
if (msg0.groupId() != CU.cacheId(DEFAULT_CACHE_NAME))
return false;
- Map<Integer, CacheEntryInfoCollection> infos = U.field(msg0,
"infos");
+ Map<Integer, List<GridCacheEntryInfo>> infos = U.field(msg0,
"infos");
return infos.keySet().contains(primaryParts[0]);
}