This is an automated email from the ASF dual-hosted git repository.

vpyatkov 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 29b1978fc81 IGNITE-26653 Revert "IGNITE-26549 Async file io uses 
default pool (#6720)
29b1978fc81 is described below

commit 29b1978fc8160d10379026ea45ec82574b39ee6a
Author: Vladislav Pyatkov <[email protected]>
AuthorDate: Wed Oct 8 16:56:42 2025 +0300

    IGNITE-26653 Revert "IGNITE-26549 Async file io uses default pool (#6720)
---
 modules/file-io/build.gradle                       |  1 -
 .../apache/ignite/internal/fileio/AsyncFileIo.java |  7 ++---
 .../ignite/internal/fileio/AsyncFileIoFactory.java | 23 +--------------
 .../PersistentPageMemoryStorageEngine.java         | 34 ++--------------------
 4 files changed, 6 insertions(+), 59 deletions(-)

diff --git a/modules/file-io/build.gradle b/modules/file-io/build.gradle
index 7f09511f3c5..0ca66c38f60 100644
--- a/modules/file-io/build.gradle
+++ b/modules/file-io/build.gradle
@@ -20,7 +20,6 @@ apply from: "$rootDir/buildscripts/publishing.gradle"
 apply from: "$rootDir/buildscripts/java-junit5.gradle"
 
 dependencies {
-    implementation libs.jetbrains.annotations
     implementation project(':ignite-core')
 
     testImplementation project(':ignite-core')
diff --git 
a/modules/file-io/src/main/java/org/apache/ignite/internal/fileio/AsyncFileIo.java
 
b/modules/file-io/src/main/java/org/apache/ignite/internal/fileio/AsyncFileIo.java
index eabed32c019..536eed16444 100644
--- 
a/modules/file-io/src/main/java/org/apache/ignite/internal/fileio/AsyncFileIo.java
+++ 
b/modules/file-io/src/main/java/org/apache/ignite/internal/fileio/AsyncFileIo.java
@@ -31,8 +31,6 @@ import java.util.concurrent.CancellationException;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import org.jetbrains.annotations.Nullable;
 
 /**
  * {@link FileIo} implementation based on {@link AsynchronousFileChannel}.
@@ -50,12 +48,11 @@ public class AsyncFileIo extends AbstractFileIo {
      * Creates I/O implementation for specified file.
      *
      * @param filePath File path.
-     * @param asyncIoExecutor Callback executor. If the parameter is {@code 
null}, then the system default thread pool will be used.
      * @param modes Open modes.
      * @throws IOException If some I/O error occurs.
      */
-    public AsyncFileIo(Path filePath, @Nullable ExecutorService 
asyncIoExecutor, OpenOption... modes) throws IOException {
-        ch = AsynchronousFileChannel.open(filePath, Set.of(modes), 
asyncIoExecutor);
+    public AsyncFileIo(Path filePath, OpenOption... modes) throws IOException {
+        ch = AsynchronousFileChannel.open(filePath, modes);
     }
 
     /** {@inheritDoc} */
diff --git 
a/modules/file-io/src/main/java/org/apache/ignite/internal/fileio/AsyncFileIoFactory.java
 
b/modules/file-io/src/main/java/org/apache/ignite/internal/fileio/AsyncFileIoFactory.java
index d1521af472b..f3b09fc6b71 100644
--- 
a/modules/file-io/src/main/java/org/apache/ignite/internal/fileio/AsyncFileIoFactory.java
+++ 
b/modules/file-io/src/main/java/org/apache/ignite/internal/fileio/AsyncFileIoFactory.java
@@ -20,35 +20,14 @@ package org.apache.ignite.internal.fileio;
 import java.io.IOException;
 import java.nio.file.OpenOption;
 import java.nio.file.Path;
-import java.util.concurrent.ExecutorService;
-import org.jetbrains.annotations.Nullable;
 
 /**
  * {@link AsyncFileIo} factory.
  */
 public class AsyncFileIoFactory implements FileIoFactory {
-    /** Async callback executor. {@code null} for system default pool. */
-    private final @Nullable ExecutorService asyncIoExecutor;
-
-    /**
-     * Constructor.
-     */
-    public AsyncFileIoFactory() {
-        this(null);
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param asyncIoExecutor Async callback executor or {@code null} to use 
the default pool.
-     */
-    public AsyncFileIoFactory(@Nullable ExecutorService asyncIoExecutor) {
-        this.asyncIoExecutor = asyncIoExecutor;
-    }
-
     /** {@inheritDoc} */
     @Override
     public FileIo create(Path filePath, OpenOption... modes) throws 
IOException {
-        return new AsyncFileIo(filePath, asyncIoExecutor, modes);
+        return new AsyncFileIo(filePath, modes);
     }
 }
diff --git 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryStorageEngine.java
 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryStorageEngine.java
index c6173b2cbf2..8d257645863 100644
--- 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryStorageEngine.java
+++ 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryStorageEngine.java
@@ -117,15 +117,6 @@ public class PersistentPageMemoryStorageEngine extends 
AbstractPageMemoryStorage
 
     private volatile ExecutorService destructionExecutor;
 
-    /**
-     * Executor service for performing asynchronous I/O operations.
-     *
-     * <p>
-     * This field is initialized when the engine is configured to use 
asynchronous file I/O.
-     * If the engine is configured to use synchronous I/O, this field remains 
{@code null}.
-     */
-    private volatile @Nullable ExecutorService asyncIoExecutor;
-
     private final FailureManager failureManager;
 
     private final LogSyncer logSyncer;
@@ -192,24 +183,9 @@ public class PersistentPageMemoryStorageEngine extends 
AbstractPageMemoryStorage
         int pageSize = engineConfig.pageSizeBytes().value();
 
         try {
-            FileIoFactory fileIoFactory;
-
-            if (engineConfig.checkpoint().useAsyncFileIoFactory().value()) {
-                asyncIoExecutor = new ThreadPoolExecutor(
-                        Runtime.getRuntime().availableProcessors(),
-                        Runtime.getRuntime().availableProcessors(),
-                        100,
-                        TimeUnit.MILLISECONDS,
-                        new LinkedBlockingQueue<>(),
-                        IgniteThreadFactory.create(igniteInstanceName, 
"persistent-mv-async-io", LOG)
-                );
-
-                fileIoFactory = new AsyncFileIoFactory(asyncIoExecutor);
-            } else {
-                asyncIoExecutor = null;
-
-                fileIoFactory = new RandomAccessFileIoFactory();
-            }
+            FileIoFactory fileIoFactory = 
engineConfig.checkpoint().useAsyncFileIoFactory().value()
+                    ? new AsyncFileIoFactory()
+                    : new RandomAccessFileIoFactory();
 
             filePageStoreManager = 
createFilePageStoreManager(igniteInstanceName, storagePath, fileIoFactory, 
pageSize, failureManager);
 
@@ -300,16 +276,12 @@ public class PersistentPageMemoryStorageEngine extends 
AbstractPageMemoryStorage
             ExecutorService destructionExecutor = this.destructionExecutor;
             CheckpointManager checkpointManager = this.checkpointManager;
             FilePageStoreManager filePageStoreManager = 
this.filePageStoreManager;
-            ExecutorService asyncIoExecutor = this.asyncIoExecutor;
 
             Stream<AutoCloseable> resources = Stream.of(
                     destructionExecutor == null
                             ? null
                             : (AutoCloseable) () -> 
shutdownAndAwaitTermination(destructionExecutor, 30, TimeUnit.SECONDS),
                     checkpointManager == null ? null : (AutoCloseable) 
checkpointManager::stop,
-                    asyncIoExecutor == null
-                            ? null
-                            : (AutoCloseable) () -> 
shutdownAndAwaitTermination(asyncIoExecutor, 30, TimeUnit.SECONDS),
                     filePageStoreManager == null ? null : (AutoCloseable) 
filePageStoreManager::stop
             );
 

Reply via email to