This is an automated email from the ASF dual-hosted git repository.
wernerdv 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 61a8ee4321c IGNITE-29113 Remove dead code for the partition allocation
map (#13658)
61a8ee4321c is described below
commit 61a8ee4321ccf1c74ca7d91fc003b8d1a689c220
Author: Dmitry Werner <[email protected]>
AuthorDate: Wed Oct 7 18:28:21 2026 +0500
IGNITE-29113 Remove dead code for the partition allocation map (#13658)
---
.../checkpoint/CheckpointContextImpl.java | 12 --
.../persistence/checkpoint/CheckpointListener.java | 6 -
.../persistence/checkpoint/CheckpointWorkflow.java | 7 +-
.../partstate/PagesAllocationRange.java | 67 ---------
.../partstate/PartitionAllocationMap.java | 166 ---------------------
.../db/IgniteSequentialNodeCrashRecoveryTest.java | 6 -
6 files changed, 2 insertions(+), 262 deletions(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointContextImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointContextImpl.java
index a2134cb80c6..2f4ad80b071 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointContextImpl.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointContextImpl.java
@@ -21,7 +21,6 @@ import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
-import
org.apache.ignite.internal.processors.cache.persistence.partstate.PartitionAllocationMap;
import org.apache.ignite.internal.thread.pool.IgniteThreadPoolExecutor;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -38,9 +37,6 @@ public class CheckpointContextImpl implements
CheckpointListener.Context {
/** Current checkpoint progress. */
private final CheckpointProgressImpl curr;
- /** Partition map. */
- private final PartitionAllocationMap map;
-
/** Checkpoint runner thread pool. If null tasks are to be run in single
thread */
@Nullable private final IgniteThreadPoolExecutor asyncRunner;
@@ -55,18 +51,15 @@ public class CheckpointContextImpl implements
CheckpointListener.Context {
/**
* @param curr Current checkpoint progress.
- * @param map Partition map.
* @param asyncRunner Checkpoint runner thread pool.
* @param heartbeat Heartbeat updater.
*/
CheckpointContextImpl(
CheckpointProgressImpl curr,
- PartitionAllocationMap map,
@Nullable IgniteThreadPoolExecutor asyncRunner,
WorkProgressDispatcher heartbeat
) {
this.curr = curr;
- this.map = map;
this.asyncRunner = asyncRunner;
this.heartbeatUpdater = heartbeat;
this.pendingTaskFuture = this.asyncRunner == null ? null : new
GridCompoundFuture();
@@ -92,11 +85,6 @@ public class CheckpointContextImpl implements
CheckpointListener.Context {
return curr.futureFor(FINISHED);
}
- /** {@inheritDoc} */
- @Override public PartitionAllocationMap partitionStatMap() {
- return map;
- }
-
/** {@inheritDoc} */
@Override public Executor executor() {
return asyncRunner == null ? null : cmd -> {
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointListener.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointListener.java
index c18cd7b1a1c..ef57028708e 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointListener.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointListener.java
@@ -20,7 +20,6 @@ package
org.apache.ignite.internal.processors.cache.persistence.checkpoint;
import java.util.concurrent.Executor;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
-import
org.apache.ignite.internal.processors.cache.persistence.partstate.PartitionAllocationMap;
import org.jetbrains.annotations.Nullable;
/**
@@ -51,11 +50,6 @@ public interface CheckpointListener {
*/
public IgniteInternalFuture<?> finishedStateFut();
- /**
- * @return Partition allocation statistic map
- */
- public PartitionAllocationMap partitionStatMap();
-
/**
* @return Context executor.
*/
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointWorkflow.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointWorkflow.java
index 47480dace14..d2c10787daa 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointWorkflow.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/CheckpointWorkflow.java
@@ -59,7 +59,6 @@ import
org.apache.ignite.internal.processors.cache.persistence.DataRegion;
import
org.apache.ignite.internal.processors.cache.persistence.StorageException;
import
org.apache.ignite.internal.processors.cache.persistence.pagemem.CheckpointMetricsTracker;
import
org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryEx;
-import
org.apache.ignite.internal.processors.cache.persistence.partstate.PartitionAllocationMap;
import org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer;
import org.apache.ignite.internal.thread.pool.IgniteForkJoinPool;
import org.apache.ignite.internal.thread.pool.IgniteStripedExecutor;
@@ -243,9 +242,7 @@ public class CheckpointWorkflow {
WALPointer cpPtr = null;
- CheckpointContextImpl ctx0 = new CheckpointContextImpl(
- curr, new PartitionAllocationMap(),
checkpointCollectPagesInfoPool, workProgressDispatcher
- );
+ CheckpointContextImpl ctx0 = new CheckpointContextImpl(curr,
checkpointCollectPagesInfoPool, workProgressDispatcher);
checkpointReadWriteLock.readLock();
@@ -577,7 +574,7 @@ public class CheckpointWorkflow {
if (checkpointMarkersStorage != null)
checkpointMarkersStorage.onCheckpointFinished(chp);
- CheckpointContextImpl emptyCtx = new
CheckpointContextImpl(chp.progress, null, null, null);
+ CheckpointContextImpl emptyCtx = new
CheckpointContextImpl(chp.progress, null, null);
Collection<DataRegion> checkpointedRegions = dataRegions.get();
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/partstate/PagesAllocationRange.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/partstate/PagesAllocationRange.java
deleted file mode 100644
index f4508eedb49..00000000000
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/partstate/PagesAllocationRange.java
+++ /dev/null
@@ -1,67 +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.persistence.partstate;
-
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Range of pages allocated.
- * Contains currently allocated page count and previously observed page count.
- * May be used for tracking history of recent allocation for partition
<code>[partition, cacheId]</code>
- */
-public class PagesAllocationRange {
- /**
- * Previously observed total number of allocated pages. May be stored
using PageMetaIO.
- * Used to separate newly allocated pages with previously observed state
- * Minimum value is 0. Can't be greater than {@link #currAllocatedPageCnt}
- */
- private final int lastAllocatedPageCnt;
-
- /** Total current number of pages allocated, minimum value is 0. */
- private final int currAllocatedPageCnt;
-
- /**
- * Creates pages range
- *
- * @param lastAllocatedPageCnt Last allocated pages count.
- * @param currAllocatedPageCnt Currently allocated pages count.
- */
- public PagesAllocationRange(final int lastAllocatedPageCnt, final int
currAllocatedPageCnt) {
- this.lastAllocatedPageCnt = lastAllocatedPageCnt;
- this.currAllocatedPageCnt = currAllocatedPageCnt;
- }
-
- /**
- * @return Total current number of pages allocated, minimum value is 0.
- */
- public int getCurrAllocatedPageCnt() {
- return currAllocatedPageCnt;
- }
-
- /**
- * @return Previously observed total number of allocated pages.
- */
- public int getLastAllocatedPageCnt() {
- return lastAllocatedPageCnt;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(PagesAllocationRange.class, this);
- }
-}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/partstate/PartitionAllocationMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/partstate/PartitionAllocationMap.java
deleted file mode 100644
index 808ab41bc01..00000000000
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/partstate/PartitionAllocationMap.java
+++ /dev/null
@@ -1,166 +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.persistence.partstate;
-
-import java.util.Map;
-import java.util.NavigableMap;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.concurrent.ConcurrentHashMap;
-import org.apache.ignite.internal.pagemem.FullPageId;
-import org.apache.ignite.internal.pagemem.PageIdAllocator;
-import org.apache.ignite.internal.pagemem.PageIdUtils;
-import org.apache.ignite.internal.util.GridConcurrentHashSet;
-import org.apache.ignite.internal.util.tostring.GridToStringInclude;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Information structure with partitions state.
- * Page counts map.
- */
-public class PartitionAllocationMap {
- /** Maps following pairs: (groupId, partId) -> (lastAllocatedCount,
allocatedCount) */
- @GridToStringInclude
- private final Map<GroupPartitionId, PagesAllocationRange> writeMap = new
ConcurrentHashMap<>();
-
- /** Map used by snapshot executor. */
- @GridToStringInclude
- private NavigableMap<GroupPartitionId, PagesAllocationRange> readMap;
-
- /** Partitions forced to be skipped. */
- @GridToStringInclude
- private final Set<GroupPartitionId> skippedParts = new
GridConcurrentHashSet<>();
-
- /**
- * Returns the value to which the specified key is mapped,
- * or {@code null} if this map contains no mapping for the key.
- *
- * @param key to get
- * @return value or null
- */
- @Nullable public PagesAllocationRange get(GroupPartitionId key) {
- return readMap.get(key);
- }
-
- /**
- * @param fullPageId Full page id.
- */
- @Nullable public PagesAllocationRange get(FullPageId fullPageId) {
- return readMap.get(createCachePartId(fullPageId));
- }
-
- /**
- * Extracts partition information from full page ID
- *
- * @param fullId page related to some cache
- * @return pair of cache ID and partition ID
- */
- @NotNull public static GroupPartitionId createCachePartId(@NotNull final
FullPageId fullId) {
- return new GroupPartitionId(fullId.groupId(),
PageIdUtils.partId(fullId.pageId()));
- }
-
- /** @return <tt>true</tt> if this map contains no key-value mappings */
- public boolean isEmpty() {
- return readMap.isEmpty();
- }
-
- /** @return the number of key-value mappings in this map. */
- public int size() {
- return readMap.size();
- }
-
- /** @return keys (all caches partitions) */
- public Set<GroupPartitionId> keySet() {
- return readMap.keySet();
- }
-
- /** @return values (allocation ranges) */
- public Iterable<PagesAllocationRange> values() {
- return readMap.values();
- }
-
- /** @return Returns the first (lowest) key currently in this map. */
- public GroupPartitionId firstKey() {
- return readMap.firstKey();
- }
-
- /**
- * Forces the index partition for the given group ID to be skipped in
collected map.
- *
- * @param grpId Group ID to skip.
- * @return {@code true} if skipped partition was added to the ignore list
during this call.
- */
- public boolean forceSkipIndexPartition(int grpId) {
- return skippedParts.add(new GroupPartitionId(grpId,
PageIdAllocator.INDEX_PARTITION));
- }
-
- /**
- * Returns next (higher) key for provided cache and partition or null
- *
- * @param key cache and partition to search
- * @return first found key which is greater than provided
- */
- @Nullable public GroupPartitionId nextKey(@NotNull final GroupPartitionId
key) {
- return readMap.navigableKeySet().higher(key);
- }
-
- /** @return set view of the mappings contained in this map, sorted in
ascending key order */
- public Set<Map.Entry<GroupPartitionId, PagesAllocationRange>> entrySet() {
- return readMap.entrySet();
- }
-
- /** @return <tt>true</tt> if this map contains a mapping for the specified
key */
- public boolean containsKey(GroupPartitionId key) {
- return readMap.containsKey(key);
- }
-
- /**
- * @param key key with which the specified value is to be associated
- * @param val value to be associated with the specified key
- * @return the previous value associated with <tt>key</tt>, or
<tt>null</tt> if there was no mapping for
- * <tt>key</tt>.
- */
- public PagesAllocationRange put(GroupPartitionId key, PagesAllocationRange
val) {
- return writeMap.put(key, val);
- }
-
- /**
- * Prepare map for snapshot.
- */
- public void prepareForSnapshot() {
- if (readMap != null)
- return;
-
- readMap = new TreeMap<>();
-
- for (Map.Entry<GroupPartitionId, PagesAllocationRange> entry :
writeMap.entrySet()) {
- if (!skippedParts.contains(entry.getKey()))
- readMap.put(entry.getKey(), entry.getValue());
- }
-
- skippedParts.clear();
- writeMap.clear();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(PartitionAllocationMap.class, this);
- }
-}
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteSequentialNodeCrashRecoveryTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteSequentialNodeCrashRecoveryTest.java
index f82cbcacde6..c16c5fd215a 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteSequentialNodeCrashRecoveryTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteSequentialNodeCrashRecoveryTest.java
@@ -59,7 +59,6 @@ import
org.apache.ignite.internal.processors.cache.persistence.file.RandomAccess
import
org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree;
import
org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage;
import
org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl;
-import
org.apache.ignite.internal.processors.cache.persistence.partstate.PartitionAllocationMap;
import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateMessage;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.S;
@@ -305,11 +304,6 @@ public class IgniteSequentialNodeCrashRecoveryTest extends
GridCommonAbstractTes
return null;
}
- /** {@inheritDoc} */
- @Override public PartitionAllocationMap partitionStatMap() {
- return null;
- }
-
/** {@inheritDoc} */
@Override public void walFlush(boolean flush) {
// No-op.