This is an automated email from the ASF dual-hosted git repository.
apolovtsev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 7161f472fe5 IGNITE-27774 Remove BulkUpdateProducer (#7546)
7161f472fe5 is described below
commit 7161f472fe503a72ebd5cfaeafa22c042b3cf598
Author: Alexander Polovtcev <[email protected]>
AuthorDate: Fri Feb 6 18:49:24 2026 +0200
IGNITE-27774 Remove BulkUpdateProducer (#7546)
---
.../internal/catalog/BulkUpdateProducer.java | 53 ----------------------
.../internal/catalog/CatalogManagerImpl.java | 17 +++++--
.../ignite/internal/catalog/UpdateContext.java | 2 -
.../org/apache/ignite/raft/ItRaftMetricTest.java | 1 +
4 files changed, 15 insertions(+), 58 deletions(-)
diff --git
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/BulkUpdateProducer.java
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/BulkUpdateProducer.java
deleted file mode 100644
index 139014bfdd0..00000000000
---
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/BulkUpdateProducer.java
+++ /dev/null
@@ -1,53 +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.catalog;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.ignite.internal.catalog.storage.UpdateEntry;
-
-/**
- * Update producer that is used to group updates
- * when executing a batch of catalog commands.
- */
-class BulkUpdateProducer implements UpdateProducer {
- private final List<? extends UpdateProducer> commands;
-
- BulkUpdateProducer(List<? extends UpdateProducer> producers) {
- this.commands = producers;
- }
-
- @Override
- public List<UpdateEntry> get(UpdateContext updateContext) {
- List<UpdateEntry> bulkUpdateEntries = new ArrayList<>();
-
- for (UpdateProducer producer : commands) {
- List<UpdateEntry> entries = producer.get(updateContext);
-
- for (UpdateEntry entry : entries) {
- updateContext.updateCatalog(
- catalog -> entry.applyUpdate(catalog,
CatalogManager.INITIAL_TIMESTAMP)
- );
- }
-
- bulkUpdateEntries.addAll(entries);
- }
-
- return bulkUpdateEntries;
- }
-}
diff --git
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
index ffbb4771e78..fec18f416db 100644
---
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
+++
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
@@ -258,9 +258,21 @@ public class CatalogManagerImpl extends
AbstractEventProducer<CatalogEvent, Cata
CreateSchemaCommand.systemSchemaBuilder().name(SYSTEM_SCHEMA_NAME).build()
);
- List<UpdateEntry> entries = new
BulkUpdateProducer(initCommands).get(new UpdateContext(emptyCatalog));
+ var initialEntries = new ArrayList<UpdateEntry>();
- return updateLog.append(new VersionedUpdate(emptyCatalog.version() +
1, 0L, entries))
+ var context = new UpdateContext(emptyCatalog);
+
+ for (UpdateProducer producer : initCommands) {
+ List<UpdateEntry> entries = producer.get(context);
+
+ for (UpdateEntry entry : entries) {
+ context.updateCatalog(catalog -> entry.applyUpdate(catalog,
INITIAL_TIMESTAMP));
+ }
+
+ initialEntries.addAll(entries);
+ }
+
+ return updateLog.append(new VersionedUpdate(emptyCatalog.version() +
1, 0L, initialEntries))
.handle((result, error) -> {
if (error != null && !hasCause(error,
NodeStoppingException.class)) {
failureProcessor.process(new FailureContext(error,
"Unable to create default zone."));
@@ -587,5 +599,4 @@ public class CatalogManagerImpl extends
AbstractEventProducer<CatalogEvent, Cata
defaultZoneIdOpt(catalog)
);
}
-
}
diff --git
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/UpdateContext.java
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/UpdateContext.java
index 1ed481207c4..1f5a5675208 100644
---
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/UpdateContext.java
+++
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/UpdateContext.java
@@ -26,8 +26,6 @@ import java.util.function.Function;
* the updated instance. The base catalog instance can be used by a command
* to determine whether certain changes have been made to the catalog during
* processing of the current batch of commands.
- *
- * @see BulkUpdateProducer
*/
public class UpdateContext {
/** The base catalog descriptor. */
diff --git
a/modules/raft/src/integrationTest/java/org/apache/ignite/raft/ItRaftMetricTest.java
b/modules/raft/src/integrationTest/java/org/apache/ignite/raft/ItRaftMetricTest.java
index 1cc5dec07ad..962e6f1b778 100644
---
a/modules/raft/src/integrationTest/java/org/apache/ignite/raft/ItRaftMetricTest.java
+++
b/modules/raft/src/integrationTest/java/org/apache/ignite/raft/ItRaftMetricTest.java
@@ -48,6 +48,7 @@ public class ItRaftMetricTest extends
ClusterPerClassIntegrationTest {
}
@Test
+ @Disabled("https://issues.apache.org/jira/browse/IGNITE-27728")
void testLeaderCountIncreases() {
testMetricChangeAfterOperation(
CLUSTER,