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

rpuch 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 cd870a5727 IGNITE-22983 Create public API components once (#4228)
cd870a5727 is described below

commit cd870a5727fc8e7a0651e0e61acd881b0fa1d9a2
Author: Roman Puchkovskiy <roman.puchkovs...@gmail.com>
AuthorDate: Wed Aug 14 11:20:48 2024 +0400

    IGNITE-22983 Create public API components once (#4228)
---
 .../org/apache/ignite/internal/app/IgniteImpl.java | 27 ++++++++++++++++------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git 
a/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java 
b/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
index 9b4b542271..fa82609508 100644
--- 
a/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
+++ 
b/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
@@ -403,10 +403,16 @@ public class IgniteImpl implements Ignite {
 
     private final Executor asyncContinuationExecutor = 
ForkJoinPool.commonPool();
 
+    private final IgniteTables publicTables;
+    private final IgniteTransactions publicTransactions;
+    private final IgniteSql publicSql;
+    private final IgniteCompute publicCompute;
+    private final IgniteCatalog publicCatalog;
+
     /** Default log storage factory for raft. */
     private final LogStorageFactory logStorageFactory;
 
-    private IndexMetaStorage indexMetaStorage;
+    private final IndexMetaStorage indexMetaStorage;
 
     /**
      * The Constructor.
@@ -987,6 +993,14 @@ public class IgniteImpl implements Ignite {
         );
 
         restComponent = createRestComponent(name);
+
+        publicTables = new PublicApiThreadingIgniteTables(distributedTblMgr, 
asyncContinuationExecutor);
+        publicTransactions = new PublicApiThreadingIgniteTransactions(
+                new IgniteTransactionsImpl(txManager, 
observableTimestampTracker), asyncContinuationExecutor
+        );
+        publicSql = new PublicApiThreadingIgniteSql(sql, 
asyncContinuationExecutor);
+        publicCompute = new AntiHijackIgniteCompute(compute, 
asyncContinuationExecutor);
+        publicCatalog = new PublicApiThreadingIgniteCatalog(new 
IgniteCatalogSqlImpl(sql, distributedTblMgr), asyncContinuationExecutor);
     }
 
     private static Map<String, StorageEngine> 
applyThreadAssertionsIfNeeded(Map<String, StorageEngine> storageEngines) {
@@ -1338,7 +1352,7 @@ public class IgniteImpl implements Ignite {
     /** {@inheritDoc} */
     @Override
     public IgniteTables tables() {
-        return new PublicApiThreadingIgniteTables(distributedTblMgr, 
asyncContinuationExecutor);
+        return publicTables;
     }
 
     public DisasterRecoveryManager disasterRecoveryManager() {
@@ -1373,8 +1387,7 @@ public class IgniteImpl implements Ignite {
     /** {@inheritDoc} */
     @Override
     public IgniteTransactions transactions() {
-        IgniteTransactionsImpl transactions = new 
IgniteTransactionsImpl(txManager, observableTimestampTracker);
-        return new PublicApiThreadingIgniteTransactions(transactions, 
asyncContinuationExecutor);
+        return publicTransactions;
     }
 
     private IgniteSql bareSql() {
@@ -1384,7 +1397,7 @@ public class IgniteImpl implements Ignite {
     /** {@inheritDoc} */
     @Override
     public IgniteSql sql() {
-        return new PublicApiThreadingIgniteSql(sql, asyncContinuationExecutor);
+        return publicSql;
     }
 
     /** {@inheritDoc} */
@@ -1396,7 +1409,7 @@ public class IgniteImpl implements Ignite {
     /** {@inheritDoc} */
     @Override
     public IgniteCompute compute() {
-        return new AntiHijackIgniteCompute(compute, asyncContinuationExecutor);
+        return publicCompute;
     }
 
     /** {@inheritDoc} */
@@ -1413,7 +1426,7 @@ public class IgniteImpl implements Ignite {
 
     @Override
     public IgniteCatalog catalog() {
-        return new PublicApiThreadingIgniteCatalog(new 
IgniteCatalogSqlImpl(sql, distributedTblMgr), asyncContinuationExecutor);
+        return publicCatalog;
     }
 
     /**

Reply via email to