You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2026/02/03 13:31:29 UTC
(ignite-3) branch main updated: IGNITE-25403 Add overloads without tx to IgniteSql, RecordView, KeyValueView (#5836)
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn 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 23332b00e0c IGNITE-25403 Add overloads without tx to IgniteSql, RecordView, KeyValueView (#5836)
23332b00e0c is described below
commit 23332b00e0c38faaa4ee324337822fece2a1ca47
Author: Ed Rakhmankulov <Er...@gmail.com>
AuthorDate: Tue Feb 3 16:31:23 2026 +0300
IGNITE-25403 Add overloads without tx to IgniteSql, RecordView, KeyValueView (#5836)
Add no-transaction overloads to `IgniteSql`, `RecordView`, `KeyValueView`.
New methods:
```
org.apache.ignite.table.KeyValueView#get(K)
org.apache.ignite.table.KeyValueView#getAsync(K)
org.apache.ignite.table.KeyValueView#getNullable(K)
org.apache.ignite.table.KeyValueView#getNullableAsync(K)
org.apache.ignite.table.KeyValueView#getOrDefault(K, V)
org.apache.ignite.table.KeyValueView#getOrDefaultAsync(K, V)
org.apache.ignite.table.KeyValueView#getAll(java.util.Collection<K>)
org.apache.ignite.table.KeyValueView#getAllAsync(java.util.Collection<K>)
org.apache.ignite.table.KeyValueView#contains(K)
org.apache.ignite.table.KeyValueView#containsAsync(K)
org.apache.ignite.table.KeyValueView#containsAll(java.util.Collection<K>)
org.apache.ignite.table.KeyValueView#containsAllAsync(java.util.Collection<K>)
org.apache.ignite.table.KeyValueView#put(K, V)
org.apache.ignite.table.KeyValueView#putAsync(K, V)
org.apache.ignite.table.KeyValueView#putAll(java.util.Map<K,V>)
org.apache.ignite.table.KeyValueView#putAllAsync(java.util.Map<K,V>)
org.apache.ignite.table.KeyValueView#getAndPut(K, V)
org.apache.ignite.table.KeyValueView#getAndPutAsync(K, V)
org.apache.ignite.table.KeyValueView#getNullableAndPut(K, V)
org.apache.ignite.table.KeyValueView#getNullableAndPutAsync(K, V)
org.apache.ignite.table.KeyValueView#putIfAbsent(K, V)
org.apache.ignite.table.KeyValueView#putIfAbsentAsync(K, V)
org.apache.ignite.table.KeyValueView#remove(K)
org.apache.ignite.table.KeyValueView#removeExact(org.apache.ignite.tx.Transaction, K, V)
org.apache.ignite.table.KeyValueView#removeExact(K, V)
org.apache.ignite.table.KeyValueView#removeAsync(K)
org.apache.ignite.table.KeyValueView#removeExactAsync(org.apache.ignite.tx.Transaction, K, V)
org.apache.ignite.table.KeyValueView#removeExactAsync(K, V)
org.apache.ignite.table.KeyValueView#removeAll()
org.apache.ignite.table.KeyValueView#removeAllAsync()
org.apache.ignite.table.KeyValueView#getAndRemove(K)
org.apache.ignite.table.KeyValueView#getAndRemoveAsync(K)
org.apache.ignite.table.KeyValueView#getNullableAndRemove(K)
org.apache.ignite.table.KeyValueView#getNullableAndRemoveAsync(K)
org.apache.ignite.table.KeyValueView#replace(K, V)
org.apache.ignite.table.KeyValueView#replaceExact(org.apache.ignite.tx.Transaction, K, V, V)
org.apache.ignite.table.KeyValueView#replaceExact(K, V, V)
org.apache.ignite.table.KeyValueView#replaceAsync(K, V)
org.apache.ignite.table.KeyValueView#replaceExactAsync(org.apache.ignite.tx.Transaction, K, V, V)
org.apache.ignite.table.KeyValueView#replaceExactAsync(K, V, V)
org.apache.ignite.table.KeyValueView#getAndReplace(K, V)
org.apache.ignite.table.KeyValueView#getAndReplaceAsync(K, V)
org.apache.ignite.table.KeyValueView#getNullableAndReplace(K, V)
org.apache.ignite.table.KeyValueView#getNullableAndReplaceAsync(K, V)
org.apache.ignite.table.RecordView#get(R)
org.apache.ignite.table.RecordView#getAsync(R)
org.apache.ignite.table.RecordView#getAll(java.util.Collection<R>)
org.apache.ignite.table.RecordView#getAllAsync(java.util.Collection<R>)
org.apache.ignite.table.RecordView#contains(R)
org.apache.ignite.table.RecordView#containsAsync(R)
org.apache.ignite.table.RecordView#containsAll(java.util.Collection<R>)
org.apache.ignite.table.RecordView#containsAllAsync(java.util.Collection<R>)
org.apache.ignite.table.RecordView#upsert(R)
org.apache.ignite.table.RecordView#upsertAsync(R)
org.apache.ignite.table.RecordView#upsertAll(java.util.Collection<R>)
org.apache.ignite.table.RecordView#upsertAllAsync(java.util.Collection<R>)
org.apache.ignite.table.RecordView#getAndUpsert(R)
org.apache.ignite.table.RecordView#getAndUpsertAsync(R)
org.apache.ignite.table.RecordView#insert(R)
org.apache.ignite.table.RecordView#insertAsync(R)
org.apache.ignite.table.RecordView#insertAll(java.util.Collection<R>)
org.apache.ignite.table.RecordView#insertAllAsync(java.util.Collection<R>)
org.apache.ignite.table.RecordView#replace(R)
org.apache.ignite.table.RecordView#replaceExact(org.apache.ignite.tx.Transaction, R, R)
org.apache.ignite.table.RecordView#replaceExact(R, R)
org.apache.ignite.table.RecordView#replaceAsync(R)
org.apache.ignite.table.RecordView#replaceExactAsync(org.apache.ignite.tx.Transaction, R, R)
org.apache.ignite.table.RecordView#replaceExactAsync(R, R)
org.apache.ignite.table.RecordView#getAndReplace(R)
org.apache.ignite.table.RecordView#getAndReplaceAsync(R)
org.apache.ignite.table.RecordView#delete(R)
org.apache.ignite.table.RecordView#deleteAsync(R)
org.apache.ignite.table.RecordView#deleteExact(R)
org.apache.ignite.table.RecordView#deleteExactAsync(R)
org.apache.ignite.table.RecordView#getAndDelete(R)
org.apache.ignite.table.RecordView#getAndDeleteAsync(R)
org.apache.ignite.table.RecordView#deleteAll()
org.apache.ignite.table.RecordView#deleteAllAsync()
org.apache.ignite.table.RecordView#deleteAllExact(java.util.Collection<R>)
org.apache.ignite.table.RecordView#deleteAllExactAsync(java.util.Collection<R>)
org.apache.ignite.sql.IgniteSql#execute(java.lang.String, java.lang.Object...)
org.apache.ignite.sql.IgniteSql#executeAsync(java.lang.String, java.lang.Object...)
org.apache.ignite.sql.IgniteSql#executeBatch(java.lang.String, org.apache.ignite.sql.BatchedArguments)
org.apache.ignite.sql.IgniteSql#executeBatchAsync(java.lang.String, org.apache.ignite.sql.BatchedArguments)
```
Deprecated methods:
```
org.apache.ignite.table.KeyValueView#remove(org.apache.ignite.tx.Transaction, K, V)
org.apache.ignite.table.KeyValueView#removeAsync(org.apache.ignite.tx.Transaction, K, V)
org.apache.ignite.table.KeyValueView#replace(org.apache.ignite.tx.Transaction, K, V, V)
org.apache.ignite.table.KeyValueView#replaceAsync(org.apache.ignite.tx.Transaction, K, V, V)
org.apache.ignite.table.RecordView#replace(org.apache.ignite.tx.Transaction, R, R)
org.apache.ignite.table.RecordView#replaceAsync(org.apache.ignite.tx.Transaction, R, R)
```
https://issues.apache.org/jira/browse/IGNITE-25403
---
.../ignite/example/client/IgniteClientExample.java | 2 +-
.../client/IgniteClientWithConfigExample.java | 2 +-
.../apache/ignite/example/sql/SqlApiExample.java | 10 +-
.../streaming/DetectFailedEntriesExample.java | 4 +-
.../streaming/SingleTableDataStreamerExample.java | 5 +-
.../apache/ignite/example/table/QueryExample.java | 8 +-
.../apache/ignite/example/table/TableExample.java | 2 +-
.../persistence/Ignite2PersistentCacheTools.java | 2 +-
modules/api/build.gradle | 2 +
.../main/java/org/apache/ignite/sql/IgniteSql.java | 48 ++
.../java/org/apache/ignite/table/KeyValueView.java | 604 ++++++++++++++++-
.../java/org/apache/ignite/table/RecordView.java | 385 ++++++++++-
.../ignite/table/TableApiConsistencyTest.java | 741 +++++++++++++++++++++
.../internal/catalog/sql/SelectFromView.java | 3 +-
.../table/ClientTupleReplaceExactRequest.java | 2 +-
.../apache/ignite/client/ClientOperationType.java | 2 +-
.../client/table/ClientKeyValueBinaryView.java | 12 +-
.../internal/client/table/ClientKeyValueView.java | 12 +-
.../client/table/ClientRecordBinaryView.java | 6 +-
.../internal/client/table/ClientRecordView.java | 6 +-
.../table/api/PublicApiClientKeyValueView.java | 16 +-
.../table/api/PublicApiClientRecordView.java | 8 +-
.../apache/ignite/client/ClientMetricsTest.java | 2 +-
.../org/apache/ignite/client/ClientSqlTest.java | 19 +-
.../apache/ignite/client/ServerMetricsTest.java | 2 +-
.../internal/client/ClientCompatibilityTests.java | 4 +-
.../ignite/internal/ApiCompatibilityTest.java | 14 +-
.../ignite/internal/CompatibilityTestCommon.java | 2 +-
.../ItDistributionZonesFiltersTest.java | 25 +-
.../distributionzones/ItEmptyDataNodesTest.java | 6 +-
.../rebalance/ItRebalanceRecoveryTest.java | 8 +-
.../rebalance/ItRebalanceTriggersRecoveryTest.java | 24 +-
.../ignite/internal/index/IndexBuildTestUtils.java | 2 +-
.../ignite/internal/index/ItBuildIndexTest.java | 2 +-
.../ItIndexAndIndexStorageDestructionTest.java | 6 +-
.../index/ItIndexBuildCompletenessTest.java | 2 +-
...dexRegistrationAndRebalanceConcurrencyTest.java | 2 +-
.../ignite/jdbc/ItJdbcAuthenticationTest.java | 2 +-
.../replicator/ItBigZoneOperationTest.java | 2 +-
.../raftsnapshot/ItTableRaftSnapshotsTest.java | 2 +-
.../rest/sql/ItSqlQueryControllerTest.java | 3 +-
.../internal/rest/sql/SqlQueryController.java | 3 +-
.../rest/transaction/TransactionController.java | 3 +-
.../ignite/internal/app/AsyncApiOperation.java | 9 +-
.../ignite/internal/app/SyncApiOperation.java | 5 +-
.../benchmark/AbstractMultiNodeBenchmark.java | 4 +-
.../internal/benchmark/BulkDeleteBenchmark.java | 7 +-
.../ignite/internal/benchmark/InsertBenchmark.java | 9 +-
.../internal/benchmark/LargeBinaryBenchmark.java | 8 +-
.../internal/benchmark/LargeStringBenchmark.java | 8 +-
.../ignite/internal/benchmark/SqlBenchmark.java | 12 +-
.../internal/benchmark/SqlIndexScanBenchmark.java | 6 +-
.../internal/benchmark/SqlJoinBenchmark.java | 12 +-
.../benchmark/SqlPartitionPruningBenchmark.java | 12 +-
.../internal/benchmark/SqlSelectAllBenchmark.java | 2 +-
.../internal/benchmark/SystemViewsBenchmark.java | 4 +-
.../ignite/internal/benchmark/TpcdsBenchmark.java | 2 +-
.../ignite/internal/benchmark/TpchBenchmark.java | 2 +-
.../internal/benchmark/UpgradeRowBenchmark.java | 6 +-
.../client/ItClientObservableTimeTest.java | 4 +-
.../management/ItDuplicateNodeNamesTest.java | 4 +-
.../inmemory/ItRaftStorageVolatilityTest.java | 3 +-
.../ignite/internal/runner/app/ItAddNodeTest.java | 2 +-
.../internal/runner/app/ItDataSchemaSyncTest.java | 4 +-
.../app/ItIgniteInMemoryNodeRestartTest.java | 7 +-
.../runner/app/ItIgniteNodeRestartTest.java | 36 +-
.../internal/runner/app/ItIndexNodeTest.java | 10 +-
.../internal/runner/app/ItNoThreadsLeftTest.java | 2 +-
.../runner/app/ItReplicaStateManagerTest.java | 12 +-
.../internal/runner/app/ItSingleNodeTest.java | 2 +-
.../internal/runner/app/ItTablesApiTest.java | 2 +-
.../runner/app/PlatformTestNodeRunner.java | 4 +-
.../app/client/ItAbstractThinClientTest.java | 4 +-
.../client/ItCustomKeyColumnOrderClientTest.java | 4 +-
.../runner/app/client/ItNullsThinClientTest.java | 8 +-
.../app/client/ItThinClientAuthenticationTest.java | 10 +-
.../client/ItThinClientChannelValidatorTest.java | 2 +-
.../runner/app/client/ItThinClientComputeTest.java | 2 +-
.../app/client/ItThinClientConnectionTest.java | 10 +-
.../client/ItThinClientDdlQueriesTrackerTest.java | 2 +-
.../app/client/ItThinClientMarshallingTest.java | 19 +-
.../ItThinClientSchemaSynchronizationTest.java | 30 +-
.../runner/app/client/ItThinClientSqlTest.java | 108 ++-
.../app/client/ItThinClientTablesGetListTest.java | 2 +-
.../app/client/ItThinClientTransactionsTest.java | 2 +-
.../app/client/ItThinConnectionFailoverTest.java | 8 +-
.../schemasync/ItSchemaSyncAndReplicationTest.java | 2 +-
.../streamer/ItAbstractDataStreamerTest.java | 6 +-
.../ignite/internal/table/ItInternalTableTest.java | 9 +-
.../table/ItRebalanceWithPartitionReturnTest.java | 17 +-
.../internal/restart/RestartProofKeyValueView.java | 16 +-
.../internal/restart/RestartProofRecordView.java | 8 +-
.../java/org/apache/ignite/internal/Cluster.java | 2 +-
.../ExampleApplicationWithCustomAuthenticator.java | 4 +-
.../apache/ignite/example/ExampleApplication.java | 4 +-
.../org/apache/ignite/ExampleApplicationTest.java | 2 +-
.../org/apache/ignite/data/SpringDataJdbcTest.java | 8 +-
.../ignite/internal/sql/api/ItCommonApiTest.java | 4 +-
.../ignite/internal/sql/api/ItSqlApiBaseTest.java | 10 +-
.../internal/sql/api/ItSqlAsynchronousApiTest.java | 8 +-
.../internal/sql/api/ItSqlClientMetricsTest.java | 13 +-
.../sql/api/ItSqlClientSynchronousApiTest.java | 3 +-
.../internal/sql/api/ItSqlSynchronousApiTest.java | 8 +-
.../internal/sql/engine/ItLimitOffsetTest.java | 28 +-
.../ignite/internal/sql/engine/ItMetadataTest.java | 2 +-
.../sql/engine/ItNotNullConstraintTest.java | 3 +-
.../internal/sql/engine/ItPublicSchemaTest.java | 3 +-
.../ItSqlConcurrentSchemaModificationTest.java | 4 +-
.../internal/sql/engine/ItSqlOperatorsTest.java | 4 +-
.../sql/engine/ItSqlQueryEventLogTest.java | 2 +-
.../sql/engine/ItSqlQueryExecutionMetricsTest.java | 5 +-
.../sql/engine/kill/ItSqlKillCommandTest.java | 4 +-
.../internal/sql/sqllogic/ScriptContext.java | 3 +-
.../sql/threading/ItSqlApiThreadingTest.java | 7 +-
.../ignite/internal/sql/api/IgniteSqlImplTest.java | 8 +-
.../table/AsyncApiKeyValueViewAdapter.java | 12 +-
.../internal/table/AsyncApiRecordViewAdapter.java | 6 +-
.../threading/ItKvRecordApiThreadingTest.java | 4 +-
.../internal/table/KeyValueBinaryViewImpl.java | 12 +-
.../ignite/internal/table/KeyValueViewImpl.java | 12 +-
.../table/PublicApiThreadingKeyValueView.java | 16 +-
.../table/PublicApiThreadingRecordView.java | 8 +-
.../internal/table/RecordBinaryViewImpl.java | 6 +-
.../ignite/internal/table/RecordViewImpl.java | 6 +-
.../disaster/ItDisasterRecoveryManagerTest.java | 4 +-
.../ignite/internal/tx/ItMultipleLocksTest.java | 6 +-
126 files changed, 2242 insertions(+), 475 deletions(-)
diff --git a/examples/java/src/main/java/org/apache/ignite/example/client/IgniteClientExample.java b/examples/java/src/main/java/org/apache/ignite/example/client/IgniteClientExample.java
index 4d87e82fa9b..519ab2523a0 100644
--- a/examples/java/src/main/java/org/apache/ignite/example/client/IgniteClientExample.java
+++ b/examples/java/src/main/java/org/apache/ignite/example/client/IgniteClientExample.java
@@ -41,7 +41,7 @@ public class IgniteClientExample {
// You can use the client here.
//
//--------------------------------------------------------------------------------------
- client.sql().execute(null, "CREATE TABLE IF NOT EXISTS Person (id int primary key, name varchar, age int);");
+ client.sql().execute("CREATE TABLE IF NOT EXISTS Person (id int primary key, name varchar, age int);");
}
}
}
diff --git a/examples/java/src/main/java/org/apache/ignite/example/client/IgniteClientWithConfigExample.java b/examples/java/src/main/java/org/apache/ignite/example/client/IgniteClientWithConfigExample.java
index b261c22cd3b..ffa8a560c8b 100644
--- a/examples/java/src/main/java/org/apache/ignite/example/client/IgniteClientWithConfigExample.java
+++ b/examples/java/src/main/java/org/apache/ignite/example/client/IgniteClientWithConfigExample.java
@@ -70,7 +70,7 @@ public class IgniteClientWithConfigExample {
// You can use the client here.
//
//--------------------------------------------------------------------------------------
- client.sql().execute(null, "CREATE TABLE IF NOT EXISTS Person (id int primary key, name varchar, age int);");
+ client.sql().execute("CREATE TABLE IF NOT EXISTS Person (id int primary key, name varchar, age int);");
}
}
}
diff --git a/examples/java/src/main/java/org/apache/ignite/example/sql/SqlApiExample.java b/examples/java/src/main/java/org/apache/ignite/example/sql/SqlApiExample.java
index ae45faae6f2..60bc65c0e52 100644
--- a/examples/java/src/main/java/org/apache/ignite/example/sql/SqlApiExample.java
+++ b/examples/java/src/main/java/org/apache/ignite/example/sql/SqlApiExample.java
@@ -152,7 +152,7 @@ public class SqlApiExample {
System.out.println("\nAll accounts:");
- try (ResultSet<SqlRow> rs = client.sql().execute(null,
+ try (ResultSet<SqlRow> rs = client.sql().execute(
"SELECT a.FIRST_NAME, a.LAST_NAME, c.NAME FROM ACCOUNTS a "
+ "INNER JOIN CITIES c on c.ID = a.CITY_ID ORDER BY a.ACCOUNT_ID")) {
while (rs.hasNext()) {
@@ -180,7 +180,7 @@ public class SqlApiExample {
.build();
// POJO mapping.
- try (ResultSet<AccountInfo> rs = client.sql().execute(null, Mapper.of(AccountInfo.class), statement)) {
+ try (ResultSet<AccountInfo> rs = client.sql().execute((Transaction) null, Mapper.of(AccountInfo.class), statement)) {
while (rs.hasNext()) {
AccountInfo row = rs.next();
@@ -201,7 +201,7 @@ public class SqlApiExample {
CancellationToken cancelToken = cancelHandle.token();
client.sql().executeAsync(
- null, cancelToken,
+ (Transaction) null, cancelToken,
"SELECT a.FIRST_NAME, b.LAST_NAME " +
"FROM ACCOUNTS a, ACCOUNTS b, ACCOUNTS c ORDER BY a.ACCOUNT_ID"
);
@@ -219,7 +219,7 @@ public class SqlApiExample {
System.out.println("\nDeleting one of the accounts...");
- try (ResultSet<SqlRow> rs = client.sql().execute(null, "DELETE FROM ACCOUNTS WHERE ACCOUNT_ID = ?", 1)) {
+ try (ResultSet<SqlRow> rs = client.sql().execute( "DELETE FROM ACCOUNTS WHERE ACCOUNT_ID = ?", 1)) {
System.out.println("\n Removed accounts: " + rs.affectedRows());
}
@@ -239,7 +239,7 @@ public class SqlApiExample {
.pageSize(1)
.build();
- client.sql().executeAsync(null, stmt)
+ client.sql().executeAsync((Transaction) null, stmt)
.thenCompose(SqlApiExample::fetchAllRowsInto)
.get();
diff --git a/examples/java/src/main/java/org/apache/ignite/example/streaming/DetectFailedEntriesExample.java b/examples/java/src/main/java/org/apache/ignite/example/streaming/DetectFailedEntriesExample.java
index 0f348eea0de..f340e9704c9 100644
--- a/examples/java/src/main/java/org/apache/ignite/example/streaming/DetectFailedEntriesExample.java
+++ b/examples/java/src/main/java/org/apache/ignite/example/streaming/DetectFailedEntriesExample.java
@@ -49,7 +49,7 @@ public class DetectFailedEntriesExample {
.retryLimit(16)
.build();
System.out.println("Creating Accounts table");
- client.sql().execute(null, "CREATE TABLE IF NOT EXISTS ACCOUNTS (id INT PRIMARY KEY, name VARCHAR(255), balance BIGINT, active BOOLEAN);");
+ client.sql().execute("CREATE TABLE IF NOT EXISTS ACCOUNTS (id INT PRIMARY KEY, name VARCHAR(255), balance BIGINT, active BOOLEAN);");
RecordView<Account> view = client.tables()
.table("Accounts")
@@ -95,7 +95,7 @@ public class DetectFailedEntriesExample {
streamerFut.join();
System.out.println("Dropping Accounts table.");
- client.sql().execute(null, "DROP TABLE IF EXISTS ACCOUNTS;");
+ client.sql().execute("DROP TABLE IF EXISTS ACCOUNTS;");
}
}
}
\ No newline at end of file
diff --git a/examples/java/src/main/java/org/apache/ignite/example/streaming/SingleTableDataStreamerExample.java b/examples/java/src/main/java/org/apache/ignite/example/streaming/SingleTableDataStreamerExample.java
index 686c2de31e8..ec21305435f 100644
--- a/examples/java/src/main/java/org/apache/ignite/example/streaming/SingleTableDataStreamerExample.java
+++ b/examples/java/src/main/java/org/apache/ignite/example/streaming/SingleTableDataStreamerExample.java
@@ -43,7 +43,8 @@ public class SingleTableDataStreamerExample {
.addresses("127.0.0.1:10800")
.build()) {
System.out.println("Creating Accounts table");
- client.sql().execute(null, "CREATE TABLE IF NOT EXISTS ACCOUNTS (id INT PRIMARY KEY, name VARCHAR(255), balance BIGINT, active BOOLEAN);");
+ client.sql().execute(
+ "CREATE TABLE IF NOT EXISTS ACCOUNTS (id INT PRIMARY KEY, name VARCHAR(255), balance BIGINT, active BOOLEAN);");
RecordView<Account> view = client.tables().table("Accounts").recordView(Account.class);
@@ -60,7 +61,7 @@ public class SingleTableDataStreamerExample {
verifyRemove(view);
System.out.println("Dropping Accounts table.");
- client.sql().execute(null, "DROP TABLE IF EXISTS ACCOUNTS;");
+ client.sql().execute("DROP TABLE IF EXISTS ACCOUNTS;");
}
}
diff --git a/examples/java/src/main/java/org/apache/ignite/example/table/QueryExample.java b/examples/java/src/main/java/org/apache/ignite/example/table/QueryExample.java
index 5f12b0dd03c..8b0ba488c92 100644
--- a/examples/java/src/main/java/org/apache/ignite/example/table/QueryExample.java
+++ b/examples/java/src/main/java/org/apache/ignite/example/table/QueryExample.java
@@ -39,9 +39,9 @@ public class QueryExample {
.addresses("127.0.0.1:10800")
.build()) {
System.out.println("Creating Person table");
- client.sql().execute(null, "CREATE TABLE IF NOT EXISTS Person (id int primary key, city varchar, name varchar, age int, company varchar, city_id int);");
- client.sql().execute(null, "INSERT INTO Person (id, city, name, age, company, city_id) VALUES (1, 'London', 'John Doe', 42, 'Apache', 101);");
- client.sql().execute(null, "INSERT INTO Person (id, city, name, age, company, city_id) VALUES (2, 'New York', 'Jane Doe', 36, 'Apache', 102);");
+ client.sql().execute("CREATE TABLE IF NOT EXISTS Person (id int primary key, city varchar, name varchar, age int, company varchar, city_id int);");
+ client.sql().execute("INSERT INTO Person (id, city, name, age, company, city_id) VALUES (1, 'London', 'John Doe', 42, 'Apache', 101);");
+ client.sql().execute("INSERT INTO Person (id, city, name, age, company, city_id) VALUES (2, 'New York', 'Jane Doe', 36, 'Apache', 102);");
// Get a table
IgniteTables tablesApi = client.tables();
@@ -57,7 +57,7 @@ public class QueryExample {
performQueryAsync(myTable);
System.out.println("Dropping Person table.");
- client.sql().execute(null, "DROP TABLE IF EXISTS PERSON;");
+ client.sql().execute("DROP TABLE IF EXISTS PERSON;");
}
}
diff --git a/examples/java/src/main/java/org/apache/ignite/example/table/TableExample.java b/examples/java/src/main/java/org/apache/ignite/example/table/TableExample.java
index a908362a889..6fe326eedd3 100644
--- a/examples/java/src/main/java/org/apache/ignite/example/table/TableExample.java
+++ b/examples/java/src/main/java/org/apache/ignite/example/table/TableExample.java
@@ -44,7 +44,7 @@ public class TableExample {
.build()
) {
// Create a table to work with later
- client.sql().execute(null, "CREATE TABLE IF NOT EXISTS Person (" +
+ client.sql().execute("CREATE TABLE IF NOT EXISTS Person (" +
"id int primary key," +
"city_id int," +
"name varchar," +
diff --git a/migration-tools/modules/migration-tools-persistence/src/main/java/org/apache/ignite/migrationtools/persistence/Ignite2PersistentCacheTools.java b/migration-tools/modules/migration-tools-persistence/src/main/java/org/apache/ignite/migrationtools/persistence/Ignite2PersistentCacheTools.java
index 36534ead723..075cf4119bb 100644
--- a/migration-tools/modules/migration-tools-persistence/src/main/java/org/apache/ignite/migrationtools/persistence/Ignite2PersistentCacheTools.java
+++ b/migration-tools/modules/migration-tools-persistence/src/main/java/org/apache/ignite/migrationtools/persistence/Ignite2PersistentCacheTools.java
@@ -195,7 +195,7 @@ public class Ignite2PersistentCacheTools {
if (table == null) {
TableDefinition tblDef = tableDefinition.tableDefinition();
if (!"PUBLIC".equals(tblDef.schemaName())) {
- client.sql().executeAsync(null, "CREATE SCHEMA IF NOT EXISTS " + tblDef.schemaName() + ";").join();
+ client.sql().executeAsync("CREATE SCHEMA IF NOT EXISTS " + tblDef.schemaName() + ";").join();
}
table = (ClientTable) client.catalog()
diff --git a/modules/api/build.gradle b/modules/api/build.gradle
index 677771fff9f..f7e07b8df29 100644
--- a/modules/api/build.gradle
+++ b/modules/api/build.gradle
@@ -29,6 +29,8 @@ dependencies {
testImplementation libs.archunit.core
testImplementation libs.archunit.junit5
+
+ testImplementation testFixtures(project(':ignite-core'))
}
def platformsHeadersDir = file("${buildDir}/platforms/")
diff --git a/modules/api/src/main/java/org/apache/ignite/sql/IgniteSql.java b/modules/api/src/main/java/org/apache/ignite/sql/IgniteSql.java
index 631a5a449e9..c7edcbb0cef 100644
--- a/modules/api/src/main/java/org/apache/ignite/sql/IgniteSql.java
+++ b/modules/api/src/main/java/org/apache/ignite/sql/IgniteSql.java
@@ -57,6 +57,18 @@ public interface IgniteSql {
return execute(transaction, (CancellationToken) null, query, arguments);
}
+ /**
+ * Executes a single SQL query.
+ *
+ * @param query SQL query template.
+ * @param arguments Arguments for the template (optional).
+ * @return SQL query result set.
+ * @throws SqlException If failed.
+ */
+ default ResultSet<SqlRow> execute(String query, @Nullable Object... arguments) {
+ return execute((Transaction) null, (CancellationToken) null, query, arguments);
+ }
+
/**
* Executes a single SQL query.
*
@@ -199,6 +211,18 @@ public interface IgniteSql {
return executeAsync(transaction, (CancellationToken) null, query, arguments);
}
+ /**
+ * Executes SQL query in an asynchronous way.
+ *
+ * @param query SQL query template.
+ * @param arguments Arguments for the template (optional).
+ * @return Operation future.
+ * @throws SqlException If failed.
+ */
+ default CompletableFuture<AsyncResultSet<SqlRow>> executeAsync(String query, @Nullable Object... arguments) {
+ return executeAsync((Transaction) null, (CancellationToken) null, query, arguments);
+ }
+
/**
* Executes SQL query in an asynchronous way.
*
@@ -339,6 +363,18 @@ public interface IgniteSql {
return executeBatch(transaction, null, dmlQuery, batch);
}
+ /**
+ * Executes a batched SQL query. Only DML queries are supported.
+ *
+ * @param dmlQuery DML query template.
+ * @param batch Batch of query arguments.
+ * @return Number of rows affected by each query in the batch.
+ * @throws SqlBatchException If the batch fails.
+ */
+ default long[] executeBatch(String dmlQuery, BatchedArguments batch) {
+ return executeBatch(null, null, dmlQuery, batch);
+ }
+
/**
* Executes a batched SQL query. Only DML queries are supported.
*
@@ -399,6 +435,18 @@ public interface IgniteSql {
return executeBatchAsync(transaction, null, query, batch);
}
+ /**
+ * Executes a batched SQL query asynchronously.
+ *
+ * @param query SQL query template.
+ * @param batch List of batch rows, where each row is a list of statement arguments.
+ * @return Operation Future completed with the number of rows affected by each query in the batch
+ * (if the batch succeeds), future completed with the {@link SqlBatchException} (if the batch fails).
+ */
+ default CompletableFuture<long[]> executeBatchAsync(String query, BatchedArguments batch) {
+ return executeBatchAsync(null, null, query, batch);
+ }
+
/**
* Executes a batched SQL query asynchronously.
*
diff --git a/modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java b/modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
index 466eb8699c9..7b624c3168b 100644
--- a/modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
+++ b/modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
@@ -52,6 +52,22 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
@Nullable V get(@Nullable Transaction tx, K key);
+ /**
+ * Gets a value associated with a given key.
+ *
+ * <p>Note: If the value mapper implies a value can be {@code null}, a suitable method
+ * {@link #getNullable(Object)} must be used.
+ *
+ * @param key Key whose value is to be returned. The key cannot be {@code null}.
+ * @return Value or {@code null}, if it does not exist.
+ * @throws MarshallerException if the key doesn't match the schema.
+ * @throws UnexpectedNullValueException If value for the key exists, and it is {@code null}.
+ * @see #getNullable(Object)
+ */
+ default @Nullable V get(K key) {
+ return get(null, key);
+ }
+
/**
* Asynchronously gets a value associated with a given key.
*
@@ -67,6 +83,22 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<V> getAsync(@Nullable Transaction tx, K key);
+ /**
+ * Asynchronously gets a value associated with a given key.
+ *
+ * <p>Note: If the value mapper implies a value can be {@code null}, a suitable method
+ * {@link #getNullableAsync(Object)} must be used.
+ *
+ * @param key Key whose value is to be returned. The key cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key doesn't match the schema.
+ * @see #getNullableAsync(Object)
+ * @see #get(Object)
+ */
+ default CompletableFuture<V> getAsync(K key) {
+ return getAsync(null, key);
+ }
+
/**
* Gets a nullable value associated with a given key.
*
@@ -74,13 +106,28 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
* {@code getNullable(tx, key)} returns {@code null} after {@code remove(tx, key)}.
* {@code getNullable(tx, key)} returns {@code Nullable.of(null)} after {@code put(tx, key, null)}.
*
- * @param tx Transaction or {@code null} to auto commit.
+ * @param tx Transaction or {@code null} for implicit transaction.
* @param key Key whose value is to be returned. The key cannot be {@code null}.
* @return Wrapped nullable value or {@code null} if it does not exist.
* @throws MarshallerException if the key doesn't match the schema.
*/
NullableValue<V> getNullable(@Nullable Transaction tx, K key);
+ /**
+ * Gets a nullable value associated with a given key.
+ *
+ * <p>Examples:
+ * {@code getNullable(key)} returns {@code null} after {@code remove(key)}.
+ * {@code getNullable(key)} returns {@code Nullable.of(null)} after {@code put(key, null)}.
+ *
+ * @param key Key whose value is to be returned. The key cannot be {@code null}.
+ * @return Wrapped nullable value or {@code null} if it does not exist.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default NullableValue<V> getNullable(K key) {
+ return getNullable(null, key);
+ }
+
/**
* Gets a nullable value associated with a given key.
*
@@ -93,6 +140,19 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<NullableValue<V>> getNullableAsync(@Nullable Transaction tx, K key);
+ /**
+ * Gets a nullable value associated with a given key.
+ *
+ * @param key Key whose value is to be returned. The key cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * The future returns wrapped nullable value or {@code null} if the row with the given key does not exist.
+ * @throws MarshallerException if the key doesn't match the schema.
+ * @see #getNullable(Object)
+ */
+ default CompletableFuture<NullableValue<V>> getNullableAsync(K key) {
+ return getNullableAsync(null, key);
+ }
+
/**
* Gets a value associated with a given key, if it exists and is not null, otherwise returns {@code defaultValue}.
*
@@ -104,6 +164,18 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
@Nullable V getOrDefault(@Nullable Transaction tx, K key, @Nullable V defaultValue);
+ /**
+ * Gets a value associated with a given key, if it exists and is not null, otherwise returns {@code defaultValue}.
+ *
+ * @param key Key whose value is to be returned. The key cannot be {@code null}.
+ * @param defaultValue Default value.
+ * @return Value or {@code defaultValue} if does not exist.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default @Nullable V getOrDefault(K key, @Nullable V defaultValue) {
+ return getOrDefault(null, key, defaultValue);
+ }
+
/**
* Gets a value associated with a given key, if it exists and is not null, otherwise returns {@code defaultValue}.
*
@@ -116,10 +188,23 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<V> getOrDefaultAsync(@Nullable Transaction tx, K key, @Nullable V defaultValue);
+ /**
+ * Gets a value associated with a given key, if it exists and is not null, otherwise returns {@code defaultValue}.
+ *
+ * @param key Key whose value is to be returned. The key cannot be {@code null}.
+ * @param defaultValue Default value.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key doesn't match the schema.
+ * @see #getOrDefault(Object, Object)
+ */
+ default CompletableFuture<V> getOrDefaultAsync(K key, @Nullable V defaultValue) {
+ return getOrDefaultAsync(null, key, defaultValue);
+ }
+
/**
* Get values associated with given keys.
*
- * @param tx Transaction or {@code null} to auto commit.
+ * @param tx Transaction or {@code null} for implicit transaction.
* @param keys Keys whose values are to be returned. The keys cannot be {@code null}.
* @return Values associated with given keys.
* If a requested key does not exist, it will have no corresponding entry in the returned map.
@@ -130,13 +215,36 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
/**
* Get values associated with given keys.
*
- * @param tx Transaction or {@code null} to auto commit.
+ * @param keys Keys whose values are to be returned. The keys cannot be {@code null}.
+ * @return Values associated with given keys.
+ * If a requested key does not exist, it will have no corresponding entry in the returned map.
+ * @throws MarshallerException if the keys don't match the schema.
+ */
+ default Map<K, V> getAll(Collection<K> keys) {
+ return getAll(null, keys);
+ }
+
+ /**
+ * Get values associated with given keys.
+ *
+ * @param tx Transaction or {@code null} for implicit transaction.
* @param keys Keys whose values are to be returned. The keys cannot be {@code null}.
* @return Future that represents the pending completion of the operation.
* @throws MarshallerException if the key doesn't match the schema.
*/
CompletableFuture<Map<K, V>> getAllAsync(@Nullable Transaction tx, Collection<K> keys);
+ /**
+ * Get values associated with given keys.
+ *
+ * @param keys Keys whose values are to be returned. The keys cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default CompletableFuture<Map<K, V>> getAllAsync(Collection<K> keys) {
+ return getAllAsync(null, keys);
+ }
+
/**
* Determines whether a table contains an entry for the specified key.
*
@@ -147,6 +255,17 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
boolean contains(@Nullable Transaction tx, K key);
+ /**
+ * Determines whether a table contains an entry for the specified key.
+ *
+ * @param key Key whose presence is to be verified. The key cannot be {@code null}.
+ * @return {@code True} if a value exists for every specified key, {@code false} otherwise.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default boolean contains(K key) {
+ return contains(null, key);
+ }
+
/**
* Determines whether a table contains an entry for the specified key.
*
@@ -157,6 +276,17 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<Boolean> containsAsync(@Nullable Transaction tx, K key);
+ /**
+ * Determines whether a table contains an entry for the specified key.
+ *
+ * @param key Key whose presence is to be verified. The key cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> containsAsync(K key) {
+ return containsAsync(null, key);
+ }
+
/**
* Determines whether a table contains entries for all given keys.
*
@@ -167,6 +297,17 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
boolean containsAll(@Nullable Transaction tx, Collection<K> keys);
+ /**
+ * Determines whether a table contains entries for all given keys.
+ *
+ * @param keys Keys whose presence is to be verified. The collection and it's values cannot be {@code null}.
+ * @return {@code True} if a value exists for every specified key, {@code false} otherwise.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default boolean containsAll(Collection<K> keys) {
+ return containsAll(null, keys);
+ }
+
/**
* Determines whether a table contains entries for all given keys.
*
@@ -178,6 +319,18 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<Boolean> containsAllAsync(@Nullable Transaction tx, Collection<K> keys);
+ /**
+ * Determines whether a table contains entries for all given keys.
+ *
+ * @param keys Keys whose presence is to be verified. The collection and it's values cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation. The result of the future will be {@code true} if a value
+ * exists for every specified key, {@code false} otherwise.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> containsAllAsync(Collection<K> keys) {
+ return containsAllAsync(null, keys);
+ }
+
/**
* Puts into a table a value associated with the given key.
*
@@ -188,6 +341,17 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
void put(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Puts into a table a value associated with the given key.
+ *
+ * @param key Key with which the specified value is to be associated. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be null when mapped to a single column with a simple type.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default void put(K key, @Nullable V val) {
+ put(null, key, val);
+ }
+
/**
* Asynchronously puts into a table a value associated with the given key.
*
@@ -199,6 +363,18 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<Void> putAsync(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Asynchronously puts into a table a value associated with the given key.
+ *
+ * @param key Key with which the specified value is to be associated. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be null when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default CompletableFuture<Void> putAsync(K key, @Nullable V val) {
+ return putAsync(null, key, val);
+ }
+
/**
* Puts associated key-value pairs.
*
@@ -208,6 +384,16 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
void putAll(@Nullable Transaction tx, Map<K, V> pairs);
+ /**
+ * Puts associated key-value pairs.
+ *
+ * @param pairs Key-value pairs. The pairs cannot be {@code null}.
+ * @throws MarshallerException if one of key, or values doesn't match the schema.
+ */
+ default void putAll(Map<K, V> pairs) {
+ putAll(null, pairs);
+ }
+
/**
* Asynchronously puts associated key-value pairs.
*
@@ -218,6 +404,17 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<Void> putAllAsync(@Nullable Transaction tx, Map<K, V> pairs);
+ /**
+ * Asynchronously puts associated key-value pairs.
+ *
+ * @param pairs Key-value pairs. The pairs cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if one of key, or values doesn't match the schema.
+ */
+ default CompletableFuture<Void> putAllAsync(Map<K, V> pairs) {
+ return putAllAsync(null, pairs);
+ }
+
/**
* Puts into a table a new, or replaces an existing, value associated with the given key.
*
@@ -232,6 +429,21 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
@Nullable V getAndPut(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Puts into a table a new, or replaces an existing, value associated with the given key.
+ *
+ * <p>NB: The method doesn't support {@code null} column value, use {@link #getNullableAndPut(Object, Object)} instead.
+ *
+ * @param key Key with which the specified value is to be associated. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Replaced value or {@code null} if it did not exist.
+ * @throws MarshallerException if one of the keys or values doesn't match the schema.
+ * @throws UnexpectedNullValueException If value for the key exists, and it is {@code null}.
+ */
+ default @Nullable V getAndPut(K key, @Nullable V val) {
+ return getAndPut(null, key, val);
+ }
+
/**
* Asynchronously puts into a table a new, or replaces an existing, value associated with given key.
*
@@ -246,6 +458,21 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<V> getAndPutAsync(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Asynchronously puts into a table a new, or replaces an existing, value associated with given key.
+ *
+ * <p>NB: The method doesn't support {@code null} column value, use {@link #getNullableAndPutAsync(Object, Object)}
+ * instead.
+ *
+ * @param key Key with which the specified value is to be associated. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default CompletableFuture<V> getAndPutAsync(K key, @Nullable V val) {
+ return getAndPutAsync(null, key, val);
+ }
+
/**
* Puts into a table a new, or replaces an existing, value associated with given key.
*
@@ -257,6 +484,18 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
NullableValue<V> getNullableAndPut(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Puts into a table a new, or replaces an existing, value associated with given key.
+ *
+ * @param key Key with which the specified value is to be associated. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Wrapped nullable value that was replaced or {@code null} if it did no exist.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default NullableValue<V> getNullableAndPut(K key, @Nullable V val) {
+ return getNullableAndPut(null, key, val);
+ }
+
/**
* Asynchronously puts into a table a new, or replaces an existing, value associated with given key.
*
@@ -268,6 +507,18 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<NullableValue<V>> getNullableAndPutAsync(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Asynchronously puts into a table a new, or replaces an existing, value associated with given key.
+ *
+ * @param key Key with which the specified value is to be associated. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default CompletableFuture<NullableValue<V>> getNullableAndPutAsync(K key, @Nullable V val) {
+ return getNullableAndPutAsync(null, key, val);
+ }
+
/**
* Puts into a table a value associated with the given key if this value does not exists.
*
@@ -279,6 +530,18 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
boolean putIfAbsent(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Puts into a table a value associated with the given key if this value does not exists.
+ *
+ * @param key Key with which the specified value is to be associated. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return {@code True} if successful, {@code false} otherwise.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default boolean putIfAbsent(K key, @Nullable V val) {
+ return putIfAbsent(null, key, val);
+ }
+
/**
* Asynchronously puts into a table a value associated with the given key if this value does not exist.
*
@@ -290,6 +553,18 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<Boolean> putIfAbsentAsync(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Asynchronously puts into a table a value associated with the given key if this value does not exist.
+ *
+ * @param key Key with which the specified value is to be associated. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> putIfAbsentAsync(K key, @Nullable V val) {
+ return putIfAbsentAsync(null, key, val);
+ }
+
/**
* Removes from a table a value associated with the given key.
*
@@ -300,8 +575,20 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
boolean remove(@Nullable Transaction tx, K key);
+ /**
+ * Removes from a table a value associated with the given key.
+ *
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @return {@code True} if a value associated with the specified key was successfully removed, {@code false} otherwise.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default boolean remove(K key) {
+ return remove(null, key);
+ }
+
/**
* Removes from a table an expected value associated with the given key.
+ * Deprecated: use {@link #removeExact(Transaction, Object, Object)} instead.
*
* @param tx Transaction or {@code null} for implicit transaction.
* @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
@@ -309,7 +596,32 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
* @return {@code True} if the expected value for the specified key was successfully removed, {@code false} otherwise.
* @throws MarshallerException if the key and/or the value doesn't match the schema.
*/
- boolean remove(@Nullable Transaction tx, K key, V val);
+ @Deprecated(forRemoval = true)
+ default boolean remove(@Nullable Transaction tx, K key, V val) {
+ return removeExact(tx, key, val);
+ }
+
+ /**
+ * Removes from a table an expected value associated with the given key.
+ *
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @param val Expected value.
+ * @return {@code True} if the expected value for the specified key was successfully removed, {@code false} otherwise.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ boolean removeExact(@Nullable Transaction tx, K key, V val);
+
+ /**
+ * Removes from a table an expected value associated with the given key.
+ *
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @param val Expected value.
+ * @return {@code True} if the expected value for the specified key was successfully removed, {@code false} otherwise.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default boolean removeExact(K key, V val) {
+ return removeExact(null, key, val);
+ }
/**
* Asynchronously removes from a table a value associated with the given key.
@@ -321,6 +633,32 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key);
+ /**
+ * Asynchronously removes from a table a value associated with the given key.
+ *
+ * @param key A key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> removeAsync(K key) {
+ return removeAsync(null, key);
+ }
+
+ /**
+ * Asynchronously removes from a table an expected value associated with the given key.
+ * Deprecated: use {@link #removeExactAsync(Transaction, Object, Object)} instead.
+ *
+ * @param tx Transaction or {@code null} for implicit transaction.
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @param val Expected value.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ @Deprecated(forRemoval = true)
+ default CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, V val) {
+ return removeExactAsync(tx, key, val);
+ }
+
/**
* Asynchronously removes from a table an expected value associated with the given key.
*
@@ -330,7 +668,19 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
* @return Future that represents the pending completion of the operation.
* @throws MarshallerException if the key and/or the value doesn't match the schema.
*/
- CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, V val);
+ CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, K key, V val);
+
+ /**
+ * Asynchronously removes from a table an expected value associated with the given key.
+ *
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @param val Expected value.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> removeExactAsync(K key, V val) {
+ return removeExactAsync(null, key, val);
+ }
/**
* Removes all entries from a table.
@@ -339,6 +689,13 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
void removeAll(@Nullable Transaction tx);
+ /**
+ * Removes all entries from a table.
+ */
+ default void removeAll() {
+ removeAll(null);
+ }
+
/**
* Removes from a table values associated with the given keys.
*
@@ -366,6 +723,13 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<Void> removeAllAsync(@Nullable Transaction tx);
+ /**
+ * Asynchronously remove all entries from a table.
+ */
+ default CompletableFuture<Void> removeAllAsync() {
+ return removeAllAsync(null);
+ }
+
/**
* Gets and removes from a table a value associated with the given key.
*
@@ -379,6 +743,20 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
@Nullable V getAndRemove(@Nullable Transaction tx, K key);
+ /**
+ * Gets and removes from a table a value associated with the given key.
+ *
+ * <p>NB: Method doesn't support {@code null} column value, use {@link #getNullableAndRemove(Object)} instead.
+ *
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @return Removed value or {@code null} if the value did not exist.
+ * @throws UnexpectedNullValueException If the key value is {@code null}.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default @Nullable V getAndRemove(K key) {
+ return getAndRemove(null, key);
+ }
+
/**
* Asynchronously gets and removes from a table a value associated with the given key.
*
@@ -391,6 +769,19 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<V> getAndRemoveAsync(@Nullable Transaction tx, K key);
+ /**
+ * Asynchronously gets and removes from a table a value associated with the given key.
+ *
+ * <p>NB: Method doesn't support {@code null} column value, use {@link #getNullableAndRemoveAsync(Object)} instead.
+ *
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default CompletableFuture<V> getAndRemoveAsync(K key) {
+ return getAndRemoveAsync(null, key);
+ }
+
/**
* Gets and removes from a table a value associated with the given key.
*
@@ -401,6 +792,17 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
NullableValue<V> getNullableAndRemove(@Nullable Transaction tx, K key);
+ /**
+ * Gets and removes from a table a value associated with the given key.
+ *
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @return Wrapped nullable value that was removed or {@code null} if it did not exist.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default NullableValue<V> getNullableAndRemove(K key) {
+ return getNullableAndRemove(null, key);
+ }
+
/**
* Asynchronously gets and removes from a table a value associated with the given key.
*
@@ -411,6 +813,17 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<NullableValue<V>> getNullableAndRemoveAsync(@Nullable Transaction tx, K key);
+ /**
+ * Asynchronously gets and removes from a table a value associated with the given key.
+ *
+ * @param key Key whose value is to be removed from the table. The key cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default CompletableFuture<NullableValue<V>> getNullableAndRemoveAsync(K key) {
+ return getNullableAndRemoveAsync(null, key);
+ }
+
/**
* Replaces a value for a key if it exists. This is equivalent to
* <pre><code>
@@ -430,8 +843,29 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
boolean replace(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Replaces a value for a key if it exists. This is equivalent to
+ * <pre>{@code
+ * if (cache.containsKey(tx, key)) {
+ * cache.put(tx, key, value);
+ * return true;
+ * } else {
+ * return false;
+ * }}</pre>
+ * except the action is performed atomically.
+ *
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return {@code True} if an old value was replaced, {@code false} otherwise.
+ * @throws MarshallerException if the key and/or the value doesn't match the schema.
+ */
+ default boolean replace(K key, @Nullable V val) {
+ return replace(null, key, val);
+ }
+
/**
* Replaces an expected value for a key. This is equivalent to
+ * Deprecated: use {@link #replaceExact(Transaction, Object, Object, Object)} instead.
* <pre><code>
* if (cache.get(tx, key) == oldValue) {
* cache.put(tx, key, newValue);
@@ -449,7 +883,53 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
* @return {@code True} if an old value was replaced, {@code false} otherwise.
* @throws MarshallerException if the key, the oldValue, or the newValue doesn't match the schema.
*/
- boolean replace(@Nullable Transaction tx, K key, @Nullable V oldValue, @Nullable V newValue);
+ @Deprecated(forRemoval = true)
+ default boolean replace(@Nullable Transaction tx, K key, @Nullable V oldValue, @Nullable V newValue) {
+ return replaceExact(tx, key, oldValue, newValue);
+ }
+
+ /**
+ * Replaces an expected value for a key. This is equivalent to
+ * <pre><code>
+ * if (cache.get(tx, key) == oldValue) {
+ * cache.put(tx, key, newValue);
+ * return true;
+ * } else {
+ * return false;
+ * }</code></pre>
+ * except the action is performed atomically.
+ *
+ * @param tx Transaction or {@code null} for implicit transaction.
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param oldValue Expected value associated with the specified key. Can be {@code null} when mapped to a single column
+ * with a simple type.
+ * @param newValue Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return {@code True} if an old value was replaced, {@code false} otherwise.
+ * @throws MarshallerException if the key, the oldValue, or the newValue doesn't match the schema.
+ */
+ boolean replaceExact(@Nullable Transaction tx, K key, @Nullable V oldValue, @Nullable V newValue);
+
+ /**
+ * Replaces an expected value for a key. This is equivalent to
+ * <pre>{@code
+ * if (cache.get(tx, key) == oldValue) {
+ * cache.put(tx, key, newValue);
+ * return true;
+ * } else {
+ * return false;
+ * }}</pre>
+ * except the action is performed atomically.
+ *
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param oldValue Expected value associated with the specified key. Can be {@code null} when mapped to a single column
+ * with a simple type.
+ * @param newValue Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return {@code True} if an old value was replaced, {@code false} otherwise.
+ * @throws MarshallerException if the key, the oldValue, or the newValue doesn't match the schema.
+ */
+ default boolean replaceExact(K key, @Nullable V oldValue, @Nullable V newValue) {
+ return replaceExact(null, key, oldValue, newValue);
+ }
/**
* Asynchronously replaces a value for a key if it exists. See {@link #replace(Transaction, Object, Object)}.
@@ -462,8 +942,37 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Asynchronously replaces a value for a key if it exists. See {@link #replace(Object, Object)}.
+ *
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key or the oldValue doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> replaceAsync(K key, @Nullable V val) {
+ return replaceAsync(null, key, val);
+ }
+
/**
* Asynchronously replaces an expected value for a key. See {@link #replace(Transaction, Object, Object, Object)}
+ * Deprecated: use {@link #replaceExactAsync(Transaction, Object, Object, Object)} instead.
+ *
+ * @param tx Transaction or {@code null} for implicit transaction.
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param oldVal Expected value associated with the specified key. Can be {@code null} when mapped to a single column
+ * with a simple type.
+ * @param newVal Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key, the oldValue, or the newValue doesn't match the schema.
+ */
+ @Deprecated(forRemoval = true)
+ default CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
+ return replaceExactAsync(tx, key, oldVal, newVal);
+ }
+
+ /**
+ * Asynchronously replaces an expected value for a key. See {@link #replaceExact(Transaction, Object, Object, Object)}
*
* @param tx Transaction or {@code null} for implicit transaction.
* @param key Key the specified value is associated with. The key cannot be {@code null}.
@@ -473,7 +982,21 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
* @return Future that represents the pending completion of the operation.
* @throws MarshallerException if the key, the oldValue, or the newValue doesn't match the schema.
*/
- CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal);
+ CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal);
+
+ /**
+ * Asynchronously replaces an expected value for a key. See {@link #replaceExact(Object, Object, Object)}
+ *
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param oldVal Expected value associated with the specified key. Can be {@code null} when mapped to a single column
+ * with a simple type.
+ * @param newVal Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key, the oldValue, or the newValue doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> replaceExactAsync(K key, @Nullable V oldVal, @Nullable V newVal) {
+ return replaceExactAsync(null, key, oldVal, newVal);
+ }
/**
* Replaces a value for a given key if it exists. This is equivalent to
@@ -499,6 +1022,31 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
@Nullable V getAndReplace(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Replaces a value for a given key if it exists. This is equivalent to
+ * <pre>{@code
+ * if (cache.containsKey(tx, key)) {
+ * V oldValue = cache.get(tx, key);
+ * cache.put(tx, key, value);
+ * return oldValue;
+ * } else {
+ * return null;
+ * }
+ * }</pre>
+ * except the action is performed atomically.
+ *
+ * <p>NB: Method doesn't support {@code null} column value, use {@link #getNullableAndReplace(Object, Object)} instead.
+ *
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Replaced value, or {@code null} if it did not exist.
+ * @throws UnexpectedNullValueException If the value for the key is {@code null}.
+ * @throws MarshallerException if the key, or the value doesn't match the schema.
+ */
+ default @Nullable V getAndReplace(K key, @Nullable V val) {
+ return getAndReplace(null, key, val);
+ }
+
/**
* Asynchronously replaces a value for a given key if it exists.
*
@@ -514,6 +1062,22 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
CompletableFuture<V> getAndReplaceAsync(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Asynchronously replaces a value for a given key if it exists.
+ *
+ * <p>NB: Method doesn't support {@code null} column value, use {@link #getNullableAndReplaceAsync(Object, Object)}
+ * instead.
+ *
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key or the value doesn't match the schema.
+ * @see #getAndReplace(Object, Object)
+ */
+ default CompletableFuture<V> getAndReplaceAsync(K key, @Nullable V val) {
+ return getAndReplaceAsync(null, key, val);
+ }
+
/**
* Replaces a value for a given key if it exists.
*
@@ -526,6 +1090,19 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
*/
NullableValue<V> getNullableAndReplace(@Nullable Transaction tx, K key, @Nullable V val);
+ /**
+ * Replaces a value for a given key if it exists.
+ *
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Wrapped nullable value that was replaced or {@code null} if it did not exist.
+ * @throws MarshallerException if the key or the value doesn't match the schema.
+ * @see #getAndReplace(Object, Object)
+ */
+ default NullableValue<V> getNullableAndReplace(K key, @Nullable V val) {
+ return getNullableAndReplace(null, key, val);
+ }
+
/**
* Asynchronously replaces a value for a given key if it exists.
*
@@ -537,4 +1114,17 @@ public interface KeyValueView<K, V> extends DataStreamerTarget<Entry<K, V>>, Cri
* @see #getAndReplace(Transaction, Object, Object)
*/
CompletableFuture<NullableValue<V>> getNullableAndReplaceAsync(@Nullable Transaction tx, K key, @Nullable V val);
+
+ /**
+ * Asynchronously replaces a value for a given key if it exists.
+ *
+ * @param key Key the specified value is associated with. The key cannot be {@code null}.
+ * @param val Value to be associated with the specified key. Can be {@code null} when mapped to a single column with a simple type.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key or the value doesn't match the schema.
+ * @see #getAndReplace(Object, Object)
+ */
+ default CompletableFuture<NullableValue<V>> getNullableAndReplaceAsync(K key, @Nullable V val) {
+ return getNullableAndReplaceAsync(null, key, val);
+ }
}
diff --git a/modules/api/src/main/java/org/apache/ignite/table/RecordView.java b/modules/api/src/main/java/org/apache/ignite/table/RecordView.java
index de62e1b76d7..b2ce267e2e6 100644
--- a/modules/api/src/main/java/org/apache/ignite/table/RecordView.java
+++ b/modules/api/src/main/java/org/apache/ignite/table/RecordView.java
@@ -32,6 +32,7 @@ import org.jetbrains.annotations.Nullable;
* @see org.apache.ignite.table.mapper.Mapper
*/
public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySource<R> {
+
/**
* Gets a record with the same key column values as the given one from a table.
*
@@ -41,6 +42,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
R get(@Nullable Transaction tx, R keyRec);
+ /**
+ * Gets a record with the same key column values as the given one from a table.
+ *
+ * @param keyRec Record with the key columns set. The record cannot be {@code null}.
+ * @return Record with all columns filled from the table.
+ */
+ default R get(R keyRec) {
+ return get(null, keyRec);
+ }
+
/**
* Asynchronously gets a record with the same key column values as the given one from a table.
*
@@ -50,6 +61,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<R> getAsync(@Nullable Transaction tx, R keyRec);
+ /**
+ * Asynchronously gets a record with the same key column values as the given one from a table.
+ *
+ * @param keyRec Record with the key columns set. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<R> getAsync(R keyRec) {
+ return getAsync(null, keyRec);
+ }
+
/**
* Gets records from a table.
*
@@ -61,6 +82,18 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
List<R> getAll(@Nullable Transaction tx, Collection<R> keyRecs);
+ /**
+ * Gets records from a table.
+ *
+ * @param keyRecs Records with key columns set. The records cannot be {@code null}.
+ * @return Records with all columns filled from the table. The order of collection elements is
+ * guaranteed to be the same as the order of {@code keyRecs}. If a record does not exist, the
+ * element at the corresponding index of the resulting collection is {@code null}.
+ */
+ default List<R> getAll(Collection<R> keyRecs) {
+ return getAll(null, keyRecs);
+ }
+
/**
* Asynchronously gets records from a table.
*
@@ -72,6 +105,18 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<List<R>> getAllAsync(@Nullable Transaction tx, Collection<R> keyRecs);
+ /**
+ * Asynchronously gets records from a table.
+ *
+ * @param keyRecs Records with the key columns set. The records cannot be {@code null}.
+ * @return Future that will return records with all columns filled from the table. The order of collection elements is
+ * guaranteed to be the same as the order of {@code keyRecs}. If a record does not exist, the
+ * element at the corresponding index of the resulting collection is {@code null}.
+ */
+ default CompletableFuture<List<R>> getAllAsync(Collection<R> keyRecs) {
+ return getAllAsync(null, keyRecs);
+ }
+
/**
* Determines whether a table contains an entry for the specified key.
*
@@ -82,6 +127,17 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
boolean contains(@Nullable Transaction tx, R keyRec);
+ /**
+ * Determines whether a table contains an entry for the specified key.
+ *
+ * @param keyRec A record with key columns set. The key cannot be {@code null}.
+ * @return {@code True} if a value exists for every specified key, {@code false} otherwise.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default boolean contains(R keyRec) {
+ return contains(null, keyRec);
+ }
+
/**
* Determines whether a table contains an entry for the specified key.
*
@@ -92,6 +148,17 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<Boolean> containsAsync(@Nullable Transaction tx, R keyRec);
+ /**
+ * Determines whether a table contains an entry for the specified key.
+ *
+ * @param keyRec A record with key columns set. The key cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> containsAsync(R keyRec) {
+ return containsAsync(null, keyRec);
+ }
+
/**
* Determines whether a table contains entries for all given keys.
*
@@ -102,6 +169,17 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
boolean containsAll(@Nullable Transaction tx, Collection<R> keys);
+ /**
+ * Determines whether a table contains entries for all given keys.
+ *
+ * @param keys Keys whose presence is to be verified. The collection and it's values cannot be {@code null}.
+ * @return {@code True} if a value exists for every specified key, {@code false} otherwise.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default boolean containsAll(Collection<R> keys) {
+ return containsAll(null, keys);
+ }
+
/**
* Determines whether a table contains entries for all given keys.
*
@@ -113,6 +191,18 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<Boolean> containsAllAsync(@Nullable Transaction tx, Collection<R> keys);
+ /**
+ * Determines whether a table contains entries for all given keys.
+ *
+ * @param keys Keys whose presence is to be verified. The collection and it's values cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation. The result of the future will be {@code true} if a value
+ * exists for every specified key, {@code false} otherwise.
+ * @throws MarshallerException if the key doesn't match the schema.
+ */
+ default CompletableFuture<Boolean> containsAllAsync(Collection<R> keys) {
+ return containsAllAsync(null, keys);
+ }
+
/**
* Inserts a record into a table, if it does not exist, or replaces an existing one.
*
@@ -121,6 +211,15 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
void upsert(@Nullable Transaction tx, R rec);
+ /**
+ * Inserts a record into a table, if it does not exist, or replaces an existing one.
+ *
+ * @param rec Record to insert into the table. The record cannot be {@code null}.
+ */
+ default void upsert(R rec) {
+ upsert(null, rec);
+ }
+
/**
* Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.
*
@@ -130,6 +229,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<Void> upsertAsync(@Nullable Transaction tx, R rec);
+ /**
+ * Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.
+ *
+ * @param rec Record to insert into the table. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<Void> upsertAsync(R rec) {
+ return upsertAsync(null, rec);
+ }
+
/**
* Inserts records into a table, if they do not exist, or replaces the existing ones.
*
@@ -138,6 +247,15 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
void upsertAll(@Nullable Transaction tx, Collection<R> recs);
+ /**
+ * Inserts records into a table, if they do not exist, or replaces the existing ones.
+ *
+ * @param recs Records to insert into the table. The records cannot be {@code null}.
+ */
+ default void upsertAll(Collection<R> recs) {
+ upsertAll(null, recs);
+ }
+
/**
* Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.
*
@@ -147,6 +265,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<Void> upsertAllAsync(@Nullable Transaction tx, Collection<R> recs);
+ /**
+ * Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.
+ *
+ * @param recs Records to insert into the table. The records cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<Void> upsertAllAsync(Collection<R> recs) {
+ return upsertAllAsync(null, recs);
+ }
+
/**
* Inserts a record into a table, or replaces an existing record and returns the replaced record.
*
@@ -156,6 +284,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
R getAndUpsert(@Nullable Transaction tx, R rec);
+ /**
+ * Inserts a record into a table, or replaces an existing record and returns the replaced record.
+ *
+ * @param rec A record to insert into the table. The record cannot be {@code null}.
+ * @return Replaced record or {@code null} if it did not exist.
+ */
+ default R getAndUpsert(R rec) {
+ return getAndUpsert(null, rec);
+ }
+
/**
* Asynchronously inserts a record into a table, or replaces an existing record and returns the replaced record.
*
@@ -165,6 +303,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<R> getAndUpsertAsync(@Nullable Transaction tx, R rec);
+ /**
+ * Asynchronously inserts a record into a table, or replaces an existing record and returns the replaced record.
+ *
+ * @param rec Record to insert into the table. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<R> getAndUpsertAsync(R rec) {
+ return getAndUpsertAsync(null, rec);
+ }
+
/**
* Inserts a record into a table if it does not exists.
*
@@ -174,6 +322,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
boolean insert(@Nullable Transaction tx, R rec);
+ /**
+ * Inserts a record into a table if it does not exists.
+ *
+ * @param rec Record to insert into the table. The record cannot be {@code null}.
+ * @return {@code True} if successful, {@code false} otherwise.
+ */
+ default boolean insert(R rec) {
+ return insert(null, rec);
+ }
+
/**
* Asynchronously inserts a record into a table if it does not exists.
*
@@ -183,6 +341,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<Boolean> insertAsync(@Nullable Transaction tx, R rec);
+ /**
+ * Asynchronously inserts a record into a table if it does not exists.
+ *
+ * @param rec Record to insert into the table. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<Boolean> insertAsync(R rec) {
+ return insertAsync(null, rec);
+ }
+
/**
* Inserts into a table records that do not exist, skips those that exist.
*
@@ -192,6 +360,17 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
List<R> insertAll(@Nullable Transaction tx, Collection<R> recs);
+ /**
+ * Inserts into a table records that do not exist, skips those that exist.
+ *
+ * @param recs Records to insert into the table. The records cannot be {@code null}.
+ * @return Skipped records. The order of collection elements is guaranteed to be the same as the order of {@code recs}. If a record is
+ * inserted, the element will be excluded from the collection result.
+ */
+ default List<R> insertAll(Collection<R> recs) {
+ return insertAll(null, recs);
+ }
+
/**
* Asynchronously inserts into a table records that do not exist, skips those that exist.
*
@@ -202,6 +381,18 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<List<R>> insertAllAsync(@Nullable Transaction tx, Collection<R> recs);
+ /**
+ * Asynchronously inserts into a table records that do not exist, skips those that exist.
+ *
+ * @param recs Records to insert into the table. The records cannot be {@code null}.
+ * @return Future representing pending completion of the operation, with rejected rows for insertion in the result. The order of
+ * collection elements is guaranteed to be the same as the order of {@code recs}. If a record is inserted, the element will be
+ * excluded from the collection result.
+ */
+ default CompletableFuture<List<R>> insertAllAsync(Collection<R> recs) {
+ return insertAllAsync(null, recs);
+ }
+
/**
* Replaces an existing record associated with the same key column values as the given record.
*
@@ -211,15 +402,49 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
boolean replace(@Nullable Transaction tx, R rec);
+ /**
+ * Replaces an existing record associated with the same key column values as the given record.
+ *
+ * @param rec Record to replace with. The record cannot be {@code null}.
+ * @return {@code True} if a record was found and replaced successfully, {@code false} otherwise.
+ */
+ default boolean replace(R rec) {
+ return replace(null, rec);
+ }
+
/**
* Replaces an expected record in the table with the given new one.
+ * Deprecated: use {@link #replaceExact(Transaction, Object, Object)} instead.
*
* @param tx Transaction or {@code null} for implicit transaction.
* @param oldRec Record to replace. The record cannot be {@code null}.
* @param newRec Record to replace with. The record cannot be {@code null}.
* @return {@code True} if a record was replaced successfully, {@code false} otherwise.
*/
- boolean replace(@Nullable Transaction tx, R oldRec, R newRec);
+ @Deprecated(forRemoval = true)
+ default boolean replace(@Nullable Transaction tx, R oldRec, R newRec) {
+ return replaceExact(tx, oldRec, newRec);
+ }
+
+ /**
+ * Replaces an expected record in the table with the given new one.
+ *
+ * @param oldRec Record to replace. The record cannot be {@code null}.
+ * @param newRec Record to replace with. The record cannot be {@code null}.
+ * @return {@code True} if a record was replaced successfully, {@code false} otherwise.
+ */
+ boolean replaceExact(@Nullable Transaction tx, R oldRec, R newRec);
+
+ /**
+ * Replaces an expected record in the table with the given new one.
+ *
+ * @param oldRec Record to replace. The record cannot be {@code null}.
+ * @param newRec Record to replace with. The record cannot be {@code null}.
+ * @return {@code True} if a record was replaced successfully, {@code false} otherwise.
+ */
+ default boolean replaceExact(R oldRec, R newRec) {
+ return replaceExact(null, oldRec, newRec);
+ }
/**
* Asynchronously replaces an existing record associated with the same key columns values as the given record.
@@ -230,15 +455,49 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, R rec);
+ /**
+ * Asynchronously replaces an existing record associated with the same key columns values as the given record.
+ *
+ * @param rec Record to replace with. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<Boolean> replaceAsync(R rec) {
+ return replaceAsync(null, rec);
+ }
+
/**
* Asynchronously replaces an existing record in the table with the given new one.
+ * Deprecated: use {@link #replaceExactAsync(Transaction, Object, Object)} instead.
*
* @param tx Transaction or {@code null} for implicit transaction.
* @param oldRec Record to replace. The record cannot be {@code null}.
* @param newRec Record to replace with. The record cannot be {@code null}.
* @return Future that represents the pending completion of the operation.
*/
- CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, R oldRec, R newRec);
+ @Deprecated(forRemoval = true)
+ default CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, R oldRec, R newRec) {
+ return replaceExactAsync(tx, oldRec, newRec);
+ }
+
+ /**
+ * Asynchronously replaces an existing record in the table with the given new one.
+ *
+ * @param oldRec Record to replace. The record cannot be {@code null}.
+ * @param newRec Record to replace with. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, R oldRec, R newRec);
+
+ /**
+ * Asynchronously replaces an existing record in the table with the given new one.
+ *
+ * @param oldRec Record to replace. The record cannot be {@code null}.
+ * @param newRec Record to replace with. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<Boolean> replaceExactAsync(R oldRec, R newRec) {
+ return replaceExactAsync(null, oldRec, newRec);
+ }
/**
* Gets an existing record associated with the same key columns values as the given one, then replaces it with the given one.
@@ -249,6 +508,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
R getAndReplace(@Nullable Transaction tx, R rec);
+ /**
+ * Gets an existing record associated with the same key columns values as the given one, then replaces it with the given one.
+ *
+ * @param rec Record to replace with. The record cannot be {@code null}.
+ * @return Replaced record or {@code null} if it did not exist.
+ */
+ default R getAndReplace(R rec) {
+ return getAndReplace(null, rec);
+ }
+
/**
* Asynchronously gets an existing record associated with the same key column values as the given one,
* then replaces it with the given one.
@@ -259,6 +528,17 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<R> getAndReplaceAsync(@Nullable Transaction tx, R rec);
+ /**
+ * Asynchronously gets an existing record associated with the same key column values as the given one,
+ * then replaces it with the given one.
+ *
+ * @param rec Record to replace with. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<R> getAndReplaceAsync(R rec) {
+ return getAndReplaceAsync(null, rec);
+ }
+
/**
* Deletes a record with the same key column values as the given one from a table.
*
@@ -268,6 +548,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
boolean delete(@Nullable Transaction tx, R keyRec);
+ /**
+ * Deletes a record with the same key column values as the given one from a table.
+ *
+ * @param keyRec Record with the key columns set. The record cannot be {@code null}.
+ * @return {@code True} if removed successfully, {@code false} otherwise.
+ */
+ default boolean delete(R keyRec) {
+ return delete(null, keyRec);
+ }
+
/**
* Asynchronously deletes a record with the same key column values as the given one from a table.
*
@@ -277,6 +567,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<Boolean> deleteAsync(@Nullable Transaction tx, R keyRec);
+ /**
+ * Asynchronously deletes a record with the same key column values as the given one from a table.
+ *
+ * @param keyRec Record with the key columns set. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<Boolean> deleteAsync(R keyRec) {
+ return deleteAsync(null, keyRec);
+ }
+
/**
* Deletes the given record from a table.
*
@@ -286,15 +586,35 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
boolean deleteExact(@Nullable Transaction tx, R rec);
+ /**
+ * Deletes the given record from a table.
+ *
+ * @param rec Record to delete. The record cannot be {@code null}.
+ * @return {@code True} if removed successfully, {@code false} otherwise.
+ */
+ default boolean deleteExact(R rec) {
+ return deleteExact(null, rec);
+ }
+
/**
* Asynchronously deletes the given record from a table.
*
* @param tx Transaction or {@code null} for implicit transaction.
* @param rec Record to delete. The record cannot be {@code null}.
- * @return Future tha represents the pending completion of the operation.
+ * @return Future that represents the pending completion of the operation.
*/
CompletableFuture<Boolean> deleteExactAsync(@Nullable Transaction tx, R rec);
+ /**
+ * Asynchronously deletes the given record from a table.
+ *
+ * @param rec Record to delete. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<Boolean> deleteExactAsync(R rec) {
+ return deleteExactAsync(null, rec);
+ }
+
/**
* Gets and deletes from a table a record with the same key column values as the given one.
*
@@ -304,6 +624,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
R getAndDelete(@Nullable Transaction tx, R keyRec);
+ /**
+ * Gets and deletes from a table a record with the same key column values as the given one.
+ *
+ * @param keyRec Record with the key columns set. The record cannot be {@code null}.
+ * @return Removed record or {@code null} if it did not exist.
+ */
+ default R getAndDelete(R keyRec) {
+ return getAndDelete(null, keyRec);
+ }
+
/**
* Asynchronously gets and deletes from a table a record with the same key columns values as the given one.
*
@@ -313,6 +643,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<R> getAndDeleteAsync(@Nullable Transaction tx, R keyRec);
+ /**
+ * Asynchronously gets and deletes from a table a record with the same key columns values as the given one.
+ *
+ * @param keyRec Record with the key columns set. The record cannot be {@code null}.
+ * @return Future that represents the pending completion of the operation.
+ */
+ default CompletableFuture<R> getAndDeleteAsync(R keyRec) {
+ return getAndDeleteAsync(null, keyRec);
+ }
+
/**
* Removes from a table records with the same key column values as the given one.
*
@@ -330,6 +670,13 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
void deleteAll(@Nullable Transaction tx);
+ /**
+ * Removes all entries from a table records.
+ */
+ default void deleteAll() {
+ deleteAll(null);
+ }
+
/**
* Asynchronously removes from a table records with the same key column values as the given one.
*
@@ -348,6 +695,15 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
CompletableFuture<Void> deleteAllAsync(@Nullable Transaction tx);
+ /**
+ * Asynchronously removes all entries from a table records.
+ *
+ * @return Future represents the pending completion of the operation.
+ */
+ default CompletableFuture<Void> deleteAllAsync() {
+ return deleteAllAsync(null);
+ }
+
/**
* Remove the given records from a table.
*
@@ -357,6 +713,17 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
*/
List<R> deleteAllExact(@Nullable Transaction tx, Collection<R> recs);
+ /**
+ * Remove the given records from a table.
+ *
+ * @param recs Records to delete. The records cannot be {@code null}.
+ * @return Records that were not deleted. The order of collection elements is guaranteed to be the same as the order of {@code recs}. If
+ * a record is removed, the element will be excluded from the collection result.
+ */
+ default List<R> deleteAllExact(Collection<R> recs) {
+ return deleteAllExact(null, recs);
+ }
+
/**
* Asynchronously removes the given records from a table.
*
@@ -366,4 +733,16 @@ public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySourc
* If a record is removed, the element will be excluded from the collection result.
*/
CompletableFuture<List<R>> deleteAllExactAsync(@Nullable Transaction tx, Collection<R> recs);
+
+ /**
+ * Asynchronously removes the given records from a table.
+ *
+ * @param recs Records to delete. The records cannot be {@code null}.
+ * @return Future represents the pending completion of the operation, with rejected rows for deletion in the result. The order of
+ * collection elements is guaranteed to be the same as the order of {@code recs}. If a record is removed, the element will be
+ * excluded from the collection result.
+ */
+ default CompletableFuture<List<R>> deleteAllExactAsync(Collection<R> recs) {
+ return deleteAllExactAsync(null, recs);
+ }
}
diff --git a/modules/api/src/test/java/org/apache/ignite/table/TableApiConsistencyTest.java b/modules/api/src/test/java/org/apache/ignite/table/TableApiConsistencyTest.java
new file mode 100644
index 00000000000..b6a3f6e4498
--- /dev/null
+++ b/modules/api/src/test/java/org/apache/ignite/table/TableApiConsistencyTest.java
@@ -0,0 +1,741 @@
+/*
+ * 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.table;
+
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Parameter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.testframework.BaseIgniteAbstractTest;
+import org.apache.ignite.tx.Transaction;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+import org.mockito.Mockito;
+
+/**
+ * Test class to verify various requirements to Table API.
+ */
+public class TableApiConsistencyTest extends BaseIgniteAbstractTest {
+
+ Set<Method> noTxParamExclusions = Set.of(
+ KeyValueView.class.getDeclaredMethod("removeAll", Transaction.class, Collection.class),
+ KeyValueView.class.getDeclaredMethod("removeAllAsync", Transaction.class, Collection.class),
+ RecordView.class.getDeclaredMethod("deleteAll", Transaction.class, Collection.class),
+ RecordView.class.getDeclaredMethod("deleteAllAsync", Transaction.class, Collection.class)
+ );
+
+ private KeyValueView<Object, Object> kvViewMock;
+ private RecordView<Object> recViewMock;
+
+ public TableApiConsistencyTest() throws NoSuchMethodException {
+ }
+
+ @BeforeEach
+ public void setUp() {
+ kvViewMock = mock(KeyValueView.class, Mockito.CALLS_REAL_METHODS);
+ recViewMock = mock(RecordView.class, Mockito.CALLS_REAL_METHODS);
+ }
+
+ /**
+ * Test validates that if method requires {@link Transaction} parameter then overloaded method without such parameter should exist.
+ */
+ @ParameterizedTest
+ @ValueSource(classes = {KeyValueView.class, RecordView.class})
+ public void methodsWithOptionalTxShouldHaveSimpleOverload(Class<?> clazz) {
+ for (Method mtd : clazz.getDeclaredMethods()) {
+ var params = mtd.getParameters();
+
+ int txParIdx = txParamIdx(params);
+ boolean deprecated = mtd.isAnnotationPresent(Deprecated.class);
+
+ if (txParIdx != -1 && !deprecated) {
+ Class<?>[] altParams = Arrays.stream(params)
+ .filter(p -> p != params[txParIdx])
+ .map(Parameter::getType)
+ .toArray(Class[]::new);
+
+ Method altMtd;
+ try {
+ altMtd = clazz.getDeclaredMethod(mtd.getName(), altParams);
+ } catch (NoSuchMethodException e) {
+ altMtd = null;
+ }
+
+ if (altMtd == null && !noTxParamExclusions.contains(mtd)) {
+ fail("Method " + mtd + " should have overload without transaction parameter");
+ }
+
+ if (altMtd != null && noTxParamExclusions.contains(mtd)) {
+ fail("Method " + mtd + " has overload without transaction parameter but listed within exclusions");
+ }
+ }
+ }
+ }
+
+ private int txParamIdx(Parameter[] params) {
+ for (int i = 0; i < params.length; i++) {
+ if (params[i].getType() == Transaction.class) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ @Test
+ public void testKvGet() {
+ Object key = new Object();
+ kvViewMock.get(key);
+
+ verify(kvViewMock).get(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvGetAsync() {
+ Object key = new Object();
+
+ kvViewMock.getAsync(key);
+
+ verify(kvViewMock).getAsync(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvGetNullable() {
+ Object key = new Object();
+
+ kvViewMock.getNullable(key);
+
+ verify(kvViewMock).getNullable(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvGetNullableAsync() {
+ Object key = new Object();
+
+ kvViewMock.getNullableAsync(key);
+
+ verify(kvViewMock).getNullableAsync(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvGetOrDefault() {
+ Object key = new Object();
+ Object def = new Object();
+
+ kvViewMock.getOrDefault(key, def);
+
+ verify(kvViewMock).getOrDefault(eq(null), eq(key), eq(def));
+ }
+
+ @Test
+ void testKvGetOrDefaultAsync() {
+ Object key = new Object();
+ Object def = new Object();
+
+ kvViewMock.getOrDefaultAsync(key, def);
+
+ verify(kvViewMock).getOrDefaultAsync(eq(null), eq(key), eq(def));
+ }
+
+ @Test
+ void testKvGetAll() {
+ Collection<Object> keys = new ArrayList<>();
+
+ kvViewMock.getAll(keys);
+
+ verify(kvViewMock).getAll(eq(null), eq(keys));
+ }
+
+ @Test
+ void testKvGetAllAsync() {
+ Collection<Object> keys = new ArrayList<>();
+
+ kvViewMock.getAllAsync(keys);
+
+ verify(kvViewMock).getAllAsync(eq(null), eq(keys));
+ }
+
+ @Test
+ void testKvContains() {
+ Object key = new Object();
+
+ kvViewMock.contains(key);
+
+ verify(kvViewMock).contains(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvContainsAsync() {
+ Object key = new Object();
+
+ kvViewMock.containsAsync(key);
+
+ verify(kvViewMock).containsAsync(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvContainsAll() {
+ Collection<Object> keys = new ArrayList<>();
+
+ kvViewMock.containsAll(keys);
+
+ verify(kvViewMock).containsAll(eq(null), eq(keys));
+ }
+
+ @Test
+ void testKvContainsAllAsync() {
+ Collection<Object> keys = new ArrayList<>();
+
+ kvViewMock.containsAllAsync(keys);
+
+ verify(kvViewMock).containsAllAsync(eq(null), eq(keys));
+ }
+
+ @Test
+ void testKvPut() {
+ Object key = new Object();
+ Object val = new Object();
+
+ kvViewMock.put(key, val);
+
+ verify(kvViewMock).put(eq(null), eq(key), eq(val));
+ }
+
+ @Test
+ void testKvPutAsync() {
+ Object key = new Object();
+ Object val = new Object();
+
+ kvViewMock.putAsync(key, val);
+
+ verify(kvViewMock).putAsync(eq(null), eq(key), eq(val));
+ }
+
+ @Test
+ void testKvPutAll() {
+ Map<Object, Object> map = new HashMap<>();
+
+ kvViewMock.putAll(map);
+
+ verify(kvViewMock).putAll(eq(null), eq(map));
+ }
+
+ @Test
+ void testKvPutAllAsync() {
+ Map<Object, Object> map = new HashMap<>();
+
+ kvViewMock.putAllAsync(map);
+
+ verify(kvViewMock).putAllAsync(eq(null), eq(map));
+ }
+
+ @Test
+ void testKvRemove() {
+ Object key = new Object();
+
+ kvViewMock.remove(key);
+
+ verify(kvViewMock).remove(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvRemoveAsync() {
+ Object key = new Object();
+
+ kvViewMock.removeAsync(key);
+
+ verify(kvViewMock).removeAsync(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvRemoveExact() {
+ Object key = new Object();
+ Object val = new Object();
+
+ kvViewMock.removeExact(key, val);
+
+ verify(kvViewMock).removeExact(eq(null), eq(key), eq(val));
+ }
+
+ @Test
+ void testKvRemoveExactAsync() {
+ Object key = new Object();
+ Object val = new Object();
+
+ kvViewMock.removeExactAsync(key, val);
+
+ verify(kvViewMock).removeExactAsync(eq(null), eq(key), eq(val));
+ }
+
+ @Test
+ void testKvRemoveAll() {
+ kvViewMock.removeAll();
+
+ verify(kvViewMock).removeAll(eq(null));
+ }
+
+ @Test
+ void testKvRemoveAllAsync() {
+ kvViewMock.removeAllAsync();
+
+ verify(kvViewMock).removeAllAsync(eq(null));
+ }
+
+ @Test
+ void testKvGetAndRemove() {
+ Object key = new Object();
+
+ kvViewMock.getAndRemove(key);
+
+ verify(kvViewMock).getAndRemove(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvGetAndRemoveAsync() {
+ Object key = new Object();
+
+ kvViewMock.getAndRemoveAsync(key);
+
+ verify(kvViewMock).getAndRemoveAsync(eq(null), eq(key));
+ }
+
+ @Test
+ void testKvReplace() {
+ Object key = new Object();
+ Object val = new Object();
+
+ kvViewMock.replace(key, val);
+
+ verify(kvViewMock).replace(eq(null), eq(key), eq(val));
+ }
+
+ @Test
+ void testKvReplaceAsync() {
+ Object key = new Object();
+ Object val = new Object();
+
+ kvViewMock.replaceAsync(key, val);
+
+ verify(kvViewMock).replaceAsync(eq(null), eq(key), eq(val));
+ }
+
+ @Test
+ void testKvReplaceExact() {
+ Object key = new Object();
+ Object oldVal = new Object();
+ Object newVal = new Object();
+
+ kvViewMock.replaceExact(key, oldVal, newVal);
+
+ verify(kvViewMock).replaceExact(eq(null), eq(key), eq(oldVal), eq(newVal));
+ }
+
+ @Test
+ void testKvReplaceExactAsync() {
+ Object key = new Object();
+ Object oldVal = new Object();
+ Object newVal = new Object();
+
+ kvViewMock.replaceExactAsync(key, oldVal, newVal);
+
+ verify(kvViewMock).replaceExactAsync(eq(null), eq(key), eq(oldVal), eq(newVal));
+ }
+
+ @Test
+ void testRecGet() {
+ Object rec = new Object();
+
+ recViewMock.get(rec);
+
+ verify(recViewMock).get(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecGetAsync() {
+ Object rec = new Object();
+
+ recViewMock.getAsync(rec);
+
+ verify(recViewMock).getAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecGetAll() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.getAll(recs);
+
+ verify(recViewMock).getAll(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecGetAllAsync() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.getAllAsync(recs);
+
+ verify(recViewMock).getAllAsync(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecContains() {
+ Object rec = new Object();
+
+ recViewMock.contains(rec);
+
+ verify(recViewMock).contains(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecContainsAsync() {
+ Object rec = new Object();
+
+ recViewMock.containsAsync(rec);
+
+ verify(recViewMock).containsAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecContainsAll() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.containsAll(recs);
+
+ verify(recViewMock).containsAll(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecContainsAllAsync() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.containsAllAsync(recs);
+
+ verify(recViewMock).containsAllAsync(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecUpsert() {
+ Object rec = new Object();
+
+ recViewMock.upsert(rec);
+
+ verify(recViewMock).upsert(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecUpsertAsync() {
+ Object rec = new Object();
+
+ recViewMock.upsertAsync(rec);
+
+ verify(recViewMock).upsertAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecUpsertAll() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.upsertAll(recs);
+
+ verify(recViewMock).upsertAll(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecUpsertAllAsync() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.upsertAllAsync(recs);
+
+ verify(recViewMock).upsertAllAsync(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecGetAndUpsert() {
+ Object rec = new Object();
+
+ recViewMock.getAndUpsert(rec);
+
+ verify(recViewMock).getAndUpsert(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecGetAndUpsertAsync() {
+ Object rec = new Object();
+
+ recViewMock.getAndUpsertAsync(rec);
+
+ verify(recViewMock).getAndUpsertAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecInsert() {
+ Object rec = new Object();
+
+ recViewMock.insert(rec);
+
+ verify(recViewMock).insert(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecInsertAsync() {
+ Object rec = new Object();
+
+ recViewMock.insertAsync(rec);
+
+ verify(recViewMock).insertAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecInsertAll() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.insertAll(recs);
+
+ verify(recViewMock).insertAll(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecInsertAllAsync() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.insertAllAsync(recs);
+
+ verify(recViewMock).insertAllAsync(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecReplace() {
+ Object rec = new Object();
+
+ recViewMock.replace(rec);
+
+ verify(recViewMock).replace(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecReplaceExact() {
+ Object oldRec = new Object();
+ Object newRec = new Object();
+
+ recViewMock.replaceExact(oldRec, newRec);
+
+ verify(recViewMock).replaceExact(eq(null), eq(oldRec), eq(newRec));
+ }
+
+ @Test
+ void testRecReplaceAsync() {
+ Object rec = new Object();
+
+ recViewMock.replaceAsync(rec);
+
+ verify(recViewMock).replaceAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecReplaceExactAsync() {
+ Object oldRec = new Object();
+ Object newRec = new Object();
+
+ recViewMock.replaceExactAsync(oldRec, newRec);
+
+ verify(recViewMock).replaceExactAsync(eq(null), eq(oldRec), eq(newRec));
+ }
+
+ @Test
+ void testRecGetAndReplace() {
+ Object rec = new Object();
+
+ recViewMock.getAndReplace(rec);
+
+ verify(recViewMock).getAndReplace(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecGetAndReplaceAsync() {
+ Object rec = new Object();
+
+ recViewMock.getAndReplaceAsync(rec);
+
+ verify(recViewMock).getAndReplaceAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecDelete() {
+ Object rec = new Object();
+
+ recViewMock.delete(rec);
+
+ verify(recViewMock).delete(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecDeleteAsync() {
+ Object rec = new Object();
+
+ recViewMock.deleteAsync(rec);
+
+ verify(recViewMock).deleteAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecDeleteExact() {
+ Object rec = new Object();
+
+ recViewMock.deleteExact(rec);
+
+ verify(recViewMock).deleteExact(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecDeleteExactAsync() {
+ Object rec = new Object();
+
+ recViewMock.deleteExactAsync(rec);
+
+ verify(recViewMock).deleteExactAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecGetAndDelete() {
+ Object rec = new Object();
+
+ recViewMock.getAndDelete(rec);
+
+ verify(recViewMock).getAndDelete(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecGetAndDeleteAsync() {
+ Object rec = new Object();
+
+ recViewMock.getAndDeleteAsync(rec);
+
+ verify(recViewMock).getAndDeleteAsync(eq(null), eq(rec));
+ }
+
+ @Test
+ void testRecDeleteAll() {
+ recViewMock.deleteAll();
+
+ verify(recViewMock).deleteAll(eq(null));
+ }
+
+ @Test
+ void testRecDeleteAllAsync() {
+ recViewMock.deleteAllAsync();
+
+ verify(recViewMock).deleteAllAsync(eq(null));
+ }
+
+ @Test
+ void testRecDeleteAllExact() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.deleteAllExact(recs);
+
+ verify(recViewMock).deleteAllExact(eq(null), eq(recs));
+ }
+
+ @Test
+ void testRecDeleteAllExactAsync() {
+ Collection<Object> recs = new ArrayList<>();
+
+ recViewMock.deleteAllExactAsync(recs);
+
+ verify(recViewMock).deleteAllExactAsync(eq(null), eq(recs));
+ }
+
+ @Test
+ void testKvRemoveTxKeyValue() {
+ Object key = new Object();
+ Object val = new Object();
+ Transaction tx = mock(Transaction.class);
+
+ kvViewMock.remove(tx, key, val);
+
+ verify(kvViewMock).removeExact(eq(tx), eq(key), eq(val));
+ }
+
+ @Test
+ void testKvReplaceTxKeyValue() {
+ Object key = new Object();
+ Object oldVal = new Object();
+ Object newVal = new Object();
+ Transaction tx = mock(Transaction.class);
+
+ kvViewMock.replace(tx, key, oldVal, newVal);
+
+ verify(kvViewMock).replaceExact(eq(tx), eq(key), eq(oldVal), eq(newVal));
+ }
+
+ @Test
+ void testKvRemoveAsyncTxKeyValue() {
+ Object key = new Object();
+ Object val = new Object();
+ Transaction tx = mock(Transaction.class);
+
+ kvViewMock.removeAsync(tx, key, val);
+
+ verify(kvViewMock).removeExactAsync(eq(tx), eq(key), eq(val));
+ }
+
+ @Test
+ void testKvReplaceAsyncTxKeyValue() {
+ Object key = new Object();
+ Object oldVal = new Object();
+ Object newVal = new Object();
+ Transaction tx = mock(Transaction.class);
+
+ kvViewMock.replaceAsync(tx, key, oldVal, newVal);
+
+ verify(kvViewMock).replaceExactAsync(eq(tx), eq(key), eq(oldVal), eq(newVal));
+ }
+
+ @Test
+ void testRecReplaceTxRecRec() {
+ Object oldRec = new Object();
+ Object newRec = new Object();
+ Transaction tx = mock(Transaction.class);
+
+ recViewMock.replace(tx, oldRec, newRec);
+
+ verify(recViewMock).replaceExact(eq(tx), eq(oldRec), eq(newRec));
+ }
+
+ @Test
+ void testRecReplaceAsyncTxRecRec() {
+ Object oldRec = new Object();
+ Object newRec = new Object();
+ Transaction tx = mock(Transaction.class);
+
+ recViewMock.replaceAsync(tx, oldRec, newRec);
+
+ verify(recViewMock).replaceExactAsync(eq(tx), eq(oldRec), eq(newRec));
+ }
+}
diff --git a/modules/catalog-dsl/src/main/java/org/apache/ignite/internal/catalog/sql/SelectFromView.java b/modules/catalog-dsl/src/main/java/org/apache/ignite/internal/catalog/sql/SelectFromView.java
index 4c6efe29364..ea67c9014a9 100644
--- a/modules/catalog-dsl/src/main/java/org/apache/ignite/internal/catalog/sql/SelectFromView.java
+++ b/modules/catalog-dsl/src/main/java/org/apache/ignite/internal/catalog/sql/SelectFromView.java
@@ -27,6 +27,7 @@ import java.util.function.Function;
import org.apache.ignite.sql.IgniteSql;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.async.AsyncResultSet;
+import org.apache.ignite.tx.Transaction;
class SelectFromView<T> extends AbstractCatalogQuery<List<T>> {
private final String viewName;
@@ -51,7 +52,7 @@ class SelectFromView<T> extends AbstractCatalogQuery<List<T>> {
@Override
public CompletableFuture<List<T>> executeAsync() {
- return sql.executeAsync(null, toString()).thenCompose(resultSet -> {
+ return sql.executeAsync((Transaction) null, toString()).thenCompose(resultSet -> {
List<T> result = new ArrayList<>();
return iterate(resultSet, mapper, result).thenApply(unused -> result);
});
diff --git a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/table/ClientTupleReplaceExactRequest.java b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/table/ClientTupleReplaceExactRequest.java
index 2f6a8b24429..1d381333526 100644
--- a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/table/ClientTupleReplaceExactRequest.java
+++ b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/table/ClientTupleReplaceExactRequest.java
@@ -54,7 +54,7 @@ public class ClientTupleReplaceExactRequest {
HybridTimestampTracker tsTracker
) {
return ClientTupleRequestBase.readAsync(in, tables, resources, txManager, notificationSender, tsTracker, of(READ_SECOND_TUPLE))
- .thenCompose(req -> req.table().recordView().replaceAsync(req.tx(), req.tuple(), req.tuple2())
+ .thenCompose(req -> req.table().recordView().replaceExactAsync(req.tx(), req.tuple(), req.tuple2())
.thenApply(res -> out -> {
writeTxMeta(out, tsTracker, clockService, req);
out.packInt(req.table().schemaView().lastKnownSchemaVersion());
diff --git a/modules/client/src/main/java/org/apache/ignite/client/ClientOperationType.java b/modules/client/src/main/java/org/apache/ignite/client/ClientOperationType.java
index fccfc2e0b75..f8391a03ab0 100644
--- a/modules/client/src/main/java/org/apache/ignite/client/ClientOperationType.java
+++ b/modules/client/src/main/java/org/apache/ignite/client/ClientOperationType.java
@@ -91,7 +91,7 @@ public enum ClientOperationType {
TUPLE_REPLACE,
/**
- * Replace Exact ({@link RecordView#replace(Transaction, Object, Object)}).
+ * Replace Exact ({@link RecordView#replaceExact(Transaction, Object, Object)}).
*/
TUPLE_REPLACE_EXACT,
diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueBinaryView.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueBinaryView.java
index 4e8aaed9b27..9efad341e79 100644
--- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueBinaryView.java
+++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueBinaryView.java
@@ -355,8 +355,8 @@ public class ClientKeyValueBinaryView extends AbstractClientView<Entry<Tuple, Tu
/** {@inheritDoc} */
@Override
- public boolean remove(@Nullable Transaction tx, Tuple key, Tuple val) {
- return sync(removeAsync(tx, key, val));
+ public boolean removeExact(@Nullable Transaction tx, Tuple key, Tuple val) {
+ return sync(removeExactAsync(tx, key, val));
}
/** {@inheritDoc} */
@@ -374,7 +374,7 @@ public class ClientKeyValueBinaryView extends AbstractClientView<Entry<Tuple, Tu
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, Tuple key, Tuple val) {
+ public CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, Tuple key, Tuple val) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(val, "val");
@@ -483,8 +483,8 @@ public class ClientKeyValueBinaryView extends AbstractClientView<Entry<Tuple, Tu
/** {@inheritDoc} */
@Override
- public boolean replace(@Nullable Transaction tx, Tuple key, Tuple oldVal, Tuple newVal) {
- return sync(replaceAsync(tx, key, oldVal, newVal));
+ public boolean replaceExact(@Nullable Transaction tx, Tuple key, Tuple oldVal, Tuple newVal) {
+ return sync(replaceExactAsync(tx, key, oldVal, newVal));
}
/** {@inheritDoc} */
@@ -503,7 +503,7 @@ public class ClientKeyValueBinaryView extends AbstractClientView<Entry<Tuple, Tu
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, Tuple key, Tuple oldVal, Tuple newVal) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, Tuple key, Tuple oldVal, Tuple newVal) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(oldVal, "oldVal");
Objects.requireNonNull(newVal, "newVal");
diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueView.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueView.java
index 75becae7133..29b71efbfeb 100644
--- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueView.java
+++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueView.java
@@ -420,8 +420,8 @@ public class ClientKeyValueView<K, V> extends AbstractClientView<Entry<K, V>> im
/** {@inheritDoc} */
@Override
- public boolean remove(@Nullable Transaction tx, K key, V val) {
- return sync(removeAsync(tx, key, val));
+ public boolean removeExact(@Nullable Transaction tx, K key, V val) {
+ return sync(removeExactAsync(tx, key, val));
}
/** {@inheritDoc} */
@@ -439,7 +439,7 @@ public class ClientKeyValueView<K, V> extends AbstractClientView<Entry<K, V>> im
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, V val) {
+ public CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, K key, V val) {
Objects.requireNonNull(key, "key");
validateNullableValue(val, valSer.mapper().targetType());
@@ -561,10 +561,10 @@ public class ClientKeyValueView<K, V> extends AbstractClientView<Entry<K, V>> im
/** {@inheritDoc} */
@Override
- public boolean replace(@Nullable Transaction tx, K key, V oldVal, V newVal) {
+ public boolean replaceExact(@Nullable Transaction tx, K key, V oldVal, V newVal) {
Objects.requireNonNull(key, "key");
- return sync(replaceAsync(tx, key, oldVal, newVal));
+ return sync(replaceExactAsync(tx, key, oldVal, newVal));
}
/** {@inheritDoc} */
@@ -584,7 +584,7 @@ public class ClientKeyValueView<K, V> extends AbstractClientView<Entry<K, V>> im
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, V oldVal, V newVal) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, K key, V oldVal, V newVal) {
Objects.requireNonNull(key, "key");
validateNullableValue(oldVal, valSer.mapper().targetType());
diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordBinaryView.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordBinaryView.java
index 9e9604561ae..84ef7f9e12f 100644
--- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordBinaryView.java
+++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordBinaryView.java
@@ -299,8 +299,8 @@ public class ClientRecordBinaryView extends AbstractClientView<Tuple> implements
/** {@inheritDoc} */
@Override
- public boolean replace(@Nullable Transaction tx, Tuple oldRec, Tuple newRec) {
- return sync(replaceAsync(tx, oldRec, newRec));
+ public boolean replaceExact(@Nullable Transaction tx, Tuple oldRec, Tuple newRec) {
+ return sync(replaceExactAsync(tx, oldRec, newRec));
}
/** {@inheritDoc} */
@@ -318,7 +318,7 @@ public class ClientRecordBinaryView extends AbstractClientView<Tuple> implements
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, Tuple oldRec, Tuple newRec) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, Tuple oldRec, Tuple newRec) {
Objects.requireNonNull(oldRec);
Objects.requireNonNull(newRec);
diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordView.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordView.java
index a4908e888c8..fb61fd5801a 100644
--- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordView.java
+++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordView.java
@@ -309,8 +309,8 @@ public class ClientRecordView<R> extends AbstractClientView<R> implements Record
/** {@inheritDoc} */
@Override
- public boolean replace(@Nullable Transaction tx, R oldRec, R newRec) {
- return sync(replaceAsync(tx, oldRec, newRec));
+ public boolean replaceExact(@Nullable Transaction tx, R oldRec, R newRec) {
+ return sync(replaceExactAsync(tx, oldRec, newRec));
}
/** {@inheritDoc} */
@@ -328,7 +328,7 @@ public class ClientRecordView<R> extends AbstractClientView<R> implements Record
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, R oldRec, R newRec) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, R oldRec, R newRec) {
Objects.requireNonNull(oldRec);
Objects.requireNonNull(newRec);
diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/api/PublicApiClientKeyValueView.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/api/PublicApiClientKeyValueView.java
index cc5d8d7fa7e..97a31318d6a 100644
--- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/api/PublicApiClientKeyValueView.java
+++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/api/PublicApiClientKeyValueView.java
@@ -164,8 +164,8 @@ public class PublicApiClientKeyValueView<K, V> extends PublicApiClientViewBase<E
}
@Override
- public boolean remove(@Nullable Transaction tx, K key, V val) {
- return executeSyncOp(() -> view.remove(tx, key, val));
+ public boolean removeExact(@Nullable Transaction tx, K key, V val) {
+ return executeSyncOp(() -> view.removeExact(tx, key, val));
}
@Override
@@ -174,8 +174,8 @@ public class PublicApiClientKeyValueView<K, V> extends PublicApiClientViewBase<E
}
@Override
- public CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, V val) {
- return executeAsyncOp(() -> view.removeAsync(tx, key, val));
+ public CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, K key, V val) {
+ return executeAsyncOp(() -> view.removeExactAsync(tx, key, val));
}
@Override
@@ -224,8 +224,8 @@ public class PublicApiClientKeyValueView<K, V> extends PublicApiClientViewBase<E
}
@Override
- public boolean replace(@Nullable Transaction tx, K key, V oldValue, @Nullable V newValue) {
- return executeSyncOp(() -> view.replace(tx, key, oldValue, newValue));
+ public boolean replaceExact(@Nullable Transaction tx, K key, V oldValue, @Nullable V newValue) {
+ return executeSyncOp(() -> view.replaceExact(tx, key, oldValue, newValue));
}
@Override
@@ -234,8 +234,8 @@ public class PublicApiClientKeyValueView<K, V> extends PublicApiClientViewBase<E
}
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
- return executeAsyncOp(() -> view.replaceAsync(tx, key, oldVal, newVal));
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
+ return executeAsyncOp(() -> view.replaceExactAsync(tx, key, oldVal, newVal));
}
@Override
diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/api/PublicApiClientRecordView.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/api/PublicApiClientRecordView.java
index d8aca1439b7..6aa1b266f41 100644
--- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/api/PublicApiClientRecordView.java
+++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/api/PublicApiClientRecordView.java
@@ -143,8 +143,8 @@ public class PublicApiClientRecordView<R> extends PublicApiClientViewBase<R> imp
}
@Override
- public boolean replace(@Nullable Transaction tx, R oldRec, R newRec) {
- return executeSyncOp(() -> view.replace(tx, oldRec, newRec));
+ public boolean replaceExact(@Nullable Transaction tx, R oldRec, R newRec) {
+ return executeSyncOp(() -> view.replaceExact(tx, oldRec, newRec));
}
@Override
@@ -153,8 +153,8 @@ public class PublicApiClientRecordView<R> extends PublicApiClientViewBase<R> imp
}
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, R oldRec, R newRec) {
- return executeAsyncOp(() -> view.replaceAsync(tx, oldRec, newRec));
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, R oldRec, R newRec) {
+ return executeAsyncOp(() -> view.replaceExactAsync(tx, oldRec, newRec));
}
@Override
diff --git a/modules/client/src/test/java/org/apache/ignite/client/ClientMetricsTest.java b/modules/client/src/test/java/org/apache/ignite/client/ClientMetricsTest.java
index 179fbd6e4d3..24f8a114d34 100644
--- a/modules/client/src/test/java/org/apache/ignite/client/ClientMetricsTest.java
+++ b/modules/client/src/test/java/org/apache/ignite/client/ClientMetricsTest.java
@@ -227,7 +227,7 @@ public class ClientMetricsTest extends BaseIgniteAbstractTest {
assertThrowsSqlException(
Sql.STMT_VALIDATION_ERR,
"Query failed",
- () -> client.sql().execute(null, FakeIgniteQueryProcessor.FAILED_SQL));
+ () -> client.sql().execute(FakeIgniteQueryProcessor.FAILED_SQL));
assertEquals(0, metrics().requestsActive());
assertEquals(1, metrics().requestsFailed());
diff --git a/modules/client/src/test/java/org/apache/ignite/client/ClientSqlTest.java b/modules/client/src/test/java/org/apache/ignite/client/ClientSqlTest.java
index 8411c929f86..50e1481a97d 100644
--- a/modules/client/src/test/java/org/apache/ignite/client/ClientSqlTest.java
+++ b/modules/client/src/test/java/org/apache/ignite/client/ClientSqlTest.java
@@ -57,6 +57,7 @@ import org.apache.ignite.sql.ResultSetMetadata;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.Statement;
import org.apache.ignite.sql.async.AsyncResultSet;
+import org.apache.ignite.tx.Transaction;
import org.hamcrest.CoreMatchers;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
@@ -71,7 +72,7 @@ import org.junit.jupiter.params.provider.ValueSource;
public class ClientSqlTest extends AbstractClientTableTest {
@Test
public void testExecuteAsync() {
- AsyncResultSet<SqlRow> resultSet = client.sql().executeAsync(null, "SELECT 1").join();
+ AsyncResultSet<SqlRow> resultSet = client.sql().executeAsync("SELECT 1").join();
assertTrue(resultSet.hasRowSet());
assertFalse(resultSet.wasApplied());
@@ -83,7 +84,7 @@ public class ClientSqlTest extends AbstractClientTableTest {
@Test
public void testExecute() {
- ResultSet<SqlRow> resultSet = client.sql().execute(null, "SELECT 1");
+ ResultSet<SqlRow> resultSet = client.sql().execute("SELECT 1");
assertTrue(resultSet.hasRowSet());
assertFalse(resultSet.wasApplied());
@@ -102,7 +103,7 @@ public class ClientSqlTest extends AbstractClientTableTest {
.timeZoneId(ZoneId.of("Europe/London"))
.build();
- AsyncResultSet<SqlRow> resultSet = client.sql().executeAsync(null, statement).join();
+ AsyncResultSet<SqlRow> resultSet = client.sql().executeAsync((Transaction) null, statement).join();
Map<String, Object> props = StreamSupport.stream(resultSet.currentPage().spliterator(), false)
.collect(Collectors.toMap(x -> x.stringValue(0), x -> x.value(1)));
@@ -115,7 +116,7 @@ public class ClientSqlTest extends AbstractClientTableTest {
@Test
public void testMetadata() {
- ResultSet<SqlRow> resultSet = client.sql().execute(null, "SELECT META");
+ ResultSet<SqlRow> resultSet = client.sql().execute("SELECT META");
ResultSetMetadata meta = resultSet.metadata();
SqlRow row = resultSet.next();
@@ -196,7 +197,7 @@ public class ClientSqlTest extends AbstractClientTableTest {
sql.executeScript("foo");
- ResultSet<SqlRow> resultSet = sql.execute(null, "SELECT LAST SCRIPT");
+ ResultSet<SqlRow> resultSet = sql.execute("SELECT LAST SCRIPT");
SqlRow row = resultSet.next();
assertEquals(
@@ -210,7 +211,7 @@ public class ClientSqlTest extends AbstractClientTableTest {
sql.executeScript("do bar baz", "arg1", null, 2);
- ResultSet<SqlRow> resultSet = sql.execute(null, "SELECT LAST SCRIPT");
+ ResultSet<SqlRow> resultSet = sql.execute("SELECT LAST SCRIPT");
SqlRow row = resultSet.next();
assertEquals(
@@ -231,8 +232,8 @@ public class ClientSqlTest extends AbstractClientTableTest {
.defaultSchema("SCHEMA_2")
.build();
- sql.execute(null, statement1);
- sql.execute(null, statement2);
+ sql.execute((Transaction) null, statement1);
+ sql.execute((Transaction) null, statement2);
List<PartitionMappingProvider> metas = ((ClientSql) sql).partitionAwarenessCachedMetas();
assertThat(metas.size(), CoreMatchers.is(2));
@@ -260,7 +261,7 @@ public class ClientSqlTest extends AbstractClientTableTest {
.defaultSchema("SCHEMA_" + i)
.build();
- sql.execute(null, statement1);
+ sql.execute((Transaction) null, statement1);
}
assertTrue(waitForCondition(
diff --git a/modules/client/src/test/java/org/apache/ignite/client/ServerMetricsTest.java b/modules/client/src/test/java/org/apache/ignite/client/ServerMetricsTest.java
index d49cfea36ca..3fcc6e6d613 100644
--- a/modules/client/src/test/java/org/apache/ignite/client/ServerMetricsTest.java
+++ b/modules/client/src/test/java/org/apache/ignite/client/ServerMetricsTest.java
@@ -80,7 +80,7 @@ public class ServerMetricsTest extends AbstractClientTest {
assertEquals(0, testServer.metrics().cursorsActive());
- ResultSet<SqlRow> resultSet = client.sql().execute(null, statement);
+ ResultSet<SqlRow> resultSet = client.sql().execute((Transaction) null, statement);
assertEquals(1, testServer.metrics().cursorsActive());
resultSet.close();
diff --git a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/ClientCompatibilityTests.java b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/ClientCompatibilityTests.java
index db22f726dfa..be63b944d76 100644
--- a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/ClientCompatibilityTests.java
+++ b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/ClientCompatibilityTests.java
@@ -136,7 +136,7 @@ public interface ClientCompatibilityTests {
@Test
default void testSqlColumnMeta() {
- try (var cursor = client().sql().execute(null, "select * from " + TABLE_NAME_ALL_COLUMNS)) {
+ try (var cursor = client().sql().execute((Transaction) null, "select * from " + TABLE_NAME_ALL_COLUMNS)) {
ResultSetMetadata meta = cursor.metadata();
assertNotNull(meta);
@@ -204,7 +204,7 @@ public interface ClientCompatibilityTests {
.pageSize(10)
.build();
- try (var cursor = client().sql().execute(null, statement, minId)) {
+ try (var cursor = client().sql().execute((Transaction) null, statement, minId)) {
AtomicInteger rowCnt = new AtomicInteger();
cursor.forEachRemaining(x -> rowCnt.incrementAndGet());
diff --git a/modules/compatibility-tests/src/test/java/org/apache/ignite/internal/ApiCompatibilityTest.java b/modules/compatibility-tests/src/test/java/org/apache/ignite/internal/ApiCompatibilityTest.java
index b15fa978ca8..2540048c601 100644
--- a/modules/compatibility-tests/src/test/java/org/apache/ignite/internal/ApiCompatibilityTest.java
+++ b/modules/compatibility-tests/src/test/java/org/apache/ignite/internal/ApiCompatibilityTest.java
@@ -64,7 +64,19 @@ class ApiCompatibilityTest {
),
"3.1.0", List.of(
// Erroneous error code remove between versions
- "org.apache.ignite.lang.ErrorGroups$DisasterRecovery#RESTART_WITH_CLEAN_UP_ERR"
+ "org.apache.ignite.lang.ErrorGroups$DisasterRecovery#RESTART_WITH_CLEAN_UP_ERR",
+ "org.apache.ignite.table.KeyValueView" // METHOD_ABSTRACT_NOW_DEFAULT
+ + "#remove(org.apache.ignite.tx.Transaction, java.lang.Object, java.lang.Object)",
+ "org.apache.ignite.table.KeyValueView" // METHOD_ABSTRACT_NOW_DEFAULT
+ + "#removeAsync(org.apache.ignite.tx.Transaction, java.lang.Object, java.lang.Object)",
+ "org.apache.ignite.table.KeyValueView" // METHOD_ABSTRACT_NOW_DEFAULT
+ + "#replace(org.apache.ignite.tx.Transaction, java.lang.Object, java.lang.Object, java.lang.Object)",
+ "org.apache.ignite.table.KeyValueView" // METHOD_ABSTRACT_NOW_DEFAULT
+ + "#replaceAsync(org.apache.ignite.tx.Transaction, java.lang.Object, java.lang.Object, java.lang.Object)",
+ "org.apache.ignite.table.RecordView" // METHOD_ABSTRACT_NOW_DEFAULT
+ + "#replace(org.apache.ignite.tx.Transaction, java.lang.Object, java.lang.Object)",
+ "org.apache.ignite.table.RecordView" // METHOD_ABSTRACT_NOW_DEFAULT
+ + "#replaceAsync(org.apache.ignite.tx.Transaction, java.lang.Object, java.lang.Object)"
)
);
diff --git a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestCommon.java b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestCommon.java
index 69b8e9b1825..0c10fe1796c 100644
--- a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestCommon.java
+++ b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestCommon.java
@@ -81,7 +81,7 @@ public class CompatibilityTestCommon {
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
private static boolean ddl(Ignite client, String sql) {
- try (var cursor = client.sql().execute(null, sql)) {
+ try (var cursor = client.sql().execute(sql)) {
return cursor.wasApplied();
}
}
diff --git a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFiltersTest.java b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFiltersTest.java
index 2609fcc0da6..2cce613fc16 100644
--- a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFiltersTest.java
+++ b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFiltersTest.java
@@ -133,11 +133,10 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
IgniteImpl node = unwrapIgniteImpl(startNode(1, createStartConfig(firstNodeAttributes, STORAGE_PROFILES_CONFIGS)));
node.sql().execute(
- null,
createZoneSql(2, 3, IMMEDIATE_TIMER_VALUE, IMMEDIATE_TIMER_VALUE, filter, STORAGE_PROFILES, consistencyMode)
);
- node.sql().execute(null, createTableSql());
+ node.sql().execute(createTableSql());
MetaStorageManager metaStorageManager = node.metaStorageManager();
@@ -203,11 +202,10 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
IgniteImpl node0 = unwrapIgniteImpl(node(0));
node0.sql().execute(
- null,
createZoneSql(2, 3, 10_000, 10_000, filter, STORAGE_PROFILES, consistencyMode)
);
- node0.sql().execute(null, createTableSql());
+ node0.sql().execute(createTableSql());
MetaStorageManager metaStorageManager = node0.metaStorageManager();
@@ -232,7 +230,7 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
// Expected size is 1 because we have timers equals to 10000, so no scale up will be propagated.
waitDataNodeAndListenersAreHandled(metaStorageManager, 1, getZoneId(node0));
- node0.sql().execute(null, alterZoneSql(DEFAULT_FILTER));
+ node0.sql().execute(alterZoneSql(DEFAULT_FILTER));
// We check that all nodes that pass the filter are presented in the stable key because altering filter triggers immediate scale up.
assertValueInStorage(
@@ -259,11 +257,10 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
IgniteImpl node0 = unwrapIgniteImpl(node(0));
node0.sql().execute(
- null,
createZoneSql(2, 3, 10_000, 10_000, filter, STORAGE_PROFILES, consistencyMode)
);
- node0.sql().execute(null, createTableSql());
+ node0.sql().execute(createTableSql());
MetaStorageManager metaStorageManager = node0.metaStorageManager();
@@ -293,7 +290,7 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
// There is no node that match the filter
String newFilter = "$[?(@.region == \"FOO\" && @.storage == \"BAR\")]";
- assertThrowsWithCode(SqlException.class, STMT_VALIDATION_ERR, () -> node0.sql().execute(null, alterZoneSql(newFilter)), null);
+ assertThrowsWithCode(SqlException.class, STMT_VALIDATION_ERR, () -> node0.sql().execute(alterZoneSql(newFilter)), null);
assertValueInStorage(
metaStorageManager,
@@ -325,7 +322,6 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
Ignite node1 = startNode(1, createStartConfig(firstNodeAttributes, STORAGE_PROFILES_CONFIGS));
node1.sql().execute(
- null,
createZoneSql(1, 1, IMMEDIATE_TIMER_VALUE, IMMEDIATE_TIMER_VALUE, filter, STORAGE_PROFILES, consistencyMode)
);
@@ -339,7 +335,7 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
waitDataNodeAndListenersAreHandled(metaStorageManager, 1, zoneId);
- node1.sql().execute(null, createTableSql());
+ node1.sql().execute(createTableSql());
TableViewInternal table = unwrapTableViewInternal(node0.distributedTableManager().table(TABLE_NAME));
@@ -371,7 +367,6 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
startNode(1, createStartConfig(firstNodeAttributes, STORAGE_PROFILES_CONFIGS));
node0.sql().execute(
- null,
createZoneSql(1, 1, IMMEDIATE_TIMER_VALUE, IMMEDIATE_TIMER_VALUE, filter, STORAGE_PROFILES, consistencyMode)
);
@@ -385,7 +380,7 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
waitDataNodeAndListenersAreHandled(metaStorageManager, 1, zoneId);
- node0.sql().execute(null, createTableSql());
+ node0.sql().execute(createTableSql());
TableViewInternal table = unwrapTableViewInternal(node0.distributedTableManager().table(TABLE_NAME));
@@ -402,7 +397,7 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
// Check that stable and pending are null, so there wasn't any rebalance.
assertPendingAssignmentsNeverExisted(metaStorageManager, partId);
- node0.sql().execute(null, alterZoneSql(2));
+ node0.sql().execute(alterZoneSql(2));
CountDownLatch latch = new CountDownLatch(1);
@@ -415,7 +410,7 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
return falseCompletedFuture();
});
- node0.sql().execute(null, alterZoneSql(3));
+ node0.sql().execute(alterZoneSql(3));
assertTrue(latch.await(10_000, MILLISECONDS));
@@ -478,7 +473,7 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
}
private static void executeSql(IgniteImpl node, String sql) {
- node.sql().execute(null, sql);
+ node.sql().execute(sql);
}
private static void waitDataNodeAndListenersAreHandled(
diff --git a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItEmptyDataNodesTest.java b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItEmptyDataNodesTest.java
index bfd049af5c3..3513f1a5013 100644
--- a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItEmptyDataNodesTest.java
+++ b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItEmptyDataNodesTest.java
@@ -88,7 +88,7 @@ class ItEmptyDataNodesTest extends ClusterPerTestIntegrationTest {
IgniteImpl node = unwrapIgniteImpl(cluster.aliveNode());
int activeCatalogVersion = node.catalogManager().activeCatalog(node.clock().now().longValue()).version();
- node.sql().executeAsync(null, format("CREATE ZONE {} (PARTITIONS 1, AUTO SCALE DOWN 0) STORAGE PROFILES ['default']", ZONE_NAME));
+ node.sql().executeAsync(format("CREATE ZONE {} (PARTITIONS 1, AUTO SCALE DOWN 0) STORAGE PROFILES ['default']", ZONE_NAME));
ByteArray catalogVersionKey = new ByteArray("catalog.version".getBytes(StandardCharsets.UTF_8));
waitForCondition(() -> {
@@ -161,11 +161,11 @@ class ItEmptyDataNodesTest extends ClusterPerTestIntegrationTest {
}
private void sql(String sql) {
- cluster.aliveNode().sql().execute(null, sql);
+ cluster.aliveNode().sql().execute(sql);
}
private CompletableFuture<?> sqlAsync(String sql) {
- return cluster.aliveNode().sql().executeAsync(null, sql);
+ return cluster.aliveNode().sql().executeAsync(sql);
}
private void setAdditionalNodeFilter(@Nullable Predicate<NodeWithAttributes> filter) {
diff --git a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceRecoveryTest.java b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceRecoveryTest.java
index a32d64067d8..c3ed377cc10 100644
--- a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceRecoveryTest.java
+++ b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceRecoveryTest.java
@@ -55,10 +55,10 @@ public class ItRebalanceRecoveryTest extends ClusterPerTestIntegrationTest {
@Test
void testPendingAssignmentsRecovery() throws InterruptedException {
cluster.doInSession(0, session -> {
- session.execute(null, "CREATE ZONE TEST_ZONE (PARTITIONS 1, REPLICAS 1) STORAGE PROFILES ['"
+ session.execute("CREATE ZONE TEST_ZONE (PARTITIONS 1, REPLICAS 1) STORAGE PROFILES ['"
+ DEFAULT_STORAGE_PROFILE + "']");
- session.execute(null, "CREATE TABLE TEST (id INT PRIMARY KEY, name INT) ZONE TEST_ZONE");
- session.execute(null, "INSERT INTO TEST VALUES (0, 0)");
+ session.execute("CREATE TABLE TEST (id INT PRIMARY KEY, name INT) ZONE TEST_ZONE");
+ session.execute("INSERT INTO TEST VALUES (0, 0)");
});
assertTrue(containsPartition(cluster.node(0)));
@@ -69,7 +69,7 @@ public class ItRebalanceRecoveryTest extends ClusterPerTestIntegrationTest {
// Change the number of replicas so that the table would get replicated on both nodes.
cluster.doInSession(0, session -> {
- session.execute(null, "ALTER ZONE TEST_ZONE SET (REPLICAS 2)");
+ session.execute("ALTER ZONE TEST_ZONE SET (REPLICAS 2)");
});
cluster.restartNode(1);
diff --git a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceTriggersRecoveryTest.java b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceTriggersRecoveryTest.java
index 6f79f1ee96d..523cc30f4e9 100644
--- a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceTriggersRecoveryTest.java
+++ b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceTriggersRecoveryTest.java
@@ -103,10 +103,10 @@ public class ItRebalanceTriggersRecoveryTest extends ClusterPerTestIntegrationTe
startNode(2, GLOBAL_NODE_BOOTSTRAP_CFG_TEMPLATE);
cluster.doInSession(0, session -> {
- session.execute(null, "CREATE ZONE TEST_ZONE (PARTITIONS 1, REPLICAS 2, NODES FILTER '$[?(@.region == \"US\")]') "
+ session.execute("CREATE ZONE TEST_ZONE (PARTITIONS 1, REPLICAS 2, NODES FILTER '$[?(@.region == \"US\")]') "
+ "STORAGE PROFILES ['" + DEFAULT_STORAGE_PROFILE + "']");
- session.execute(null, "CREATE TABLE " + TABLE_NAME + " (id INT PRIMARY KEY, name INT) ZONE " + ZONE_NAME);
- session.execute(null, "INSERT INTO " + TABLE_NAME + " VALUES (0, 0)");
+ session.execute("CREATE TABLE " + TABLE_NAME + " (id INT PRIMARY KEY, name INT) ZONE " + ZONE_NAME);
+ session.execute("INSERT INTO " + TABLE_NAME + " VALUES (0, 0)");
});
assertTrue(waitForCondition(() -> containsPartition(cluster.node(1)), 10_000));
@@ -119,7 +119,7 @@ public class ItRebalanceTriggersRecoveryTest extends ClusterPerTestIntegrationTe
WatchListenerInhibitor.metastorageEventsInhibitor(cluster.node(2)).startInhibit();
cluster.doInSession(0, session -> {
- session.execute(null, "ALTER ZONE " + ZONE_NAME + " SET (NODES FILTER '$[?(@.zone == \"global\")]')");
+ session.execute("ALTER ZONE " + ZONE_NAME + " SET (NODES FILTER '$[?(@.zone == \"global\")]')");
});
// Check that metastore node schedule the rebalance procedure.
@@ -146,10 +146,10 @@ public class ItRebalanceTriggersRecoveryTest extends ClusterPerTestIntegrationTe
startNode(2, GLOBAL_NODE_BOOTSTRAP_CFG_TEMPLATE);
cluster.doInSession(0, session -> {
- session.execute(null, "CREATE ZONE TEST_ZONE (PARTITIONS 1, REPLICAS 1, "
+ session.execute("CREATE ZONE TEST_ZONE (PARTITIONS 1, REPLICAS 1, "
+ "NODES FILTER '$[?(@.zone == \"global\")]') STORAGE PROFILES ['" + DEFAULT_STORAGE_PROFILE + "']");
- session.execute(null, "CREATE TABLE " + TABLE_NAME + " (id INT PRIMARY KEY, name INT) ZONE " + ZONE_NAME);
- session.execute(null, "INSERT INTO " + TABLE_NAME + " VALUES (0, 0)");
+ session.execute("CREATE TABLE " + TABLE_NAME + " (id INT PRIMARY KEY, name INT) ZONE " + ZONE_NAME);
+ session.execute("INSERT INTO " + TABLE_NAME + " VALUES (0, 0)");
});
assertTrue(waitForCondition(() -> containsPartition(cluster.node(1)), 10_000));
@@ -162,7 +162,7 @@ public class ItRebalanceTriggersRecoveryTest extends ClusterPerTestIntegrationTe
WatchListenerInhibitor.metastorageEventsInhibitor(cluster.node(2)).startInhibit();
cluster.doInSession(0, session -> {
- session.execute(null, "ALTER ZONE " + ZONE_NAME + " SET (REPLICAS 2)");
+ session.execute("ALTER ZONE " + ZONE_NAME + " SET (REPLICAS 2)");
});
// Check that metastore node schedule the rebalance procedure.
@@ -193,10 +193,10 @@ public class ItRebalanceTriggersRecoveryTest extends ClusterPerTestIntegrationTe
startNode(3);
cluster.doInSession(0, session -> {
- session.execute(null, "CREATE ZONE TEST_ZONE (PARTITIONS 1, REPLICAS 1, "
+ session.execute("CREATE ZONE TEST_ZONE (PARTITIONS 1, REPLICAS 1, "
+ "NODES FILTER '$[?(@.region == \"US\")]') STORAGE PROFILES ['" + DEFAULT_STORAGE_PROFILE + "']");
- session.execute(null, "CREATE TABLE " + TABLE_NAME + " (id INT PRIMARY KEY, name INT) ZONE " + ZONE_NAME);
- session.execute(null, "INSERT INTO " + TABLE_NAME + " VALUES (0, 0)");
+ session.execute("CREATE TABLE " + TABLE_NAME + " (id INT PRIMARY KEY, name INT) ZONE " + ZONE_NAME);
+ session.execute("INSERT INTO " + TABLE_NAME + " VALUES (0, 0)");
});
assertTrue(waitForCondition(() -> containsPartition(cluster.node(1)), 10_000));
@@ -205,7 +205,7 @@ public class ItRebalanceTriggersRecoveryTest extends ClusterPerTestIntegrationTe
stopNode(3);
cluster.doInSession(0, session -> {
- session.execute(null, "ALTER ZONE " + ZONE_NAME + " SET (REPLICAS 2, NODES FILTER '$[?(@.zone == \"global\")]')");
+ session.execute("ALTER ZONE " + ZONE_NAME + " SET (REPLICAS 2, NODES FILTER '$[?(@.zone == \"global\")]')");
});
// Check that new replica from 'global' zone received the data and rebalance really happened.
diff --git a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/IndexBuildTestUtils.java b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/IndexBuildTestUtils.java
index 28117ac2a83..b26dc0dbb7f 100644
--- a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/IndexBuildTestUtils.java
+++ b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/IndexBuildTestUtils.java
@@ -75,7 +75,7 @@ class IndexBuildTestUtils {
// stuck with timeouts. We don't need to wait for the operation to complete, as we wait for the necessary invariants further
// below.
cluster.aliveNode().sql()
- .executeAsync(null, format("CREATE INDEX {} ON {} (i1)", indexName, TABLE_NAME))
+ .executeAsync(format("CREATE INDEX {} ON {} (i1)", indexName, TABLE_NAME))
.whenComplete((res, ex) -> {
if (ex != null) {
LOG.error("Failed to create index", ex);
diff --git a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java
index c2425304901..568929d9049 100644
--- a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java
+++ b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java
@@ -242,7 +242,7 @@ public class ItBuildIndexTest extends BaseSqlIntegrationTest {
// stuck with timeouts. We don't need to wait for the operation to complete, as we wait for the necessary invariants further
// below.
CLUSTER.aliveNode().sql()
- .executeAsync(null, format("CREATE INDEX {} ON {} (i1)", indexName, TABLE_NAME))
+ .executeAsync(format("CREATE INDEX {} ON {} (i1)", indexName, TABLE_NAME))
.whenComplete((res, ex) -> {
if (ex != null) {
log.error("Failed to create index", ex);
diff --git a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexAndIndexStorageDestructionTest.java b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexAndIndexStorageDestructionTest.java
index abe265f864f..80967475a39 100644
--- a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexAndIndexStorageDestructionTest.java
+++ b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexAndIndexStorageDestructionTest.java
@@ -71,10 +71,10 @@ class ItIndexAndIndexStorageDestructionTest extends ClusterPerTestIntegrationTes
node = cluster.aliveNode();
cluster.doInSession(0, session -> {
- session.execute(null, "CREATE TABLE " + TABLE_NAME + " (id INT PRIMARY KEY, name VARCHAR)");
- session.execute(null, "CREATE INDEX " + INDEX_NAME + " ON " + TABLE_NAME + "(name)");
+ session.execute("CREATE TABLE " + TABLE_NAME + " (id INT PRIMARY KEY, name VARCHAR)");
+ session.execute("CREATE INDEX " + INDEX_NAME + " ON " + TABLE_NAME + "(name)");
- session.execute(null, "INSERT INTO " + TABLE_NAME + " (id, name) VALUES (" + PREEXISTING_KEY + ", 'John')");
+ session.execute("INSERT INTO " + TABLE_NAME + " (id, name) VALUES (" + PREEXISTING_KEY + ", 'John')");
});
TableImpl table = unwrapTableImpl(node.tables().table(TABLE_NAME));
diff --git a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexBuildCompletenessTest.java b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexBuildCompletenessTest.java
index c8beb1bfd48..408f9efc4a5 100644
--- a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexBuildCompletenessTest.java
+++ b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexBuildCompletenessTest.java
@@ -131,7 +131,7 @@ class ItIndexBuildCompletenessTest extends ClusterPerTestIntegrationTest {
}
private long rowCountInTable() {
- try (ResultSet<SqlRow> resultSet = cluster.aliveNode().sql().execute(null, "SELECT COUNT(*) FROM " + TABLE_NAME)) {
+ try (ResultSet<SqlRow> resultSet = cluster.aliveNode().sql().execute("SELECT COUNT(*) FROM " + TABLE_NAME)) {
return resultSet.next().longValue(0);
}
}
diff --git a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexRegistrationAndRebalanceConcurrencyTest.java b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexRegistrationAndRebalanceConcurrencyTest.java
index 40faa93f900..9f1531cf1f1 100644
--- a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexRegistrationAndRebalanceConcurrencyTest.java
+++ b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexRegistrationAndRebalanceConcurrencyTest.java
@@ -52,7 +52,7 @@ class ItIndexRegistrationAndRebalanceConcurrencyTest extends ClusterPerTestInteg
}
private static void waitForStoragesToBeCreated(Ignite ignite) {
- ignite.sql().execute(null, "SELECT * FROM " + TEST_TABLE_NAME).close();
+ ignite.sql().execute("SELECT * FROM " + TEST_TABLE_NAME).close();
}
private static void initiateRebalanceOnTestZone(Ignite ignite) {
diff --git a/modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcAuthenticationTest.java b/modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcAuthenticationTest.java
index 9d335378095..8fa1eeddf38 100644
--- a/modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcAuthenticationTest.java
+++ b/modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcAuthenticationTest.java
@@ -115,7 +115,7 @@ class ItJdbcAuthenticationTest {
*/
@Test
void jdbcCurrentUser() throws SQLException {
- CLUSTER.aliveNode().sql().execute(null, "CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)").close();
+ CLUSTER.aliveNode().sql().execute("CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)").close();
String connString = "jdbc:ignite:thin://127.0.0.1:10800?username={}&password={}";
String user1 = "usr";
diff --git a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItBigZoneOperationTest.java b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItBigZoneOperationTest.java
index 8b2ac086eac..e19560dbca8 100644
--- a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItBigZoneOperationTest.java
+++ b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItBigZoneOperationTest.java
@@ -43,7 +43,7 @@ class ItBigZoneOperationTest extends ClusterPerTestIntegrationTest {
+ "CREATE TABLE TEST_TABLE(id INT PRIMARY KEY, val VARCHAR(255)) ZONE TEST_ZONE"
);
- node.sql().execute(null, "SELECT * FROM TEST_TABLE").close();
+ node.sql().execute("SELECT * FROM TEST_TABLE").close();
});
}
}
diff --git a/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java b/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
index 0fd4552c8fa..4c3fb3710e7 100644
--- a/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
+++ b/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
@@ -922,7 +922,7 @@ class ItTableRaftSnapshotsTest extends ClusterPerTestIntegrationTest {
private void updateTableSchemaAt(int nodeIndex) {
cluster.doInSession(nodeIndex, session -> {
- session.execute(null, "alter table test add column added int");
+ session.execute("alter table test add column added int");
});
}
diff --git a/modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/sql/ItSqlQueryControllerTest.java b/modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/sql/ItSqlQueryControllerTest.java
index 05a218e0f02..97137b1bd73 100644
--- a/modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/sql/ItSqlQueryControllerTest.java
+++ b/modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/sql/ItSqlQueryControllerTest.java
@@ -43,6 +43,7 @@ import org.apache.ignite.sql.IgniteSql;
import org.apache.ignite.sql.ResultSet;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.Statement;
+import org.apache.ignite.tx.Transaction;
import org.junit.jupiter.api.Test;
/**
@@ -148,7 +149,7 @@ public class ItSqlQueryControllerTest extends ClusterPerClassIntegrationTest {
IgniteSql igniteSql = CLUSTER.aliveNode().sql();
Statement stmt = igniteSql.statementBuilder().query(sql).pageSize(1).build();
- return CLUSTER.aliveNode().sql().execute(null, stmt);
+ return CLUSTER.aliveNode().sql().execute((Transaction) null, stmt);
}
private static Map<UUID, SqlQueryInfo> getSqlQueries(HttpClient client) {
diff --git a/modules/rest/src/main/java/org/apache/ignite/internal/rest/sql/SqlQueryController.java b/modules/rest/src/main/java/org/apache/ignite/internal/rest/sql/SqlQueryController.java
index 89eb702dc4c..fb136ca1369 100644
--- a/modules/rest/src/main/java/org/apache/ignite/internal/rest/sql/SqlQueryController.java
+++ b/modules/rest/src/main/java/org/apache/ignite/internal/rest/sql/SqlQueryController.java
@@ -44,6 +44,7 @@ import org.apache.ignite.sql.IgniteSql;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.Statement;
import org.apache.ignite.sql.async.AsyncResultSet;
+import org.apache.ignite.tx.Transaction;
import org.jetbrains.annotations.Nullable;
/**
@@ -125,7 +126,7 @@ public class SqlQueryController implements SqlQueryApi, ResourceHolder {
private CompletableFuture<Collection<SqlQueryInfo>> sqlQueryInfos(String query) {
Statement sqlQueryStmt = igniteSql.createStatement(query);
- return igniteSql.executeAsync(null, sqlQueryStmt)
+ return igniteSql.executeAsync((Transaction) null, sqlQueryStmt)
.thenCompose(resultSet -> iterate(resultSet, new ArrayList<>()));
}
diff --git a/modules/rest/src/main/java/org/apache/ignite/internal/rest/transaction/TransactionController.java b/modules/rest/src/main/java/org/apache/ignite/internal/rest/transaction/TransactionController.java
index b200e00aa1e..70ba4ed8f4f 100644
--- a/modules/rest/src/main/java/org/apache/ignite/internal/rest/transaction/TransactionController.java
+++ b/modules/rest/src/main/java/org/apache/ignite/internal/rest/transaction/TransactionController.java
@@ -40,6 +40,7 @@ import org.apache.ignite.sql.IgniteSql;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.Statement;
import org.apache.ignite.sql.async.AsyncResultSet;
+import org.apache.ignite.tx.Transaction;
import org.jetbrains.annotations.Nullable;
/**
@@ -111,7 +112,7 @@ public class TransactionController implements TransactionApi, ResourceHolder {
private CompletableFuture<Collection<TransactionInfo>> transactionInfos(String query) {
Statement transactionStmt = igniteSql.createStatement(query);
- return igniteSql.executeAsync(null, transactionStmt)
+ return igniteSql.executeAsync((Transaction) null, transactionStmt)
.thenCompose(resultSet -> iterate(resultSet, new ArrayList<>()));
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/app/AsyncApiOperation.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/app/AsyncApiOperation.java
index baeaa161ed3..0fdbacf296a 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/app/AsyncApiOperation.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/app/AsyncApiOperation.java
@@ -41,6 +41,7 @@ import org.apache.ignite.internal.table.partition.HashPartition;
import org.apache.ignite.sql.BatchedArguments;
import org.apache.ignite.table.Tuple;
import org.apache.ignite.table.mapper.Mapper;
+import org.apache.ignite.tx.Transaction;
/**
* Asynchronous API operation.
@@ -60,12 +61,12 @@ enum AsyncApiOperation {
KV_VIEW_GET_AND_PUT(refs -> refs.kvView.getAndPutAsync(null, KEY_TUPLE, VALUE_TUPLE)),
KV_VIEW_GET_NULLABLE_AND_PUT(refs -> refs.kvView.getNullableAndPutAsync(null, KEY_TUPLE, VALUE_TUPLE)),
KV_VIEW_PUT_IF_ABSENT(refs -> refs.kvView.putIfAbsentAsync(null, KEY_TUPLE, VALUE_TUPLE)),
- KV_VIEW_REMOVE(refs -> refs.kvView.removeAsync(null, KEY_TUPLE)),
+ KV_VIEW_REMOVE(refs -> refs.kvView.removeAsync(KEY_TUPLE)),
KV_VIEW_REMOVE_EXACT(refs -> refs.kvView.removeAsync(null, KEY_TUPLE, VALUE_TUPLE)),
KV_VIEW_REMOVE_ALL(refs -> refs.kvView.removeAllAsync(null, List.of(KEY_TUPLE))),
KV_VIEW_GET_AND_REMOVE(refs -> refs.kvView.getAndRemoveAsync(null, KEY_TUPLE)),
KV_VIEW_GET_NULLABLE_AND_REMOVE(refs -> refs.kvView.getNullableAndRemoveAsync(null, KEY_TUPLE)),
- KV_VIEW_REPLACE(refs -> refs.kvView.replaceAsync(null, KEY_TUPLE, VALUE_TUPLE)),
+ KV_VIEW_REPLACE(refs -> refs.kvView.replaceAsync(KEY_TUPLE, VALUE_TUPLE)),
KV_VIEW_REPLACE_EXACT(refs -> refs.kvView.replaceAsync(null, KEY_TUPLE, VALUE_TUPLE, VALUE_TUPLE)),
KV_VIEW_GET_AND_REPLACE(refs -> refs.kvView.getAndReplaceAsync(null, KEY_TUPLE, VALUE_TUPLE)),
KV_VIEW_GET_NULLABLE_AND_REPLACE(refs -> refs.kvView.getNullableAndReplaceAsync(null, KEY_TUPLE, VALUE_TUPLE)),
@@ -137,8 +138,8 @@ enum AsyncApiOperation {
TRANSACTIONS_RUN_IN_TRANSACTION(refs -> refs.transactions.runInTransactionAsync(tx -> nullCompletedFuture())),
TRANSACTIONS_RUN_IN_TRANSACTION_WITH_OPTS(refs -> refs.transactions.runInTransactionAsync(tx -> nullCompletedFuture(), null)),
- SQL_EXECUTE(refs -> refs.sql.executeAsync(null, SELECT_IDS_QUERY)),
- SQL_EXECUTE_STATEMENT(refs -> refs.sql.executeAsync(null, refs.selectIdsStatement)),
+ SQL_EXECUTE(refs -> refs.sql.executeAsync(SELECT_IDS_QUERY)),
+ SQL_EXECUTE_STATEMENT(refs -> refs.sql.executeAsync((Transaction) null, refs.selectIdsStatement)),
// TODO: IGNITE-18695 - uncomment the following 2 lines.
// SQL_EXECUTE_WITH_MAPPER(refs -> refs.sql.executeAsync(null, Mapper.of(Integer.class), SELECT_IDS_QUERY)),
// SQL_EXECUTE_STATEMENT_WITH_MAPPER(refs -> refs.sql.executeAsync(null, Mapper.of(Integer.class), refs.selectIdsStatement)),
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/app/SyncApiOperation.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/app/SyncApiOperation.java
index 61d0101bdc3..534340576e8 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/app/SyncApiOperation.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/app/SyncApiOperation.java
@@ -36,6 +36,7 @@ import org.apache.ignite.compute.TaskDescriptor;
import org.apache.ignite.internal.table.partition.HashPartition;
import org.apache.ignite.sql.BatchedArguments;
import org.apache.ignite.table.mapper.Mapper;
+import org.apache.ignite.tx.Transaction;
/**
* Synchronous API operation.
@@ -140,8 +141,8 @@ enum SyncApiOperation {
SQL_CREATE_STATEMENT(refs -> refs.sql.createStatement(SELECT_IDS_QUERY)),
SQL_STATEMENT_BUILDER(refs -> refs.sql.statementBuilder()),
- SQL_EXECUTE(refs -> refs.sql.execute(null, SELECT_IDS_QUERY)),
- SQL_EXECUTE_STATEMENT(refs -> refs.sql.execute(null, refs.selectIdsStatement)),
+ SQL_EXECUTE(refs -> refs.sql.execute(SELECT_IDS_QUERY)),
+ SQL_EXECUTE_STATEMENT(refs -> refs.sql.execute((Transaction) null, refs.selectIdsStatement)),
// TODO: IGNITE-18695 - uncomment the following 2 lines.
// SQL_EXECUTE_WITH_MAPPER(refs -> refs.sql.execute(null, Mapper.of(Integer.class), SELECT_IDS_QUERY)),
// SQL_EXECUTE_STATEMENT_WITH_MAPPER(refs -> refs.sql.execute(null, Mapper.of(Integer.class), refs.selectIdsStatement)),
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/AbstractMultiNodeBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/AbstractMultiNodeBenchmark.java
index eee8e28be48..8e8234e444e 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/AbstractMultiNodeBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/AbstractMultiNodeBenchmark.java
@@ -111,7 +111,7 @@ public class AbstractMultiNodeBenchmark {
var createZoneStatement = "CREATE ZONE IF NOT EXISTS " + ZONE_NAME + " (partitions " + partitionCount()
+ ", replicas " + replicaCount() + ") storage profiles ['" + DEFAULT_STORAGE_PROFILE + "']";
- try (ResultSet<SqlRow> rs = publicIgnite.sql().execute(null, createZoneStatement)) {
+ try (ResultSet<SqlRow> rs = publicIgnite.sql().execute(createZoneStatement)) {
// No-op.
}
}
@@ -152,7 +152,7 @@ public class AbstractMultiNodeBenchmark {
createTableStatement += "\nZONE " + ZONE_NAME;
- try (ResultSet<SqlRow> rs = publicIgnite.sql().execute(null, createTableStatement)) {
+ try (ResultSet<SqlRow> rs = publicIgnite.sql().execute(createTableStatement)) {
// No-op.
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/BulkDeleteBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/BulkDeleteBenchmark.java
index f956ba19cee..c941d1cfa3f 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/BulkDeleteBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/BulkDeleteBenchmark.java
@@ -40,6 +40,7 @@ import org.apache.ignite.sql.ResultSet;
import org.apache.ignite.sql.Statement;
import org.apache.ignite.table.KeyValueView;
import org.apache.ignite.table.Tuple;
+import org.apache.ignite.tx.Transaction;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
@@ -199,13 +200,13 @@ public class BulkDeleteBenchmark extends AbstractMultiNodeBenchmark {
}
void executeQuery(int key) {
- try (ResultSet<?> rs = sql.execute(null, statement, key)) {
+ try (ResultSet<?> rs = sql.execute((Transaction) null, statement, key)) {
// NO-OP
}
}
void executeInlinedQuery(int key) {
- try (ResultSet<?> rs = sql.execute(null, createDeleteStatement(key))) {
+ try (ResultSet<?> rs = sql.execute(createDeleteStatement(key))) {
// NO-OP
}
}
@@ -247,7 +248,7 @@ public class BulkDeleteBenchmark extends AbstractMultiNodeBenchmark {
}
void executeQuery(int key) {
- sql.execute(null, statement, key);
+ sql.execute((Transaction) null, statement, key);
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/InsertBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/InsertBenchmark.java
index 80cd5fab316..f745648b8b7 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/InsertBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/InsertBenchmark.java
@@ -33,6 +33,7 @@ import org.apache.ignite.sql.ResultSet;
import org.apache.ignite.sql.Statement;
import org.apache.ignite.table.KeyValueView;
import org.apache.ignite.table.Tuple;
+import org.apache.ignite.tx.Transaction;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
@@ -178,13 +179,13 @@ public class InsertBenchmark extends AbstractMultiNodeBenchmark {
private int id = 0;
void executeQuery() {
- try (ResultSet<?> rs = sql.execute(null, statement, id++)) {
+ try (ResultSet<?> rs = sql.execute((Transaction) null, statement, id++)) {
// NO-OP
}
}
void executeInlinedQuery() {
- try (ResultSet<?> rs = sql.execute(null, createInsertStatement(id++))) {
+ try (ResultSet<?> rs = sql.execute(createInsertStatement(id++))) {
// NO-OP
}
}
@@ -218,7 +219,7 @@ public class InsertBenchmark extends AbstractMultiNodeBenchmark {
private int id = 0;
void executeQuery() {
- try (ResultSet<?> rs = sql.execute(null, statement, id + 1, id + 2);) {
+ try (ResultSet<?> rs = sql.execute((Transaction) null, statement, id + 1, id + 2);) {
id += 2;
}
}
@@ -262,7 +263,7 @@ public class InsertBenchmark extends AbstractMultiNodeBenchmark {
private int id = 0;
void executeQuery() {
- sql.execute(null, statement, id++);
+ sql.execute((Transaction) null, statement, id++);
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/LargeBinaryBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/LargeBinaryBenchmark.java
index 936a8d43001..e2ac0d22a0f 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/LargeBinaryBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/LargeBinaryBenchmark.java
@@ -80,7 +80,7 @@ public class LargeBinaryBenchmark extends AbstractMultiNodeBenchmark {
sql = publicIgnite.sql();
String stmt = format("CREATE TABLE t (id INT PRIMARY KEY, val VARBINARY({}))", Integer.MAX_VALUE);
- try (ResultSet<SqlRow> rs = sql.execute(null, stmt)) {
+ try (ResultSet<SqlRow> rs = sql.execute(stmt)) {
assertTrue(rs.wasApplied());
}
@@ -135,7 +135,7 @@ public class LargeBinaryBenchmark extends AbstractMultiNodeBenchmark {
public void sqlRwRoWriter(SharedState sharedState, Blackhole bh) {
int id = sharedState.id.incrementAndGet();
- try (ResultSet<SqlRow> rs = sql.execute(null, "INSERT INTO t VALUES(?, ?)", id, localBytes)) {
+ try (ResultSet<SqlRow> rs = sql.execute("INSERT INTO t VALUES(?, ?)", id, localBytes)) {
bh.consume(rs);
}
}
@@ -148,7 +148,7 @@ public class LargeBinaryBenchmark extends AbstractMultiNodeBenchmark {
public void sqlRwRoReader(SharedState sharedState, Blackhole bh) {
int id = ThreadLocalRandom.current().nextInt(sharedState.id.get() + 1);
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT val FROM t WHERE id=?", id)) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT val FROM t WHERE id=?", id)) {
bh.consume(rs.hasNext());
}
}
@@ -160,7 +160,7 @@ public class LargeBinaryBenchmark extends AbstractMultiNodeBenchmark {
public void sqlRwOnly(SharedState sharedState, Blackhole bh) {
int id = sharedState.id.incrementAndGet();
- try (ResultSet<SqlRow> rs = sql.execute(null, "INSERT INTO t VALUES(?, ?)", id, localBytes)) {
+ try (ResultSet<SqlRow> rs = sql.execute("INSERT INTO t VALUES(?, ?)", id, localBytes)) {
bh.consume(rs);
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/LargeStringBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/LargeStringBenchmark.java
index 331ff2d65c9..255f1a687a5 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/LargeStringBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/LargeStringBenchmark.java
@@ -82,7 +82,7 @@ public class LargeStringBenchmark extends AbstractMultiNodeBenchmark {
sql = publicIgnite.sql();
String stmt = format("CREATE TABLE t (id INT PRIMARY KEY, val VARCHAR({}))", Integer.MAX_VALUE);
- try (ResultSet<SqlRow> rs = sql.execute(null, stmt)) {
+ try (ResultSet<SqlRow> rs = sql.execute(stmt)) {
assertTrue(rs.wasApplied());
}
@@ -136,7 +136,7 @@ public class LargeStringBenchmark extends AbstractMultiNodeBenchmark {
public void sqlRwRoWriter(SharedState sharedState, Blackhole bh) {
int id = sharedState.id.incrementAndGet();
- try (ResultSet<SqlRow> rs = sql.execute(null, "INSERT INTO t VALUES(?, ?)", id, localString)) {
+ try (ResultSet<SqlRow> rs = sql.execute("INSERT INTO t VALUES(?, ?)", id, localString)) {
bh.consume(rs);
}
}
@@ -149,7 +149,7 @@ public class LargeStringBenchmark extends AbstractMultiNodeBenchmark {
public void sqlRwRoReader(SharedState sharedState, Blackhole bh) {
int id = ThreadLocalRandom.current().nextInt(sharedState.id.get() + 1);
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT val FROM t WHERE id=?", id)) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT val FROM t WHERE id=?", id)) {
bh.consume(rs.hasNext());
}
}
@@ -161,7 +161,7 @@ public class LargeStringBenchmark extends AbstractMultiNodeBenchmark {
public void sqlRwOnly(SharedState sharedState, Blackhole bh) {
int id = sharedState.id.incrementAndGet();
- try (ResultSet<SqlRow> rs = sql.execute(null, "INSERT INTO t VALUES(?, ?)", id, localString)) {
+ try (ResultSet<SqlRow> rs = sql.execute("INSERT INTO t VALUES(?, ?)", id, localString)) {
bh.consume(rs);
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlBenchmark.java
index 5b0ad9dd551..b835d9b1650 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlBenchmark.java
@@ -68,7 +68,7 @@ public class SqlBenchmark extends AbstractMultiNodeBenchmark {
/** Benchmark that measures performance of `SELECT count(*)` query over entire table. */
@Benchmark
public void countAll(Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT count(*) FROM usertable")) {
+ try (var rs = sql.execute("SELECT count(*) FROM usertable")) {
bh.consume(rs.next());
}
}
@@ -76,7 +76,7 @@ public class SqlBenchmark extends AbstractMultiNodeBenchmark {
/** Benchmark that measures performance of `SELECT count(1)` query over entire table. */
@Benchmark
public void count1(Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT count(1) FROM usertable")) {
+ try (var rs = sql.execute("SELECT count(1) FROM usertable")) {
bh.consume(rs.next());
}
}
@@ -84,7 +84,7 @@ public class SqlBenchmark extends AbstractMultiNodeBenchmark {
/** Benchmark that measures performance of `SELECT count(key)` query over entire table. */
@Benchmark
public void countKey(Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT count(ycsb_key) FROM usertable")) {
+ try (var rs = sql.execute("SELECT count(ycsb_key) FROM usertable")) {
bh.consume(rs.next());
}
}
@@ -92,7 +92,7 @@ public class SqlBenchmark extends AbstractMultiNodeBenchmark {
/** Benchmark that measures performance of `SELECT count(val)` query over entire table. */
@Benchmark
public void countVal(Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT count(field2) FROM usertable")) {
+ try (var rs = sql.execute("SELECT count(field2) FROM usertable")) {
bh.consume(rs.next());
}
}
@@ -100,7 +100,7 @@ public class SqlBenchmark extends AbstractMultiNodeBenchmark {
/** Benchmark that measures performance of `SELECT *` query over entire table. */
@Benchmark
public void selectAll(Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT * FROM usertable")) {
+ try (var rs = sql.execute("SELECT * FROM usertable")) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
@@ -113,7 +113,7 @@ public class SqlBenchmark extends AbstractMultiNodeBenchmark {
@Benchmark
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void selectAllFromSystemRange(Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT * FROM TABLE(system_range(0, 1))")) {
+ try (var rs = sql.execute("SELECT * FROM TABLE(system_range(0, 1))")) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlIndexScanBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlIndexScanBenchmark.java
index ed0de1e1d60..81d63cf6ccc 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlIndexScanBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlIndexScanBenchmark.java
@@ -120,7 +120,7 @@ public class SqlIndexScanBenchmark extends AbstractMultiNodeBenchmark {
/** Measures performance of scan over a table. */
@Benchmark
public void forceTableScan(ForceTableScanState state, Blackhole bh) {
- try (var rs = sql.execute(null, state.query, startDate, limit)) {
+ try (var rs = sql.execute(state.query, startDate, limit)) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
@@ -130,7 +130,7 @@ public class SqlIndexScanBenchmark extends AbstractMultiNodeBenchmark {
/** Measures performance of scan over an index. */
@Benchmark
public void forceIndexScan(ForceIndexScanState state, Blackhole bh) {
- try (var rs = sql.execute(null, state.query, startDate, limit)) {
+ try (var rs = sql.execute(state.query, startDate, limit)) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
@@ -140,7 +140,7 @@ public class SqlIndexScanBenchmark extends AbstractMultiNodeBenchmark {
/** Measures performance of an optimizer's decision about what to use for particular query. */
@Benchmark
public void optimizatorChoiceScan(OptimizatorChoiceState state, Blackhole bh) {
- try (var rs = sql.execute(null, state.query, startDate, limit)) {
+ try (var rs = sql.execute(state.query, startDate, limit)) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlJoinBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlJoinBenchmark.java
index 2a10648291c..e55ce0485af 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlJoinBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlJoinBenchmark.java
@@ -72,8 +72,8 @@ public class SqlJoinBenchmark extends AbstractMultiNodeBenchmark {
*/
@Benchmark
public void leftHashJoin(Blackhole bh) {
- try (var rs = sql.execute(null, ""
- + "SELECT /*+ DISABLE_RULE('NestedLoopJoinConverter', 'MergeJoinConverter', 'CorrelatedNestedLoopJoin') */ t1.field1 "
+ try (var rs = sql.execute(
+ "SELECT /*+ DISABLE_RULE('NestedLoopJoinConverter', 'MergeJoinConverter', 'CorrelatedNestedLoopJoin') */ t1.field1 "
+ "FROM usertable t1 "
+ "LEFT JOIN usertable t2 "
+ "on t1.field2 = t2.field2")) {
@@ -88,8 +88,8 @@ public class SqlJoinBenchmark extends AbstractMultiNodeBenchmark {
*/
@Benchmark
public void leftMergeJoin(Blackhole bh) {
- try (var rs = sql.execute(null, ""
- + "SELECT /*+ DISABLE_RULE('HashJoinConverter', 'NestedLoopJoinConverter', 'CorrelatedNestedLoopJoin') */ t1.field1 "
+ try (var rs = sql.execute(
+ "SELECT /*+ DISABLE_RULE('HashJoinConverter', 'NestedLoopJoinConverter', 'CorrelatedNestedLoopJoin') */ t1.field1 "
+ "FROM usertable t1 "
+ "LEFT JOIN usertable t2 "
+ "on t1.field2 = t2.field2")) {
@@ -104,8 +104,8 @@ public class SqlJoinBenchmark extends AbstractMultiNodeBenchmark {
*/
@Benchmark
public void leftNestedJoin(Blackhole bh) {
- try (var rs = sql.execute(null, ""
- + "SELECT /*+ DISABLE_RULE('HashJoinConverter', 'MergeJoinConverter', 'CorrelatedNestedLoopJoin') */ t1.field1 "
+ try (var rs = sql.execute(
+ "SELECT /*+ DISABLE_RULE('HashJoinConverter', 'MergeJoinConverter', 'CorrelatedNestedLoopJoin') */ t1.field1 "
+ "FROM usertable t1 "
+ "LEFT JOIN usertable t2 "
+ "on t1.field2 = t2.field2")) {
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlPartitionPruningBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlPartitionPruningBenchmark.java
index d2f30b815aa..a1136e96017 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlPartitionPruningBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlPartitionPruningBenchmark.java
@@ -107,7 +107,7 @@ public class SqlPartitionPruningBenchmark extends AbstractMultiNodeBenchmark {
KeyValueView<Tuple, Tuple> keyValueView = publicIgnite.tables().table(tableName).keyValueView();
String query = format("CREATE INDEX {}_sorted_idx ON {} USING SORTED (key1, key2)", tableName, tableName);
- try (var rs = publicIgnite.sql().execute(null, query)) {
+ try (var rs = publicIgnite.sql().execute(query)) {
while (rs.hasNext()) {
rs.next();
}
@@ -134,7 +134,7 @@ public class SqlPartitionPruningBenchmark extends AbstractMultiNodeBenchmark {
ThreadLocalRandom random = ThreadLocalRandom.current();
int key = random.nextInt(TABLE_SIZE);
- try (var rs = sql.execute(null, "SELECT * FROM usertable2 WHERE key1=? and key2=?", key, key)) {
+ try (var rs = sql.execute("SELECT * FROM usertable2 WHERE key1=? and key2=?", key, key)) {
expectSingleRecord(rs, bh);
}
}
@@ -145,7 +145,7 @@ public class SqlPartitionPruningBenchmark extends AbstractMultiNodeBenchmark {
ThreadLocalRandom random = ThreadLocalRandom.current();
int key = random.nextInt(TABLE_SIZE);
- try (var rs = sql.execute(null, "SELECT * FROM usertable2 WHERE key1=?", key)) {
+ try (var rs = sql.execute("SELECT * FROM usertable2 WHERE key1=?", key)) {
expectSingleRecord(rs, bh);
}
}
@@ -156,7 +156,7 @@ public class SqlPartitionPruningBenchmark extends AbstractMultiNodeBenchmark {
ThreadLocalRandom random = ThreadLocalRandom.current();
int key = random.nextInt(TABLE_SIZE);
- try (var rs = sql.execute(null, "SELECT * FROM usertable2 WHERE key1 >= ? and key1 < ?", key, key + 1)) {
+ try (var rs = sql.execute("SELECT * FROM usertable2 WHERE key1 >= ? and key1 < ?", key, key + 1)) {
expectSingleRecord(rs, bh);
}
}
@@ -170,7 +170,7 @@ public class SqlPartitionPruningBenchmark extends AbstractMultiNodeBenchmark {
String query = "SELECT * FROM usertable2 as cor WHERE EXISTS "
+ "(SELECT 1 FROM usertable3 WHERE usertable3.key1 = cor.key1) AND key1=?";
- try (var rs = sql.execute(null, query, key)) {
+ try (var rs = sql.execute(query, key)) {
expectSingleRecord(rs, bh);
}
}
@@ -184,7 +184,7 @@ public class SqlPartitionPruningBenchmark extends AbstractMultiNodeBenchmark {
String query = "SELECT * FROM usertable2 as cor WHERE EXISTS "
+ "(SELECT 1 FROM usertable3 WHERE usertable3.key1 >= cor.key1 AND usertable3.key1 < cor.key1 + 1) AND key1=?";
- try (var rs = sql.execute(null, query, key)) {
+ try (var rs = sql.execute(query, key)) {
expectSingleRecord(rs, bh);
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlSelectAllBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlSelectAllBenchmark.java
index d1a4262fef0..a5ca927f569 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlSelectAllBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlSelectAllBenchmark.java
@@ -81,7 +81,7 @@ public class SqlSelectAllBenchmark extends AbstractTpcBenchmark {
/** Benchmark that measures performance of queries from TPC-H suite. */
@Benchmark
public void run(Blackhole bh) {
- try (var rs = sql.execute(null, projection.query())) {
+ try (var rs = sql.execute(projection.query())) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SystemViewsBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SystemViewsBenchmark.java
index d2ea9ef91a2..7a0693d0f00 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SystemViewsBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SystemViewsBenchmark.java
@@ -66,7 +66,7 @@ public class SystemViewsBenchmark extends AbstractMultiNodeBenchmark {
@Benchmark
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void getPrimaryKeys(FiveHundredTablesState state, Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT column_name\n"
+ try (var rs = sql.execute("SELECT column_name\n"
+ "FROM SYSTEM.table_columns\n"
+ "WHERE table_name = ?\n"
+ "AND pk_column_ordinal IS NOT NULL;", state.tableName())) {
@@ -80,7 +80,7 @@ public class SystemViewsBenchmark extends AbstractMultiNodeBenchmark {
@Benchmark
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void getColumnsType(FiveHundredTablesState state, Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT column_name,column_type\n"
+ try (var rs = sql.execute("SELECT column_name,column_type\n"
+ "FROM SYSTEM.table_columns\n"
+ "WHERE table_name = ?;", state.tableName())) {
while (rs.hasNext()) {
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TpcdsBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TpcdsBenchmark.java
index 5a0562a52fa..de9805847bb 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TpcdsBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TpcdsBenchmark.java
@@ -92,7 +92,7 @@ public class TpcdsBenchmark extends AbstractTpcBenchmark {
/** Benchmark that measures performance of queries from TPC-DS suite. */
@Benchmark
public void run(Blackhole bh) {
- try (var rs = sql.execute(null, queryString)) {
+ try (var rs = sql.execute(queryString)) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TpchBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TpchBenchmark.java
index 81706f940f6..254e0d985a5 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TpchBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TpchBenchmark.java
@@ -98,7 +98,7 @@ public class TpchBenchmark extends AbstractTpcBenchmark {
/** Benchmark that measures performance of queries from TPC-H suite. */
@Benchmark
public void run(Blackhole bh) {
- try (var rs = sql.execute(null, queryString)) {
+ try (var rs = sql.execute(queryString)) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/UpgradeRowBenchmark.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/UpgradeRowBenchmark.java
index 6b86b0dafae..4ccff26c0d4 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/UpgradeRowBenchmark.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/UpgradeRowBenchmark.java
@@ -68,7 +68,7 @@ public class UpgradeRowBenchmark extends AbstractMultiNodeBenchmark {
sql = publicIgnite.sql();
- try (ResultSet<SqlRow> rs = sql.execute(null, format("ALTER TABLE {} ADD COLUMN new_col INT DEFAULT 42", TABLE_NAME));) {
+ try (ResultSet<SqlRow> rs = sql.execute(format("ALTER TABLE {} ADD COLUMN new_col INT DEFAULT 42", TABLE_NAME));) {
while (rs.hasNext()) {
rs.next();
}
@@ -78,7 +78,7 @@ public class UpgradeRowBenchmark extends AbstractMultiNodeBenchmark {
/** Benchmark that measures performance of `SELECT *` query over entire table. */
@Benchmark
public void selectAll(Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT * FROM usertable")) {
+ try (var rs = sql.execute("SELECT * FROM usertable")) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
@@ -88,7 +88,7 @@ public class UpgradeRowBenchmark extends AbstractMultiNodeBenchmark {
/** Benchmark that measures performance of `SELECT` query with projection over entire table. */
@Benchmark
public void selectAllProjected(Blackhole bh) {
- try (var rs = sql.execute(null, "SELECT field1, field2, field3 FROM usertable")) {
+ try (var rs = sql.execute("SELECT field1, field2, field3 FROM usertable")) {
while (rs.hasNext()) {
bh.consume(rs.next());
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/client/ItClientObservableTimeTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/client/ItClientObservableTimeTest.java
index 760ce9420a2..598d4235fc2 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/client/ItClientObservableTimeTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/client/ItClientObservableTimeTest.java
@@ -51,10 +51,10 @@ public class ItClientObservableTimeTest extends ClusterPerClassIntegrationTest {
try (
IgniteClient client1 = newClient();
IgniteClient client2 = newClient();
- ResultSet<?> ignored = client1.sql().execute(null, "CREATE TABLE my_table (id INT PRIMARY KEY, val INT)")
+ ResultSet<?> ignored = client1.sql().execute("CREATE TABLE my_table (id INT PRIMARY KEY, val INT)")
) {
// Should not throw
- try (ResultSet<?> rs = client2.sql().execute(null, "SELECT * FROM my_table")) {
+ try (ResultSet<?> rs = client2.sql().execute("SELECT * FROM my_table")) {
while (rs.hasNext()) {
rs.next();
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItDuplicateNodeNamesTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItDuplicateNodeNamesTest.java
index 3fc43a55f0f..141ddf8b51f 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItDuplicateNodeNamesTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItDuplicateNodeNamesTest.java
@@ -144,8 +144,8 @@ class ItDuplicateNodeNamesTest extends BaseIgniteAbstractTest {
// And the cluster is operational
- metaStorageAndCmgNode.api().sql().execute(null, "CREATE TABLE TEST (id INT PRIMARY KEY, val VARCHAR)");
- metaStorageAndCmgNode.api().sql().execute(null, "INSERT INTO TEST VALUES (1, 'foo')");
+ metaStorageAndCmgNode.api().sql().execute("CREATE TABLE TEST (id INT PRIMARY KEY, val VARCHAR)");
+ metaStorageAndCmgNode.api().sql().execute("INSERT INTO TEST VALUES (1, 'foo')");
KeyValueView<Integer, String> kvView = secondNode.api().tables().table("TEST").keyValueView(Integer.class, String.class);
assertThat(kvView.get(null, 1), is("foo"));
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/inmemory/ItRaftStorageVolatilityTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/inmemory/ItRaftStorageVolatilityTest.java
index 7f488ab6b42..7183753e4cc 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/inmemory/ItRaftStorageVolatilityTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/inmemory/ItRaftStorageVolatilityTest.java
@@ -262,11 +262,10 @@ class ItRaftStorageVolatilityTest extends ClusterPerTestIntegrationTest {
cluster.doInSession(0, session -> {
session.execute(
- null,
"create zone zone1 (partitions 1, replicas 1) "
+ "storage profiles ['" + DEFAULT_AIMEM_PROFILE_NAME + "']"
);
- session.execute(null, "create table " + tableName
+ session.execute("create table " + tableName
+ " (id int primary key, name varchar) zone ZONE1 storage profile '"
+ DEFAULT_AIMEM_PROFILE_NAME + "'");
});
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItAddNodeTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItAddNodeTest.java
index 962bb9ea1a6..a052a5892be 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItAddNodeTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItAddNodeTest.java
@@ -44,7 +44,7 @@ public class ItAddNodeTest extends ClusterPerTestIntegrationTest {
Ignite ignite0 = cluster.node(0);
- try (ResultSet<SqlRow> unused = ignite0.sql().execute(null, "CREATE TABLE TEST_TABLE (\n"
+ try (ResultSet<SqlRow> unused = ignite0.sql().execute("CREATE TABLE TEST_TABLE (\n"
+ " key int PRIMARY KEY,\n"
+ " field1 int\n"
+ ")"
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItDataSchemaSyncTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItDataSchemaSyncTest.java
index 50fc267e593..0642e2206ef 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItDataSchemaSyncTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItDataSchemaSyncTest.java
@@ -166,7 +166,7 @@ public class ItDataSchemaSyncTest extends ClusterPerTestIntegrationTest {
IgniteSql sql = ignite1.sql();
- ResultSet<SqlRow> res = sql.execute(null, "SELECT valint2 FROM tbl1");
+ ResultSet<SqlRow> res = sql.execute("SELECT valint2 FROM tbl1");
for (int i = 0; i < 10; ++i) {
assertNotNull(res.next().iterator().next());
@@ -182,7 +182,7 @@ public class ItDataSchemaSyncTest extends ClusterPerTestIntegrationTest {
res.close();
- res = sql.execute(null, "SELECT sum(valint4) FROM tbl1");
+ res = sql.execute("SELECT sum(valint4) FROM tbl1");
assertEquals(10L * (10 + 19) / 2, res.next().iterator().next());
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteInMemoryNodeRestartTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteInMemoryNodeRestartTest.java
index ef71776e9b2..3733a3369d8 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteInMemoryNodeRestartTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteInMemoryNodeRestartTest.java
@@ -278,15 +278,14 @@ public class ItIgniteInMemoryNodeRestartTest extends BaseIgniteRestartTest {
private static void createTableWithData(Ignite ignite, String name, int replicas, int partitions) throws InterruptedException {
IgniteSql sql = ignite.sql();
- sql.execute(null, String.format("CREATE ZONE IF NOT EXISTS ZONE_%s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
+ sql.execute(String.format("CREATE ZONE IF NOT EXISTS ZONE_%s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
name, replicas, partitions, DEFAULT_AIMEM_PROFILE_NAME));
- sql.execute(null, "CREATE TABLE " + name
+ sql.execute("CREATE TABLE " + name
+ " (id INT PRIMARY KEY, name VARCHAR)"
+ " ZONE ZONE_" + name.toUpperCase() + ";");
for (int i = 0; i < 100; i++) {
- sql.execute(null, "INSERT INTO " + name + "(id, name) VALUES (?, ?)",
- i, VALUE_PRODUCER.apply(i));
+ sql.execute("INSERT INTO " + name + "(id, name) VALUES (?, ?)", i, VALUE_PRODUCER.apply(i));
}
TableViewInternal table = unwrapTableViewInternal(ignite.tables().table(name));
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
index 058063d1a32..729742a9dfd 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
@@ -994,17 +994,17 @@ public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
createTableWithData(List.of(ignite1), TABLE_NAME, 2, 1);
- sql1.execute(null, "CREATE INDEX idx1 ON " + TABLE_NAME + "(id)");
+ sql1.execute("CREATE INDEX idx1 ON " + TABLE_NAME + "(id)");
- ResultSet<SqlRow> plan = sql1.execute(null, "EXPLAIN PLAN FOR " + sql);
+ ResultSet<SqlRow> plan = sql1.execute("EXPLAIN PLAN FOR " + sql);
String planStr = plan.next().stringValue(0);
assertTrue(planStr.contains("IndexScan"));
- ResultSet<SqlRow> res1 = sql1.execute(null, sql);
+ ResultSet<SqlRow> res1 = sql1.execute(sql);
- ResultSet<SqlRow> res2 = sql2.execute(null, sql);
+ ResultSet<SqlRow> res2 = sql2.execute(sql);
intRes = res1.next().intValue(0);
@@ -1020,7 +1020,7 @@ public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
sql1 = ignite1.sql();
- ResultSet<SqlRow> res3 = sql1.execute(null, sql);
+ ResultSet<SqlRow> res3 = sql1.execute(sql);
assertEquals(intRes, res3.next().intValue(0));
}
@@ -1239,7 +1239,7 @@ public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
// Add more data, so that on restart there will be a index rebuilding operation.
for (int i = 0; i < 100; i++) {
- ignite.sql().execute(null, "INSERT INTO " + TABLE_NAME + "(id, name) VALUES (?, ?)",
+ ignite.sql().execute("INSERT INTO " + TABLE_NAME + "(id, name) VALUES (?, ?)",
i + 500, VALUE_PRODUCER.apply(i + 500));
}
@@ -1716,10 +1716,10 @@ public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
IgniteSql sql = node.sql();
- sql.execute(null, String.format("CREATE ZONE IF NOT EXISTS %s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
+ sql.execute(String.format("CREATE ZONE IF NOT EXISTS %s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
zoneName, nodesCount, 1, DEFAULT_STORAGE_PROFILE));
- sql.execute(null, "CREATE TABLE " + TABLE_NAME + "(id INT PRIMARY KEY, name VARCHAR) ZONE " + zoneName + ";");
+ sql.execute("CREATE TABLE " + TABLE_NAME + "(id INT PRIMARY KEY, name VARCHAR) ZONE " + zoneName + ";");
assertEquals(TABLE_ID, tableId(node, TABLE_NAME));
@@ -1820,15 +1820,14 @@ public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
// Create table, all nodes are lagging.
IgniteSql sql = node0.sql();
- sql.execute(null, String.format("CREATE ZONE IF NOT EXISTS %s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
+ sql.execute(String.format("CREATE ZONE IF NOT EXISTS %s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
zoneName, 2, 1, DEFAULT_STORAGE_PROFILE));
nodeInhibitor0.startInhibit();
nodeInhibitor1.startInhibit();
nodeInhibitor2.startInhibit();
- sql.executeAsync(null, "CREATE TABLE " + tableName
- + "(id INT PRIMARY KEY, name VARCHAR) ZONE " + zoneName + ";");
+ sql.executeAsync("CREATE TABLE " + tableName + "(id INT PRIMARY KEY, name VARCHAR) ZONE " + zoneName + ";");
// Stopping 2 of 3 nodes.
node1.stop();
@@ -1887,8 +1886,7 @@ public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
String tableName = "TEST";
String zoneName = "ZONE_TEST";
- node0.sql().execute(null,
- String.format("CREATE ZONE IF NOT EXISTS %s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
+ node0.sql().execute(String.format("CREATE ZONE IF NOT EXISTS %s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
zoneName, 2, 1, DEFAULT_STORAGE_PROFILE));
int catalogVersionBeforeTable = node0.catalogManager().latestCatalogVersion();
@@ -2141,14 +2139,13 @@ public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
private void createTableWithData(List<IgniteImpl> nodes, String name, int replicas, int partitions) {
IgniteSql sql = nodes.get(0).sql();
- sql.execute(null,
- String.format("CREATE ZONE IF NOT EXISTS ZONE_%s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
+ sql.execute(String.format("CREATE ZONE IF NOT EXISTS ZONE_%s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
name, replicas, partitions, DEFAULT_STORAGE_PROFILE));
- sql.execute(null, "CREATE TABLE IF NOT EXISTS " + name
+ sql.execute("CREATE TABLE IF NOT EXISTS " + name
+ "(id INT PRIMARY KEY, name VARCHAR) ZONE ZONE_" + name + ";");
for (int i = 0; i < 100; i++) {
- sql.execute(null, "INSERT INTO " + name + "(id, name) VALUES (?, ?)",
+ sql.execute("INSERT INTO " + name + "(id, name) VALUES (?, ?)",
i, VALUE_PRODUCER.apply(i));
}
}
@@ -2164,10 +2161,9 @@ public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
private static Table createTableWithoutData(Ignite ignite, String name, int replicas, int partitions) {
IgniteSql sql = ignite.sql();
- sql.execute(null,
- String.format("CREATE ZONE IF NOT EXISTS ZONE_%s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
+ sql.execute(String.format("CREATE ZONE IF NOT EXISTS ZONE_%s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
name, replicas, partitions, DEFAULT_STORAGE_PROFILE));
- sql.execute(null, "CREATE TABLE " + name
+ sql.execute("CREATE TABLE " + name
+ "(id INT PRIMARY KEY, name VARCHAR) ZONE ZONE_" + name + ";");
return ignite.tables().table(name);
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIndexNodeTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIndexNodeTest.java
index 3584faa7de9..b53c23fbd88 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIndexNodeTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIndexNodeTest.java
@@ -100,12 +100,12 @@ public class ItIndexNodeTest extends ClusterPerClassIntegrationTest {
String createSortIndexSql = "CREATE INDEX IF NOT EXISTS " + SORT_IDX + " ON " + TABLE_NAME + " USING SORTED (field2)";
String insertWithParams = "INSERT INTO " + TABLE_NAME + " (key, field1, field2) VALUES (?, ?, ?)";
- ignite.sql().execute(null, createZoneSql);
- ignite.sql().execute(null, createTableSql);
- ignite.sql().execute(null, createHashIndexSql);
- ignite.sql().execute(null, createSortIndexSql);
+ ignite.sql().execute(createZoneSql);
+ ignite.sql().execute(createTableSql);
+ ignite.sql().execute(createHashIndexSql);
+ ignite.sql().execute(createSortIndexSql);
for (int i = LOWER_BOUND; i <= UPPER_BOUND; i++) {
- ignite.sql().execute(null, insertWithParams, i, i, i);
+ ignite.sql().execute(insertWithParams, i, i, i);
}
IgniteImpl igniteImpl = unwrapIgniteImpl(ignite);
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItNoThreadsLeftTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItNoThreadsLeftTest.java
index 7a85789bccf..0f52f44f22c 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItNoThreadsLeftTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItNoThreadsLeftTest.java
@@ -115,7 +115,7 @@ public class ItNoThreadsLeftTest extends IgniteAbstractTest {
* @param tableName Table name.
*/
private static Table createTable(Ignite node, String tableName) {
- node.sql().execute(null, "CREATE TABLE " + tableName + "(key BIGINT PRIMARY KEY, valint INT,"
+ node.sql().execute("CREATE TABLE " + tableName + "(key BIGINT PRIMARY KEY, valint INT,"
+ " valstr VARCHAR NOT NULL DEFAULT 'default')");
return node.tables().table(tableName);
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItReplicaStateManagerTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItReplicaStateManagerTest.java
index 130cfc71eee..d024fc7550c 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItReplicaStateManagerTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItReplicaStateManagerTest.java
@@ -73,12 +73,10 @@ public class ItReplicaStateManagerTest extends BaseIgniteRestartTest {
String tableName = "TEST";
- node0.sql().execute(null,
- String.format("CREATE ZONE IF NOT EXISTS %s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
+ node0.sql().execute(String.format("CREATE ZONE IF NOT EXISTS %s (REPLICAS %d, PARTITIONS %d) STORAGE PROFILES ['%s']",
ZONE_NAME, 3, 1, DEFAULT_STORAGE_PROFILE));
- node0.sql().execute(null,
- String.format("CREATE TABLE IF NOT EXISTS %s (id INT PRIMARY KEY, name VARCHAR) ZONE %s", tableName,
+ node0.sql().execute(String.format("CREATE TABLE IF NOT EXISTS %s (id INT PRIMARY KEY, name VARCHAR) ZONE %s", tableName,
ZONE_NAME
)
);
@@ -100,7 +98,7 @@ public class ItReplicaStateManagerTest extends BaseIgniteRestartTest {
log.info("Test: Excluding the current primary from assignments. The replica should stay alive.");
// Excluding the current primary from assignments. The replica should stay alive.
- node0.sql().execute(null, alterZoneSql(filterForNodes(nodes, replicaMeta.getLeaseholderId())));
+ node0.sql().execute(alterZoneSql(filterForNodes(nodes, replicaMeta.getLeaseholderId())));
ByteArray stableAssignmentsKey = stablePartAssignmentsKey(partId);
@@ -111,7 +109,7 @@ public class ItReplicaStateManagerTest extends BaseIgniteRestartTest {
log.info("Test: Including it back.");
// Including it back.
- node0.sql().execute(null, alterZoneSql(filterForNodes(nodes, null)));
+ node0.sql().execute(alterZoneSql(filterForNodes(nodes, null)));
waitForStableAssignments(node0.metaStorageManager(), stableAssignmentsKey.bytes(), nodesCount);
@@ -120,7 +118,7 @@ public class ItReplicaStateManagerTest extends BaseIgniteRestartTest {
log.info("Test: Excluding again.");
// Excluding again.
- node0.sql().execute(null, alterZoneSql(filterForNodes(nodes, replicaMeta.getLeaseholderId())));
+ node0.sql().execute(alterZoneSql(filterForNodes(nodes, replicaMeta.getLeaseholderId())));
waitForStableAssignments(node0.metaStorageManager(), stableAssignmentsKey.bytes(), nodesCount - 1);
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItSingleNodeTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItSingleNodeTest.java
index 0100bea7d81..50a481152f4 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItSingleNodeTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItSingleNodeTest.java
@@ -84,7 +84,7 @@ public class ItSingleNodeTest extends IgniteAbstractTest {
+ " field1 int\n"
+ ")";
- ignite.sql().execute(null, sqlCreate);
+ ignite.sql().execute(sqlCreate);
node.shutdown();
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java
index 9e7eedf3338..8e530c3f7fb 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java
@@ -404,7 +404,7 @@ public class ItTablesApiTest extends ClusterPerTestIntegrationTest {
}
private static void sql(Ignite node, String sql) {
- try (ResultSet<SqlRow> ignored = node.sql().execute(null, sql)) {
+ try (ResultSet<SqlRow> ignored = node.sql().execute(sql)) {
// ignored
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
index f5a263d3f81..52a27b36f59 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
@@ -569,7 +569,7 @@ public class PlatformTestNodeRunner {
private static class CreateTableJob implements ComputeJob<String, String> {
@Override
public CompletableFuture<String> executeAsync(JobExecutionContext context, String tableName) {
- context.ignite().sql().execute(null, "CREATE TABLE " + tableName + "(key BIGINT PRIMARY KEY, val INT)");
+ context.ignite().sql().execute("CREATE TABLE " + tableName + "(key BIGINT PRIMARY KEY, val INT)");
return completedFuture(tableName);
}
@@ -582,7 +582,7 @@ public class PlatformTestNodeRunner {
private static class DropTableJob implements ComputeJob<String, String> {
@Override
public CompletableFuture<String> executeAsync(JobExecutionContext context, String tableName) {
- context.ignite().sql().execute(null, "DROP TABLE " + tableName + "");
+ context.ignite().sql().execute("DROP TABLE " + tableName + "");
return completedFuture(tableName);
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItAbstractThinClientTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItAbstractThinClientTest.java
index f9d20b46339..47fa23e374f 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItAbstractThinClientTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItAbstractThinClientTest.java
@@ -128,9 +128,9 @@ public abstract class ItAbstractThinClientTest extends BaseIgniteAbstractTest {
IgniteSql sql = startedNodes.get(0).sql();
- sql.execute(null, "CREATE ZONE " + ZONE_NAME + " (REPLICAS " + replicas() + ", PARTITIONS " + PARTITIONS + ") STORAGE PROFILES ['"
+ sql.execute("CREATE ZONE " + ZONE_NAME + " (REPLICAS " + replicas() + ", PARTITIONS " + PARTITIONS + ") STORAGE PROFILES ['"
+ DEFAULT_STORAGE_PROFILE + "']");
- sql.execute(null, "CREATE TABLE " + TABLE_NAME + "("
+ sql.execute("CREATE TABLE " + TABLE_NAME + "("
+ COLUMN_KEY + " INT PRIMARY KEY, " + COLUMN_VAL + " VARCHAR) ZONE TEST_ZONE");
client = IgniteClient.builder()
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItCustomKeyColumnOrderClientTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItCustomKeyColumnOrderClientTest.java
index 689f7c22792..45fc1c1a8f9 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItCustomKeyColumnOrderClientTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItCustomKeyColumnOrderClientTest.java
@@ -48,12 +48,12 @@ public class ItCustomKeyColumnOrderClientTest extends ItAbstractThinClientTest {
+ " (val1 VARCHAR, key1 INT, val2 BIGINT, key2 VARCHAR, PRIMARY KEY (key1, key2)) "
+ "colocate by (key2, key1)";
- client().sql().execute(null, query);
+ client().sql().execute(query);
}
@BeforeEach
void clearTable() {
- client().sql().execute(null, "DELETE FROM " + TABLE_NAME2);
+ client().sql().execute("DELETE FROM " + TABLE_NAME2);
}
protected Ignite ignite() {
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItNullsThinClientTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItNullsThinClientTest.java
index 0ce6eae73c5..b175a1baf8f 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItNullsThinClientTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItNullsThinClientTest.java
@@ -55,11 +55,11 @@ public class ItNullsThinClientTest extends ItAbstractThinClientTest {
public void setup() {
IgniteSql sql = ignite().sql();
- sql.execute(null, "CREATE TABLE t0 (ID INTEGER PRIMARY KEY, boolCol BOOLEAN, strCol VARCHAR)").close();
- sql.execute(null, "INSERT INTO t0 VALUES (1, NULL, NULL)").close();
+ sql.execute("CREATE TABLE t0 (ID INTEGER PRIMARY KEY, boolCol BOOLEAN, strCol VARCHAR)").close();
+ sql.execute("INSERT INTO t0 VALUES (1, NULL, NULL)").close();
- sql.execute(null, "CREATE TABLE t1 (ID INTEGER PRIMARY KEY, boolCol BOOLEAN)").close();
- sql.execute(null, "INSERT INTO t1 VALUES (1, NULL)").close();
+ sql.execute("CREATE TABLE t1 (ID INTEGER PRIMARY KEY, boolCol BOOLEAN)").close();
+ sql.execute("INSERT INTO t1 VALUES (1, NULL)").close();
}
@Test
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientAuthenticationTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientAuthenticationTest.java
index fe0b339069c..4a79cf91d5a 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientAuthenticationTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientAuthenticationTest.java
@@ -206,7 +206,7 @@ public class ItThinClientAuthenticationTest extends ItAbstractThinClientTest {
*/
@Test
public void testCurrentUser() {
- server().sql().execute(null, "CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)").close();
+ server().sql().execute("CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)").close();
try (IgniteClient client2WithAuth = IgniteClient.builder()
.authenticator(BasicAuthenticator.builder()
@@ -222,7 +222,7 @@ public class ItThinClientAuthenticationTest extends ItAbstractThinClientTest {
private static void validateCurrentUser(IgniteClient client, String expectedUsername) {
AsyncResultSet<SqlRow> resultSet = client.sql()
- .executeAsync(null, "SELECT CURRENT_USER")
+ .executeAsync("SELECT CURRENT_USER")
.join();
SqlRow row = resultSet.currentPage().iterator().next();
@@ -231,9 +231,9 @@ public class ItThinClientAuthenticationTest extends ItAbstractThinClientTest {
assertEquals(ColumnType.STRING, resultSet.metadata().columns().get(0).type());
assertEquals(expectedUsername, row.stringValue(0));
- client.sql().execute(null, format("INSERT INTO t1 (id, val) VALUES ({}, CURRENT_USER)", expectedUsername.hashCode())).close();
+ client.sql().execute(format("INSERT INTO t1 (id, val) VALUES ({}, CURRENT_USER)", expectedUsername.hashCode())).close();
- try (ResultSet<SqlRow> rs = client.sql().execute(null, "SELECT val FROM t1 WHERE val = CURRENT_USER")) {
+ try (ResultSet<SqlRow> rs = client.sql().execute("SELECT val FROM t1 WHERE val = CURRENT_USER")) {
assertTrue(rs.hasNext());
assertEquals(expectedUsername, rs.next().stringValue(0));
assertFalse(rs.hasNext());
@@ -241,7 +241,7 @@ public class ItThinClientAuthenticationTest extends ItAbstractThinClientTest {
}
private static CompletableFuture<Void> checkConnection(IgniteClient client) {
- return client.sql().executeAsync(null, "select 1 as num, 'hello' as str")
+ return client.sql().executeAsync("select 1 as num, 'hello' as str")
.thenApply(ignored -> null);
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientChannelValidatorTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientChannelValidatorTest.java
index df9e5aeb0c9..d8be376ae69 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientChannelValidatorTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientChannelValidatorTest.java
@@ -125,7 +125,7 @@ public class ItThinClientChannelValidatorTest extends BaseIgniteAbstractTest {
Awaitility.await().timeout(3, TimeUnit.SECONDS)
.untilAsserted(() -> assertThat(client.connections().size(), is(1)));
- client.sql().execute(null, "SELECT 1").close();
+ client.sql().execute("SELECT 1").close();
// Make sure there are no new connections.
Thread.sleep(reconnectInterval * 2);
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java
index 1a7306454c9..309b9962282 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java
@@ -825,7 +825,7 @@ public class ItThinClientComputeTest extends ItAbstractThinClientTest {
@Test
void testExecuteColocatedEscapedTableName() {
var tableName = "\"TBL ABC\"";
- client().sql().execute(null, "CREATE TABLE " + tableName + " (key INT PRIMARY KEY, val INT)");
+ client().sql().execute("CREATE TABLE " + tableName + " (key INT PRIMARY KEY, val INT)");
Mapper<TestPojo> mapper = Mapper.of(TestPojo.class);
TestPojo pojoKey = new TestPojo(1);
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientConnectionTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientConnectionTest.java
index 444f0489d3e..db18537ad21 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientConnectionTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientConnectionTest.java
@@ -90,10 +90,10 @@ public class ItThinClientConnectionTest extends ItAbstractThinClientTest {
@Test
void testAccessDroppedTableThrowsTableDoesNotExistsError() {
IgniteSql sql = client().sql();
- sql.execute(null, "CREATE TABLE IF NOT EXISTS DELME (key INTEGER PRIMARY KEY)");
+ sql.execute("CREATE TABLE IF NOT EXISTS DELME (key INTEGER PRIMARY KEY)");
var table = client().tables().table("DELME");
- sql.execute(null, "DROP TABLE DELME");
+ sql.execute("DROP TABLE DELME");
IgniteException ex = assertThrows(IgniteException.class, () -> table.recordView(Integer.class).delete(null, 1));
assertEquals(TABLE_NOT_FOUND_ERR, ex.code(), ex.getMessage());
@@ -126,7 +126,7 @@ public class ItThinClientConnectionTest extends ItAbstractThinClientTest {
// Execute on all nodes to collect all types of exception.
List<String> causes = IntStream.range(0, client().configuration().addresses().length)
.mapToObj(i -> {
- IgniteException ex = assertThrows(IgniteException.class, () -> client().sql().execute(null, "select x from bad"));
+ IgniteException ex = assertThrows(IgniteException.class, () -> client().sql().execute("select x from bad"));
return ex.getCause().getCause().getCause().getCause().getMessage();
})
@@ -144,13 +144,13 @@ public class ItThinClientConnectionTest extends ItAbstractThinClientTest {
assertEquals("TBL1", table.qualifiedName().objectName());
// Quoting is necessary.
- client().sql().execute(null, "CREATE TABLE IF NOT EXISTS \"tbl-2\" (key INTEGER PRIMARY KEY)");
+ client().sql().execute("CREATE TABLE IF NOT EXISTS \"tbl-2\" (key INTEGER PRIMARY KEY)");
try {
Table table2 = client().tables().table("\"tbl-2\"");
assertEquals("tbl-2", table2.qualifiedName().objectName());
} finally {
- client().sql().execute(null, "DROP TABLE \"tbl-2\"");
+ client().sql().execute("DROP TABLE \"tbl-2\"");
}
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientDdlQueriesTrackerTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientDdlQueriesTrackerTest.java
index 128500298da..165d683b1f2 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientDdlQueriesTrackerTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientDdlQueriesTrackerTest.java
@@ -138,7 +138,7 @@ public class ItThinClientDdlQueriesTrackerTest extends ItAbstractThinClientTest
private static void addColumn(IgniteClient client, int columnNumber) {
String ddlQuery = IgniteStringFormatter.format("ALTER TABLE t ADD COLUMN col{} int;", columnNumber);
- try (ResultSet<SqlRow> rs = client.sql().execute(null, ddlQuery)) {
+ try (ResultSet<SqlRow> rs = client.sql().execute(ddlQuery)) {
assertThat(rs.hasRowSet(), is(false));
assertThat(rs.wasApplied(), is(true));
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientMarshallingTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientMarshallingTest.java
index 4a75d938796..52c6a983b4b 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientMarshallingTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientMarshallingTest.java
@@ -149,7 +149,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
@Test
public void testKvMissingValPojoFields() {
String tableName = "tableWithExtraField";
- ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR, EXTRA VARCHAR)");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR, EXTRA VARCHAR)");
Table table = ignite().tables().table(tableName);
var kvPojoView = table.keyValueView(Integer.class, MissingFieldPojo2.class);
@@ -173,7 +173,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
@Test
public void testMissingValTupleFields() {
var tableName = "testMissingValTupleFields";
- ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
Table table = ignite().tables().table(tableName);
var tupleView = table.recordView();
@@ -196,7 +196,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
@Test
public void testKvMissingValTupleFields() {
var tableName = "testKvMissingValTupleFields";
- ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
Table table = ignite().tables().table(tableName);
var tupleView = table.keyValueView();
@@ -209,8 +209,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
@Test
public void testMissingTupleFieldsWithDefaultValue() {
var tableName = "testMissingTupleFieldsWithDefaultValue";
- ignite().sql().execute(null,
- "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL DEFAULT 'def')");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL DEFAULT 'def')");
Table table = ignite().tables().table(tableName);
var tupleView = table.recordView();
@@ -250,7 +249,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
@Test
public void testIncompatibleTupleElementType() {
var tableName = "testIncompatibleTupleElementType";
- ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
Table table = ignite().tables().table(tableName);
var tupleView = table.recordView();
@@ -304,7 +303,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
@Test
public void testNullValTupleFields() {
var tableName = "testNullValTupleFields";
- ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
Table table = ignite().tables().table(tableName);
var tupleView = table.recordView();
@@ -328,7 +327,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
@Test
public void testKvNullValTupleFields() {
var tableName = "testKvNullValTupleFields";
- ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR NOT NULL)");
Table table = ignite().tables().table(tableName);
var tupleView = table.keyValueView();
@@ -342,7 +341,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
public void testVarcharColumnOverflow() {
var tableName = "testVarcharColumnOverflow";
- ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR(10))");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL VARCHAR(10))");
Table table = ignite().tables().table(tableName);
var tupleView = table.keyValueView();
@@ -357,7 +356,7 @@ public class ItThinClientMarshallingTest extends ItAbstractThinClientTest {
public void testDecimalColumnOverflow() {
var tableName = "testDecimalColumnOverflow";
- ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL DECIMAL(3,1))");
+ ignite().sql().execute("CREATE TABLE " + tableName + " (KEY INT PRIMARY KEY, VAL DECIMAL(3,1))");
Table table = ignite().tables().table(tableName);
var tupleView = table.keyValueView();
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientSchemaSynchronizationTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientSchemaSynchronizationTest.java
index 0176fdb91b6..cf6f5ec4a92 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientSchemaSynchronizationTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientSchemaSynchronizationTest.java
@@ -52,7 +52,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Create table, insert data.
String tableName = "testClientUsesLatestSchemaOnWrite" + id;
- sql.execute(null, "CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY, NAME VARCHAR NOT NULL)");
+ sql.execute("CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY, NAME VARCHAR NOT NULL)");
RecordView<Tuple> recordView = client.tables().table(tableName).recordView();
@@ -61,7 +61,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Modify table, insert data - client will use old schema, receive error, retry with new schema, fail due to an extra column.
// The process is transparent for the user: updated schema is in effect immediately.
- sql.execute(null, "ALTER TABLE " + tableName + " DROP COLUMN NAME");
+ sql.execute("ALTER TABLE " + tableName + " DROP COLUMN NAME");
Tuple rec2 = Tuple.create().set("ID", id).set("NAME", "name2");
assertThrowsWithCause(() -> recordView.upsert(null, rec2), MarshallerException.class,
@@ -75,7 +75,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Create table, insert data.
String tableName = "testClientUsesLatestSchemaOnRead";
- sql.execute(null, "CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
+ sql.execute("CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
RecordView<Tuple> recordView = client.tables().table(tableName).recordView();
@@ -84,7 +84,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Modify table, read data - client will use old schema, receive error, retry with new schema.
// The process is transparent for the user: updated schema is in effect immediately.
- sql.execute(null, "ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR DEFAULT 'def_name'");
+ sql.execute("ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR DEFAULT 'def_name'");
assertEquals("def_name", recordView.get(null, rec).stringValue(1));
}
@@ -95,7 +95,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Create table, insert data.
String tableName = "testClientUsesLatestSchemaOnReadWithNotNullColumn";
- sql.execute(null, "CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
+ sql.execute("CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
RecordView<Tuple> recordView = client.tables().table(tableName).recordView();
@@ -104,7 +104,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Modify table and get old row.
// It still has null value in the old column, even though it is not allowed by the new schema.
- sql.execute(null, "ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
+ sql.execute("ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
assertNull(recordView.get(null, rec).stringValue(1));
}
@@ -114,7 +114,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
String tableName = "testObservableTimeUpdatesAfterSchemaChange";
- client.sql().execute(null, "CREATE TABLE " + tableName + " (id INT PRIMARY KEY)");
+ client.sql().execute("CREATE TABLE " + tableName + " (id INT PRIMARY KEY)");
Transaction tx = client.transactions().begin(new TransactionOptions().readOnly(true));
@@ -136,7 +136,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
IgniteSql sql = client.sql();
String tableName = "testClientReloadsTupleSchemaOnUnmappedColumnException_" + useGetAndUpsert;
- sql.execute(null, "CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
+ sql.execute("CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
RecordView<Tuple> recordView = client.tables().table(tableName).recordView();
@@ -151,7 +151,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Modify table, insert again - client will use old schema, throw ClientSchemaMismatchException,
// reload schema, retry with new schema and succeed.
- sql.execute(null, "ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
+ sql.execute("ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
action.run();
assertEquals("name", recordView.get(null, rec).stringValue(1));
@@ -164,7 +164,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
IgniteSql sql = client.sql();
String tableName = "testClientReloadsKvTupleSchemaOnUnmappedColumnException_" + useGetAndPut;
- sql.execute(null, "CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
+ sql.execute("CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
KeyValueView<Tuple, Tuple> kvView = client.tables().table(tableName).keyValueView();
@@ -181,7 +181,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Modify table, insert again - client will use old schema, throw ClientSchemaMismatchException,
// reload schema, retry with new schema and succeed.
- sql.execute(null, "ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
+ sql.execute("ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
action.run();
assertEquals("name", kvView.get(null, key).stringValue(0));
@@ -194,7 +194,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
IgniteSql sql = client.sql();
String tableName = "testClientReloadsPojoSchemaOnUnmappedColumnException_" + useGetAndUpsert;
- sql.execute(null, "CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
+ sql.execute("CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
RecordView<Pojo> recordView = client.tables().table(tableName).recordView(Mapper.of(Pojo.class));
@@ -210,7 +210,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Modify table, insert again - client will use old schema, throw ClientSchemaMismatchException,
// reload schema, retry with new schema and succeed.
- sql.execute(null, "ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
+ sql.execute("ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
action.run();
assertEquals("name", recordView.get(null, rec).name);
@@ -223,7 +223,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
IgniteSql sql = client.sql();
String tableName = "testClientReloadsKvPojoSchemaOnUnmappedColumnException_" + useGetAndPut;
- sql.execute(null, "CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
+ sql.execute("CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
KeyValueView<Integer, ValPojo> kvView = client.tables().table(tableName)
.keyValueView(Mapper.of(Integer.class), Mapper.of(ValPojo.class));
@@ -242,7 +242,7 @@ public class ItThinClientSchemaSynchronizationTest extends ItAbstractThinClientT
// Modify table, insert again - client will use old schema, throw ClientSchemaMismatchException,
// reload schema, retry with new schema and succeed.
- sql.execute(null, "ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
+ sql.execute("ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL");
action.run();
assertEquals("name", kvView.get(null, key).name);
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientSqlTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientSqlTest.java
index 2bcad12d5e0..60b14cb3ba9 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientSqlTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientSqlTest.java
@@ -98,7 +98,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
@Test
void testExecuteAsyncSimpleSelect() {
AsyncResultSet<SqlRow> resultSet = client().sql()
- .executeAsync(null, "select 1 as num, 'hello' as str")
+ .executeAsync("select 1 as num, 'hello' as str")
.join();
assertTrue(resultSet.hasRowSet());
@@ -123,7 +123,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
@Test
void testExecuteSimpleSelect() {
ResultSet<SqlRow> resultSet = client().sql()
- .execute(null, "select 1 as num, 'hello' as str");
+ .execute("select 1 as num, 'hello' as str");
assertTrue(resultSet.hasRowSet());
assertFalse(resultSet.wasApplied());
@@ -144,7 +144,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
IgniteSql sql = client().sql();
// Create table.
- sql.execute(null, "CREATE TABLE testExecuteDdlDml(ID INT NOT NULL PRIMARY KEY, VAL VARCHAR)");
+ sql.execute("CREATE TABLE testExecuteDdlDml(ID INT NOT NULL PRIMARY KEY, VAL VARCHAR)");
// Async
Transaction tx = client().transactions().begin();
@@ -190,10 +190,10 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
});
for (int i = 0; i < 10; i++) {
- sql.execute(null, "INSERT INTO testExecuteDdlDml VALUES (?, ?)", i, "hello " + i);
+ sql.execute("INSERT INTO testExecuteDdlDml VALUES (?, ?)", i, "hello " + i);
}
- ResultSet<SqlRow> selectRes = sql.execute(null, "SELECT * FROM testExecuteDdlDml ORDER BY ID");
+ ResultSet<SqlRow> selectRes = sql.execute("SELECT * FROM testExecuteDdlDml ORDER BY ID");
var rows = new ArrayList<SqlRow>();
selectRes.forEachRemaining(rows::add);
@@ -201,7 +201,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
assertEquals(1 + 1 + 10, rows.size());
// Delete table.
- sql.execute(null, "DROP TABLE testExecuteDdlDml");
+ sql.execute("DROP TABLE testExecuteDdlDml");
}
@Test
@@ -210,7 +210,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// Create table.
AsyncResultSet createRes = sql
- .executeAsync(null, "CREATE TABLE testExecuteAsyncDdlDml(ID INT PRIMARY KEY, VAL VARCHAR)")
+ .executeAsync("CREATE TABLE testExecuteAsyncDdlDml(ID INT PRIMARY KEY, VAL VARCHAR)")
.join();
assertFalse(createRes.hasRowSet());
@@ -222,7 +222,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// Insert data.
for (int i = 0; i < 10; i++) {
AsyncResultSet insertRes = sql
- .executeAsync(null, "INSERT INTO testExecuteAsyncDdlDml VALUES (?, ?)", i, "hello " + i)
+ .executeAsync("INSERT INTO testExecuteAsyncDdlDml VALUES (?, ?)", i, "hello " + i)
.join();
assertFalse(insertRes.hasRowSet());
@@ -234,7 +234,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// Query data.
AsyncResultSet<SqlRow> selectRes = sql
- .executeAsync(null, "SELECT VAL as MYVALUE, ID, ID + 1 FROM testExecuteAsyncDdlDml ORDER BY ID")
+ .executeAsync("SELECT VAL as MYVALUE, ID, ID + 1 FROM testExecuteAsyncDdlDml ORDER BY ID")
.join();
assertTrue(selectRes.hasRowSet());
@@ -258,7 +258,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// Update data.
AsyncResultSet updateRes = sql
- .executeAsync(null, "UPDATE testExecuteAsyncDdlDml SET VAL='upd' WHERE ID < 5").join();
+ .executeAsync("UPDATE testExecuteAsyncDdlDml SET VAL='upd' WHERE ID < 5").join();
assertFalse(updateRes.wasApplied());
assertFalse(updateRes.hasRowSet());
@@ -266,7 +266,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
assertEquals(5, updateRes.affectedRows());
// Delete table.
- AsyncResultSet deleteRes = sql.executeAsync(null, "DROP TABLE testExecuteAsyncDdlDml").join();
+ AsyncResultSet deleteRes = sql.executeAsync("DROP TABLE testExecuteAsyncDdlDml").join();
assertFalse(deleteRes.hasRowSet());
assertNull(deleteRes.metadata());
@@ -279,9 +279,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
IgniteSql sql = client().sql();
// Create table.
- ResultSet createRes = sql.execute(
- null,
- "CREATE TABLE testExecuteDdlDml(ID INT NOT NULL PRIMARY KEY, VAL VARCHAR)");
+ ResultSet createRes = sql.execute("CREATE TABLE testExecuteDdlDml(ID INT NOT NULL PRIMARY KEY, VAL VARCHAR)");
assertFalse(createRes.hasRowSet());
assertNull(createRes.metadata());
@@ -290,9 +288,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// Insert data.
for (int i = 0; i < 10; i++) {
- ResultSet insertRes = sql.execute(
- null,
- "INSERT INTO testExecuteDdlDml VALUES (?, ?)", i, "hello " + i);
+ ResultSet insertRes = sql.execute("INSERT INTO testExecuteDdlDml VALUES (?, ?)", i, "hello " + i);
assertFalse(insertRes.hasRowSet());
assertNull(insertRes.metadata());
@@ -302,7 +298,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// Query data.
ResultSet<SqlRow> selectRes = sql
- .execute(null, "SELECT VAL as MYVALUE, ID, ID + 1 FROM testExecuteDdlDml ORDER BY ID");
+ .execute("SELECT VAL as MYVALUE, ID, ID + 1 FROM testExecuteDdlDml ORDER BY ID");
assertTrue(selectRes.hasRowSet());
assertFalse(selectRes.wasApplied());
@@ -340,7 +336,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
assertEquals(2, rows.get(1).intValue(2));
// Update data.
- ResultSet updateRes = sql.execute(null, "UPDATE testExecuteDdlDml SET VAL='upd' WHERE ID < 5");
+ ResultSet updateRes = sql.execute("UPDATE testExecuteDdlDml SET VAL='upd' WHERE ID < 5");
assertFalse(updateRes.wasApplied());
assertFalse(updateRes.hasRowSet());
@@ -348,7 +344,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
assertEquals(5, updateRes.affectedRows());
// Delete table.
- ResultSet deleteRes = sql.execute(null, "DROP TABLE testExecuteDdlDml");
+ ResultSet deleteRes = sql.execute("DROP TABLE testExecuteDdlDml");
assertFalse(deleteRes.hasRowSet());
assertNull(deleteRes.metadata());
@@ -359,15 +355,15 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
void testFetchNextPage() {
IgniteSql sql = client().sql();
- sql.executeAsync(null, "CREATE TABLE testFetchNextPage(ID INT PRIMARY KEY, VAL INT)").join();
+ sql.executeAsync("CREATE TABLE testFetchNextPage(ID INT PRIMARY KEY, VAL INT)").join();
for (int i = 0; i < 10; i++) {
- sql.executeAsync(null, "INSERT INTO testFetchNextPage VALUES (?, ?)", i, i).join();
+ sql.executeAsync("INSERT INTO testFetchNextPage VALUES (?, ?)", i, i).join();
}
Statement statement = client().sql().statementBuilder().pageSize(4).query("SELECT ID FROM testFetchNextPage ORDER BY ID").build();
- AsyncResultSet<SqlRow> asyncResultSet = sql.executeAsync(null, statement).join();
+ AsyncResultSet<SqlRow> asyncResultSet = sql.executeAsync((Transaction) null, statement).join();
assertEquals(4, asyncResultSet.currentPageSize());
assertTrue(asyncResultSet.hasMorePages());
@@ -390,7 +386,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
void testInvalidSqlThrowsException() {
CompletionException ex = assertThrows(
CompletionException.class,
- () -> client().sql().executeAsync(null, "select x from bad").join());
+ () -> client().sql().executeAsync("select x from bad").join());
var clientEx = (IgniteException) ex.getCause();
@@ -401,15 +397,15 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
void testTransactionRollbackRevertsSqlUpdate() {
IgniteSql sql = client().sql();
- sql.executeAsync(null, "CREATE TABLE testTx(ID INT PRIMARY KEY, VAL INT)").join();
+ sql.executeAsync("CREATE TABLE testTx(ID INT PRIMARY KEY, VAL INT)").join();
- sql.executeAsync(null, "INSERT INTO testTx VALUES (1, 1)").join();
+ sql.executeAsync("INSERT INTO testTx VALUES (1, 1)").join();
Transaction tx = client().transactions().begin();
sql.executeAsync(tx, "UPDATE testTx SET VAL=2").join();
tx.rollback();
- var res = sql.executeAsync(null, "SELECT VAL FROM testTx").join();
+ var res = sql.executeAsync("SELECT VAL FROM testTx").join();
assertEquals(1, res.currentPage().iterator().next().intValue(0));
}
@@ -422,13 +418,13 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
IgniteClient client = client();
IgniteSql sql = client.sql();
- sql.execute(null, "CREATE TABLE my_table (id int, ts TIMESTAMP WITH LOCAL TIME ZONE, val INT, "
+ sql.execute("CREATE TABLE my_table (id int, ts TIMESTAMP WITH LOCAL TIME ZONE, val INT, "
+ "PRIMARY KEY(id, ts))");
int count = 100;
for (int i = 0; i < count; i++) {
- sql.execute(null, "INSERT INTO my_table VALUES (?, TIMESTAMP WITH LOCAL TIME ZONE '1970-01-01 00:00:00', ?)", i, i);
+ sql.execute("INSERT INTO my_table VALUES (?, TIMESTAMP WITH LOCAL TIME ZONE '1970-01-01 00:00:00', ?)", i, i);
}
StatementBuilder builder = sql.statementBuilder();
@@ -475,26 +471,26 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
IgniteClient client = client();
IgniteSql sql = client.sql();
- sql.execute(null, "CREATE TABLE my_table (id INT PRIMARY KEY, val INT)");
+ sql.execute("CREATE TABLE my_table (id INT PRIMARY KEY, val INT)");
// First, let's fill the table and check every row in implicit tx.
// This should also prepare partition awareness metadata.
int count = 10;
for (int i = 0; i < count; i++) {
- try (ResultSet<?> ignored = sql.execute(null, "INSERT INTO my_table VALUES (?, ?)", i, i)) {
+ try (ResultSet<?> ignored = sql.execute("INSERT INTO my_table VALUES (?, ?)", i, i)) {
// No-op.
}
}
for (int i = 0; i < count; i++) {
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT * FROM my_table WHERE id = ?", i)) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT * FROM my_table WHERE id = ?", i)) {
assertEquals(i, rs.next().intValue(1));
}
}
// Now let's clean the table and do the same steps but within explicit tx.
- try (ResultSet<?> ignored = sql.execute(null, "DELETE FROM my_table")) {
+ try (ResultSet<?> ignored = sql.execute("DELETE FROM my_table")) {
// No-op.
}
@@ -513,7 +509,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// All just inserted rows should not be visible yet
for (int i = 0; i < count; i++) {
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT * FROM my_table WHERE id = ?", i)) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT * FROM my_table WHERE id = ?", i)) {
assertFalse(rs.hasNext());
}
}
@@ -530,7 +526,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// And now changes are published.
for (int i = 0; i < count; i++) {
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT * FROM my_table WHERE id = ?", i)) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT * FROM my_table WHERE id = ?", i)) {
assertEquals(i, rs.next().intValue(1));
}
}
@@ -541,11 +537,11 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
IgniteClient client = client();
IgniteSql sql = client.sql();
- sql.execute(null, "CREATE TABLE my_table (id INT PRIMARY KEY, val INT)");
+ sql.execute("CREATE TABLE my_table (id INT PRIMARY KEY, val INT)");
int count = 10;
for (int i = 0; i < count; i++) {
- try (ResultSet<?> ignored = sql.execute(null, "INSERT INTO my_table VALUES (?, ?)", i, i)) {
+ try (ResultSet<?> ignored = sql.execute("INSERT INTO my_table VALUES (?, ?)", i, i)) {
// No-op.
}
}
@@ -559,7 +555,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// Changes has not been published yet.
for (int i = 0; i < count; i++) {
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT * FROM my_table WHERE id = ?", i)) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT * FROM my_table WHERE id = ?", i)) {
assertEquals(i, rs.next().intValue(1));
}
}
@@ -575,7 +571,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
// And now changes are published.
for (int i = 0; i < count; i++) {
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT * FROM my_table WHERE id = ?", i)) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT * FROM my_table WHERE id = ?", i)) {
assertEquals(rs.hasNext(), i % 2 != 0);
}
}
@@ -588,8 +584,8 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
String query = "select 123 + ? as num, 'Hello!' as str";
ResultSet<Pojo> resultSet = useStatement
- ? sql.execute(null, Mapper.of(Pojo.class), client().sql().statementBuilder().query(query).build(), 10)
- : sql.execute(null, Mapper.of(Pojo.class), query, 10);
+ ? sql.execute((Transaction) null, Mapper.of(Pojo.class), client().sql().statementBuilder().query(query).build(), 10)
+ : sql.execute((Transaction) null, Mapper.of(Pojo.class), query, 10);
assertTrue(resultSet.hasRowSet());
@@ -606,8 +602,8 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
String query = "select 1 as num, concat('hello ', ?) as str";
AsyncResultSet<Pojo> resultSet = useStatement
- ? sql.executeAsync(null, Mapper.of(Pojo.class), client().sql().statementBuilder().query(query).build(), "world").join()
- : sql.executeAsync(null, Mapper.of(Pojo.class), query, "world").join();
+ ? sql.executeAsync((Transaction) null, Mapper.of(Pojo.class), sql.statementBuilder().query(query).build(), "world").join()
+ : sql.executeAsync((Transaction) null, Mapper.of(Pojo.class), query, "world").join();
assertTrue(resultSet.hasRowSet());
assertEquals(1, resultSet.currentPageSize());
@@ -624,7 +620,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
IgniteException e = assertThrows(
IgniteException.class,
- () -> client().sql().execute(null, Mapper.of(Pojo.class), query));
+ () -> client().sql().execute((Transaction) null, Mapper.of(Pojo.class), query));
assertEquals("Failed to deserialize server response: No mapped object field found for column 'FOO'", e.getMessage());
}
@@ -649,7 +645,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
+ "VAL_UUID UUID, "
+ "VAL_BYTES VARBINARY)";
- sql.execute(null, createTable);
+ sql.execute((Transaction) null, createTable);
String insertData = "INSERT INTO testAllColumnTypes VALUES ("
+ "1, "
@@ -667,9 +663,9 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
+ "'10000000-2000-3000-4000-500000000000'::UUID, "
+ "x'42')";
- sql.execute(null, insertData);
+ sql.execute((Transaction) null, insertData);
- var resultSet = sql.execute(null, "SELECT *, NULL FROM testAllColumnTypes");
+ var resultSet = sql.execute((Transaction) null, "SELECT *, NULL FROM testAllColumnTypes");
assertTrue(resultSet.hasRowSet());
var row = resultSet.next();
@@ -728,7 +724,7 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
@Test
public void testClientSqlRowToString() {
AsyncResultSet<SqlRow> resultSet = client().sql()
- .executeAsync(null, "select 1 as num, 'hello' as str")
+ .executeAsync("select 1 as num, 'hello' as str")
.join();
SqlRow row = resultSet.currentPage().iterator().next();
@@ -741,17 +737,17 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
String expectedUsername = UserDetails.UNKNOWN.username();
IgniteSql sql = client().sql();
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT CURRENT_USER")) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT CURRENT_USER")) {
assertEquals(ColumnType.STRING, rs.metadata().columns().get(0).type());
assertTrue(rs.hasNext());
assertEquals(expectedUsername, rs.next().stringValue(0));
assertFalse(rs.hasNext());
}
- sql.execute(null, "CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)").close();
- sql.execute(null, "INSERT INTO t1 (id, val) VALUES (1, CURRENT_USER)").close();
+ sql.execute("CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)").close();
+ sql.execute("INSERT INTO t1 (id, val) VALUES (1, CURRENT_USER)").close();
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT val FROM t1 WHERE val = CURRENT_USER")) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT val FROM t1 WHERE val = CURRENT_USER")) {
assertTrue(rs.hasNext());
assertEquals(expectedUsername, rs.next().stringValue(0));
assertFalse(rs.hasNext());
@@ -848,11 +844,11 @@ public class ItThinClientSqlTest extends ItAbstractThinClientTest {
public void testBroadcastQueryTxInflightStateCleanup() {
IgniteSql sql = client().sql();
- sql.execute(null, "CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)").close();
- sql.execute(null, String.format("CREATE INDEX IF NOT EXISTS idx1 ON t1 (val)"));
- sql.execute(null, "INSERT INTO t1 (id, val) VALUES (1, 'test1')").close();
+ sql.execute("CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)").close();
+ sql.execute("CREATE INDEX IF NOT EXISTS idx1 ON t1 (val)");
+ sql.execute("INSERT INTO t1 (id, val) VALUES (1, 'test1')").close();
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT id FROM t1 WHERE val = ?", "test1")) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT id FROM t1 WHERE val = ?", "test1")) {
assertTrue(rs.hasNext());
assertEquals(1, rs.next().intValue(0));
assertFalse(rs.hasNext());
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTablesGetListTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTablesGetListTest.java
index e2ec68d8152..d351d90d7cf 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTablesGetListTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTablesGetListTest.java
@@ -51,7 +51,7 @@ public class ItThinClientTablesGetListTest extends ItAbstractThinClientTest {
Ignite server = server();
for (Table table : server().tables().tables()) {
- try (ResultSet<?> rs = server.sql().execute(null, "DROP TABLE " + table.qualifiedName().toCanonicalForm())) {
+ try (ResultSet<?> rs = server.sql().execute("DROP TABLE " + table.qualifiedName().toCanonicalForm())) {
assertNotNull(rs);
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTransactionsTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTransactionsTest.java
index 2662ae5250d..a6479ad869c 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTransactionsTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTransactionsTest.java
@@ -399,7 +399,7 @@ public class ItThinClientTransactionsTest extends ItAbstractThinClientTest {
Transaction tx = client.transactions().begin();
kvView.put(tx, 1, "1");
- try (ResultSet<SqlRow> cursor = client.sql().execute(null, "SELECT TRANSACTION_ID FROM SYSTEM.TRANSACTIONS")) {
+ try (ResultSet<SqlRow> cursor = client.sql().execute("SELECT TRANSACTION_ID FROM SYSTEM.TRANSACTIONS")) {
cursor.forEachRemaining(r -> {
String txId = r.stringValue("TRANSACTION_ID");
client.sql().executeScript("KILL TRANSACTION '" + txId + "'");
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinConnectionFailoverTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinConnectionFailoverTest.java
index 29ad0e6b584..bd8ab69ffab 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinConnectionFailoverTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinConnectionFailoverTest.java
@@ -81,14 +81,14 @@ public class ItThinConnectionFailoverTest extends ClusterPerTestIntegrationTest
IgniteSql sql = client.sql();
for (int i = 0; i < 10; i++) {
- sql.execute(null, "INSERT INTO t VALUES (?, ?)", i, i).close();
+ sql.execute("INSERT INTO t VALUES (?, ?)", i, i).close();
}
cluster.stopNode(0);
assertThat(client.connections().size(), is(2));
for (int i = 10; i < 20; i++) {
- sql.execute(null, "INSERT INTO t VALUES (?, ?)", i, i).close();
+ sql.execute("INSERT INTO t VALUES (?, ?)", i, i).close();
}
}
@@ -97,14 +97,14 @@ public class ItThinConnectionFailoverTest extends ClusterPerTestIntegrationTest
IgniteSql sql = client.sql();
for (int i = 0; i < 10; i++) {
- sql.execute(null, "SELECT " + i).close();
+ sql.execute("SELECT " + i).close();
}
cluster.stopNode(0);
assertThat(client.connections().size(), is(2));
for (int i = 10; i < 20; i++) {
- sql.execute(null, "SELECT " + i).close();
+ sql.execute("SELECT " + i).close();
}
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaSyncAndReplicationTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaSyncAndReplicationTest.java
index 3fdc4a857fe..2d52dc5ac6c 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaSyncAndReplicationTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaSyncAndReplicationTest.java
@@ -146,7 +146,7 @@ class ItSchemaSyncAndReplicationTest extends ClusterPerTestIntegrationTest {
private void updateTableSchemaAt(int nodeIndex) {
cluster.doInSession(nodeIndex, session -> {
- session.execute(null, "alter table " + TABLE_NAME + " add column added int");
+ session.execute("alter table " + TABLE_NAME + " add column added int");
});
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/streamer/ItAbstractDataStreamerTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/streamer/ItAbstractDataStreamerTest.java
index 01a95f47b91..97b7938b71a 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/streamer/ItAbstractDataStreamerTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/streamer/ItAbstractDataStreamerTest.java
@@ -448,7 +448,7 @@ public abstract class ItAbstractDataStreamerTest extends ClusterPerClassIntegrat
streamerFut.orTimeout(30, TimeUnit.SECONDS).join();
ArrayList<String> sqlRes = new ArrayList<>(count);
- ResultSet<SqlRow> resultSet = ignite().sql().execute(null, "SELECT name FROM " + TABLE_NAME + " order by id");
+ ResultSet<SqlRow> resultSet = ignite().sql().execute("SELECT name FROM " + TABLE_NAME + " order by id");
resultSet.forEachRemaining(row -> sqlRes.add(row.stringValue(0)));
assertEquals(count, sqlRes.size());
@@ -534,7 +534,7 @@ public abstract class ItAbstractDataStreamerTest extends ClusterPerClassIntegrat
IgniteSql sql = ignite().sql();
String tableName = "testSchemaUpdateWhileStreaming";
- sql.execute(null, "CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
+ sql.execute("CREATE TABLE " + tableName + "(ID INT NOT NULL PRIMARY KEY)");
RecordView<Tuple> view = ignite().tables().table(tableName).recordView();
CompletableFuture<Void> streamerFut;
@@ -546,7 +546,7 @@ public abstract class ItAbstractDataStreamerTest extends ClusterPerClassIntegrat
publisher.submit(tupleKey(1));
waitForKey(view, tupleKey(1));
- sql.execute(null, "ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL DEFAULT 'bar'");
+ sql.execute("ALTER TABLE " + tableName + " ADD COLUMN NAME VARCHAR NOT NULL DEFAULT 'bar'");
publisher.submit(tupleKey(2));
}
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItInternalTableTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItInternalTableTest.java
index e2bfb980af6..2e03e650888 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItInternalTableTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItInternalTableTest.java
@@ -634,11 +634,10 @@ public class ItInternalTableTest extends ClusterPerClassIntegrationTest {
String zoneName = zoneNameForTable(tableName);
IgniteSql sql = node.sql();
- sql.execute(null, String.format("create zone %s (partitions 3, replicas %d) storage profiles ['%s']",
+ sql.execute(String.format("create zone %s (partitions 3, replicas %d) storage profiles ['%s']",
zoneName, DEFAULT_REPLICA_COUNT, DEFAULT_STORAGE_PROFILE));
- sql.execute(null,
- String.format(
+ sql.execute(String.format(
"create table %s (key bigint primary key, valInt int, valStr varchar default 'default') "
+ "zone %s",
tableName, zoneName
@@ -659,8 +658,8 @@ public class ItInternalTableTest extends ClusterPerClassIntegrationTest {
private static void stopTable(Ignite node, String tableName) {
IgniteSql sql = node.sql();
- sql.execute(null, "drop table " + tableName);
- sql.execute(null, "drop zone " + zoneNameForTable(tableName));
+ sql.execute("drop table " + tableName);
+ sql.execute("drop zone " + zoneNameForTable(tableName));
}
protected static int nodes() {
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItRebalanceWithPartitionReturnTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItRebalanceWithPartitionReturnTest.java
index 6d53d790f7c..ae518d7b8bd 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItRebalanceWithPartitionReturnTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItRebalanceWithPartitionReturnTest.java
@@ -123,11 +123,10 @@ public class ItRebalanceWithPartitionReturnTest extends ClusterPerTestIntegratio
Ignite node0 = unwrapIgniteImpl(node(0));
node0.sql().execute(
- null,
createZoneSql(partCount, 1, 10_000, 10_000, filter, STORAGE_PROFILES, ConsistencyMode.STRONG_CONSISTENCY)
);
- node0.sql().execute(null, createTableSql());
+ node0.sql().execute(createTableSql());
// First transaction.
StringBuilder sqlInsert = new StringBuilder("INSERT INTO " + TABLE_NAME + " (key, val) VALUES \n");
@@ -139,7 +138,7 @@ public class ItRebalanceWithPartitionReturnTest extends ClusterPerTestIntegratio
}
}
- node0.sql().execute(null, sqlInsert.toString());
+ node0.sql().execute(sqlInsert.toString());
// Second transaction.
sqlInsert = new StringBuilder("INSERT INTO " + TABLE_NAME + " (key, val) VALUES \n");
@@ -151,10 +150,10 @@ public class ItRebalanceWithPartitionReturnTest extends ClusterPerTestIntegratio
}
}
- node0.sql().execute(null, sqlInsert.toString());
+ node0.sql().execute(sqlInsert.toString());
String changedFilter = "$[?(@.region == \"US\")]";
- node0.sql().execute(null, alterZoneSql(changedFilter));
+ node0.sql().execute(alterZoneSql(changedFilter));
IgniteImpl igniteImpl = unwrapIgniteImpl(node0);
TableImpl tableImpl = unwrapTableImpl(node0.tables().table(TABLE_NAME));
@@ -197,7 +196,7 @@ public class ItRebalanceWithPartitionReturnTest extends ClusterPerTestIntegratio
// Check count.
countThroughJdbc(rowCount);
- try (ResultSet<SqlRow> rs = node0.sql().execute(null, "SELECT COUNT(*) FROM " + TABLE_NAME)) {
+ try (ResultSet<SqlRow> rs = node0.sql().execute("SELECT COUNT(*) FROM " + TABLE_NAME)) {
SqlRow row = rs.next();
log.info("SRV result is " + row.longValue(0));
assertEquals(rowCount, row.longValue(0));
@@ -221,7 +220,7 @@ public class ItRebalanceWithPartitionReturnTest extends ClusterPerTestIntegratio
.filter(Objects::nonNull)
.count();
- node0.sql().execute(null, alterZoneSql(DEFAULT_FILTER));
+ node0.sql().execute(alterZoneSql(DEFAULT_FILTER));
assertTrue(waitForCondition(() -> {
Set<String> nodeNames = new HashSet<>();
@@ -253,13 +252,13 @@ public class ItRebalanceWithPartitionReturnTest extends ClusterPerTestIntegratio
// Check count.
countThroughJdbc(rowCount);
- try (ResultSet<SqlRow> rs = node0.sql().execute(null, "SELECT COUNT(*) FROM " + TABLE_NAME)) {
+ try (ResultSet<SqlRow> rs = node0.sql().execute("SELECT COUNT(*) FROM " + TABLE_NAME)) {
SqlRow row = rs.next();
log.info("SRV result is " + row.longValue(0));
assertEquals(rowCount, row.longValue(0));
}
- try (ResultSet<SqlRow> rs = node0.sql().execute(null, "SELECT * FROM " + TABLE_NAME + " order by key limit 10;")) {
+ try (ResultSet<SqlRow> rs = node0.sql().execute("SELECT * FROM " + TABLE_NAME + " order by key limit 10;")) {
while (rs.hasNext()) {
SqlRow row = rs.next();
log.info("Rows: " + row.intValue(0) + ", " + row.stringValue(1));
diff --git a/modules/runner/src/main/java/org/apache/ignite/internal/restart/RestartProofKeyValueView.java b/modules/runner/src/main/java/org/apache/ignite/internal/restart/RestartProofKeyValueView.java
index ac61c014ccf..9d2665d6adc 100644
--- a/modules/runner/src/main/java/org/apache/ignite/internal/restart/RestartProofKeyValueView.java
+++ b/modules/runner/src/main/java/org/apache/ignite/internal/restart/RestartProofKeyValueView.java
@@ -172,8 +172,8 @@ class RestartProofKeyValueView<K, V> extends RestartProofApiObject<KeyValueView<
}
@Override
- public boolean remove(@Nullable Transaction tx, K key, V val) {
- return attached(view -> view.remove(tx, key, val));
+ public boolean removeExact(@Nullable Transaction tx, K key, V val) {
+ return attached(view -> view.removeExact(tx, key, val));
}
@Override
@@ -182,8 +182,8 @@ class RestartProofKeyValueView<K, V> extends RestartProofApiObject<KeyValueView<
}
@Override
- public CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, V val) {
- return attachedAsync(view -> view.removeAsync(tx, key, val));
+ public CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, K key, V val) {
+ return attachedAsync(view -> view.removeExactAsync(tx, key, val));
}
@Override
@@ -233,8 +233,8 @@ class RestartProofKeyValueView<K, V> extends RestartProofApiObject<KeyValueView<
}
@Override
- public boolean replace(@Nullable Transaction tx, K key, @Nullable V oldValue, @Nullable V newValue) {
- return attached(view -> view.replace(tx, key, oldValue, newValue));
+ public boolean replaceExact(@Nullable Transaction tx, K key, @Nullable V oldValue, @Nullable V newValue) {
+ return attached(view -> view.replaceExact(tx, key, oldValue, newValue));
}
@Override
@@ -243,8 +243,8 @@ class RestartProofKeyValueView<K, V> extends RestartProofApiObject<KeyValueView<
}
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
- return attachedAsync(view -> view.replaceAsync(tx, key, oldVal, newVal));
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
+ return attachedAsync(view -> view.replaceExactAsync(tx, key, oldVal, newVal));
}
@Override
diff --git a/modules/runner/src/main/java/org/apache/ignite/internal/restart/RestartProofRecordView.java b/modules/runner/src/main/java/org/apache/ignite/internal/restart/RestartProofRecordView.java
index 0fc37d3919b..ab62ffb958d 100644
--- a/modules/runner/src/main/java/org/apache/ignite/internal/restart/RestartProofRecordView.java
+++ b/modules/runner/src/main/java/org/apache/ignite/internal/restart/RestartProofRecordView.java
@@ -145,8 +145,8 @@ class RestartProofRecordView<R> extends RestartProofApiObject<RecordView<R>> imp
}
@Override
- public boolean replace(@Nullable Transaction tx, R oldRec, R newRec) {
- return attached(view -> view.replace(tx, oldRec, newRec));
+ public boolean replaceExact(@Nullable Transaction tx, R oldRec, R newRec) {
+ return attached(view -> view.replaceExact(tx, oldRec, newRec));
}
@Override
@@ -155,8 +155,8 @@ class RestartProofRecordView<R> extends RestartProofApiObject<RecordView<R>> imp
}
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, R oldRec, R newRec) {
- return attachedAsync(view -> view.replaceAsync(tx, oldRec, newRec));
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, R oldRec, R newRec) {
+ return attachedAsync(view -> view.replaceExactAsync(tx, oldRec, newRec));
}
@Override
diff --git a/modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java b/modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java
index b5e68ecf8d8..c64d7713942 100644
--- a/modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java
+++ b/modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java
@@ -718,7 +718,7 @@ public class Cluster {
*/
public <T> T query(int nodeIndex, String sql, Function<ResultSet<SqlRow>, T> extractor) {
return doInSession(nodeIndex, session -> {
- try (ResultSet<SqlRow> resultSet = session.execute(null, sql)) {
+ try (ResultSet<SqlRow> resultSet = session.execute(sql)) {
return extractor.apply(resultSet);
}
});
diff --git a/modules/spring/spring-boot-starter-ignite-client-example/src/main/java/org/apache/ignite/customizer/example/ExampleApplicationWithCustomAuthenticator.java b/modules/spring/spring-boot-starter-ignite-client-example/src/main/java/org/apache/ignite/customizer/example/ExampleApplicationWithCustomAuthenticator.java
index 8ea2cbb9914..61c0c14dd9d 100644
--- a/modules/spring/spring-boot-starter-ignite-client-example/src/main/java/org/apache/ignite/customizer/example/ExampleApplicationWithCustomAuthenticator.java
+++ b/modules/spring/spring-boot-starter-ignite-client-example/src/main/java/org/apache/ignite/customizer/example/ExampleApplicationWithCustomAuthenticator.java
@@ -55,8 +55,8 @@ public class ExampleApplicationWithCustomAuthenticator {
private IgniteClient client;
@Override public void run(ApplicationArguments args) throws Exception {
- client.sql().execute(null, "CREATE TABLE IF NOT EXISTS Person (id INT PRIMARY KEY, name VARCHAR)");
- client.sql().execute(null, "INSERT INTO Person (id, name) values (1, 'John')");
+ client.sql().execute("CREATE TABLE IF NOT EXISTS Person (id INT PRIMARY KEY, name VARCHAR)");
+ client.sql().execute("INSERT INTO Person (id, name) values (1, 'John')");
}
};
diff --git a/modules/spring/spring-boot-starter-ignite-client-example/src/main/java/org/apache/ignite/example/ExampleApplication.java b/modules/spring/spring-boot-starter-ignite-client-example/src/main/java/org/apache/ignite/example/ExampleApplication.java
index cf1088c2e6b..c7598d3badc 100644
--- a/modules/spring/spring-boot-starter-ignite-client-example/src/main/java/org/apache/ignite/example/ExampleApplication.java
+++ b/modules/spring/spring-boot-starter-ignite-client-example/src/main/java/org/apache/ignite/example/ExampleApplication.java
@@ -45,8 +45,8 @@ public class ExampleApplication {
private IgniteClient client;
@Override public void run(ApplicationArguments args) throws Exception {
- client.sql().execute(null, "CREATE TABLE IF NOT EXISTS Person (id INT PRIMARY KEY, name VARCHAR)");
- client.sql().execute(null, "INSERT INTO Person (id, name) values (1, 'John')");
+ client.sql().execute("CREATE TABLE IF NOT EXISTS Person (id INT PRIMARY KEY, name VARCHAR)");
+ client.sql().execute("INSERT INTO Person (id, name) values (1, 'John')");
}
};
diff --git a/modules/spring/spring-boot-starter-ignite-client-example/src/test/java/org/apache/ignite/ExampleApplicationTest.java b/modules/spring/spring-boot-starter-ignite-client-example/src/test/java/org/apache/ignite/ExampleApplicationTest.java
index 0c3634e98ed..ae8d93df937 100644
--- a/modules/spring/spring-boot-starter-ignite-client-example/src/test/java/org/apache/ignite/ExampleApplicationTest.java
+++ b/modules/spring/spring-boot-starter-ignite-client-example/src/test/java/org/apache/ignite/ExampleApplicationTest.java
@@ -100,7 +100,7 @@ public class ExampleApplicationTest {
private void verifyApplicationRun() {
boolean tableExists = cluster.aliveNode().tables().tables().stream().anyMatch(t -> t.qualifiedName().objectName().equals("PERSON"));
- ResultSet<SqlRow> resultSet = cluster.aliveNode().sql().execute(null, "SELECT COUNT(*) FROM PERSON");
+ ResultSet<SqlRow> resultSet = cluster.aliveNode().sql().execute("SELECT COUNT(*) FROM PERSON");
long rowsCount = resultSet.next().longValue(0);
assertTrue(tableExists);
diff --git a/modules/spring/spring-data-ignite/src/test/java/org/apache/ignite/data/SpringDataJdbcTest.java b/modules/spring/spring-data-ignite/src/test/java/org/apache/ignite/data/SpringDataJdbcTest.java
index 33ae5acec66..c861f2611d4 100644
--- a/modules/spring/spring-data-ignite/src/test/java/org/apache/ignite/data/SpringDataJdbcTest.java
+++ b/modules/spring/spring-data-ignite/src/test/java/org/apache/ignite/data/SpringDataJdbcTest.java
@@ -89,7 +89,7 @@ public class SpringDataJdbcTest extends BaseIgniteAbstractTest {
cluster = new Cluster(clusterConfiguration);
cluster.startAndInit(1);
- cluster.aliveNode().sql().execute(null, "CREATE TABLE IF NOT EXISTS Person ("
+ cluster.aliveNode().sql().execute("CREATE TABLE IF NOT EXISTS Person ("
+ " id INT,"
+ " name VARCHAR,"
+ " flag BOOLEAN,"
@@ -98,18 +98,18 @@ public class SpringDataJdbcTest extends BaseIgniteAbstractTest {
+ " Primary key(id)"
+ ");");
- cluster.aliveNode().sql().execute(null, "CREATE TABLE IF NOT EXISTS ROOT ("
+ cluster.aliveNode().sql().execute("CREATE TABLE IF NOT EXISTS ROOT ("
+ " ID BIGINT PRIMARY KEY,"
+ " NAME VARCHAR(100)"
+ ");");
- cluster.aliveNode().sql().execute(null, "CREATE TABLE IF NOT EXISTS INTERMEDIATE ("
+ cluster.aliveNode().sql().execute("CREATE TABLE IF NOT EXISTS INTERMEDIATE ("
+ " ID BIGINT PRIMARY KEY,"
+ " NAME VARCHAR(100),"
+ " ROOT BIGINT,"
+ " ROOT_ID BIGINT,"
+ " ROOT_KEY INTEGER"
+ ");");
- cluster.aliveNode().sql().execute(null, "CREATE TABLE IF NOT EXISTS LEAF ("
+ cluster.aliveNode().sql().execute("CREATE TABLE IF NOT EXISTS LEAF ("
+ " ID BIGINT PRIMARY KEY,"
+ " NAME VARCHAR(100),"
+ " INTERMEDIATE BIGINT,"
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItCommonApiTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItCommonApiTest.java
index cfac3650d8c..8d5094e17dd 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItCommonApiTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItCommonApiTest.java
@@ -93,7 +93,7 @@ public class ItCommonApiTest extends BaseSqlIntegrationTest {
sql(format("INSERT INTO timestamps VALUES (101, TIMESTAMP '{}', TIMESTAMP WITH LOCAL TIME ZONE '{}')", tsValue, tsValue));
// for projection pop up
- ResultSet<SqlRow> res = igniteSql().execute(null, "SELECT i, i_tz, id FROM timestamps");
+ ResultSet<SqlRow> res = igniteSql().execute("SELECT i, i_tz, id FROM timestamps");
SqlRow row = res.next();
@@ -102,7 +102,7 @@ public class ItCommonApiTest extends BaseSqlIntegrationTest {
String query = "select \"KEY\", \"TIMESTAMP\", \"TIMESTAMP_TZ\" from TBL_ALL_COLUMNS_SQL ORDER BY KEY";
- res = igniteSql().execute(null, query);
+ res = igniteSql().execute(query);
row = res.next();
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlApiBaseTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlApiBaseTest.java
index d6096b668ac..a55e9adf73b 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlApiBaseTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlApiBaseTest.java
@@ -569,7 +569,7 @@ public abstract class ItSqlApiBaseTest extends BaseSqlIntegrationTest {
IgniteSql sql = igniteSql();
for (int i = 0; i < ROW_COUNT; ++i) {
- sql.execute(null, "INSERT INTO TEST VALUES (?, ?)", i, i);
+ sql.execute("INSERT INTO TEST VALUES (?, ?)", i, i);
}
Statement statement = sql.statementBuilder()
@@ -905,7 +905,7 @@ public abstract class ItSqlApiBaseTest extends BaseSqlIntegrationTest {
long momentBefore = Instant.now().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
- ResultSet<SqlRow> resultSet = igniteSql().execute(null, builder.build());
+ ResultSet<SqlRow> resultSet = igniteSql().execute((Transaction) null, builder.build());
SqlRow row = resultSet.next();
long momentAfter = Instant.now().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
@@ -1047,7 +1047,7 @@ public abstract class ItSqlApiBaseTest extends BaseSqlIntegrationTest {
.build();
CancelHandle cancelHandle = CancelHandle.create();
- CompletableFuture<?> fut = sql.executeAsync(null, cancelHandle.token(), statement);
+ CompletableFuture<?> fut = sql.executeAsync((Transaction) null, cancelHandle.token(), statement);
// Wait until the query starts executing.
waitUntilRunningQueriesCount(greaterThan(0));
@@ -1143,7 +1143,7 @@ public abstract class ItSqlApiBaseTest extends BaseSqlIntegrationTest {
String killQuery = "KILL QUERY '" + existingQuery + '\'';
// Kill existing query.
- try (ResultSet<SqlRow> killResultset = sql.execute(null, killQuery)) {
+ try (ResultSet<SqlRow> killResultset = sql.execute(killQuery)) {
assertThat(killResultset.hasRowSet(), is(false));
assertThat(killResultset.wasApplied(), is(true));
}
@@ -1161,7 +1161,7 @@ public abstract class ItSqlApiBaseTest extends BaseSqlIntegrationTest {
);
// Kill non-existing query.
- try (ResultSet<SqlRow> killResultset = sql.execute(null, killQuery)) {
+ try (ResultSet<SqlRow> killResultset = sql.execute(killQuery)) {
assertThat(killResultset.hasRowSet(), is(false));
assertThat(killResultset.wasApplied(), is(false));
}
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java
index f1accf7d942..91f7daa00b5 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java
@@ -68,7 +68,7 @@ public class ItSqlAsynchronousApiTest extends ItSqlApiBaseTest {
IgniteSql sql = igniteSql();
for (int i = 0; i < ROW_COUNT; ++i) {
- sql.execute(null, "INSERT INTO TEST VALUES (?, ?)", i, i);
+ sql.execute("INSERT INTO TEST VALUES (?, ?)", i, i);
}
Statement statement = sql.statementBuilder()
@@ -76,7 +76,7 @@ public class ItSqlAsynchronousApiTest extends ItSqlApiBaseTest {
.pageSize(1)
.build();
- AsyncResultSet<SqlRow> ars0 = await(sql.executeAsync(null, statement));
+ AsyncResultSet<SqlRow> ars0 = await(sql.executeAsync((Transaction) null, statement));
var p0 = ars0.currentPage();
AsyncResultSet<SqlRow> ars1 = await(ars0.fetchNextPage());
var p1 = ars1.currentPage();
@@ -116,7 +116,7 @@ public class ItSqlAsynchronousApiTest extends ItSqlApiBaseTest {
// no transaction
executeAndCancel((token) -> {
- return sql.executeAsync(null, token, query);
+ return sql.executeAsync((Transaction) null, token, query);
});
// with transaction
@@ -140,7 +140,7 @@ public class ItSqlAsynchronousApiTest extends ItSqlApiBaseTest {
.query(query)
.build();
- return sql.executeAsync(null, token, statement);
+ return sql.executeAsync((Transaction) null, token, statement);
});
// with transaction
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlClientMetricsTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlClientMetricsTest.java
index 954b2ba58c3..f5e86dcf60b 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlClientMetricsTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlClientMetricsTest.java
@@ -34,6 +34,7 @@ import org.apache.ignite.sql.IgniteSql;
import org.apache.ignite.sql.ResultSet;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.Statement;
+import org.apache.ignite.tx.Transaction;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
@@ -70,7 +71,7 @@ public class ItSqlClientMetricsTest extends BaseSqlIntegrationTest {
@Test
public void testNormalFlow() throws Exception {
- sql.execute(null, "SELECT * from " + DEFAULT_TABLE_NAME);
+ sql.execute("SELECT * from " + DEFAULT_TABLE_NAME);
// default pageSize greater than number of rows in a table, thus cursor will be closed immediately
assertMetricValue(SqlClientMetricSource.METRIC_OPEN_CURSORS, 0);
@@ -80,14 +81,14 @@ public class ItSqlClientMetricsTest extends BaseSqlIntegrationTest {
.pageSize(1)
.build();
- ResultSet<SqlRow> rs1 = sql.execute(null, statement);
+ ResultSet<SqlRow> rs1 = sql.execute((Transaction) null, statement);
assertMetricValue(SqlClientMetricSource.METRIC_OPEN_CURSORS, 1);
rs1.forEachRemaining(c -> {});
assertMetricValue(SqlClientMetricSource.METRIC_OPEN_CURSORS, 0);
- ResultSet<SqlRow> rs2 = sql.execute(null, statement);
- ResultSet<SqlRow> rs3 = sql.execute(null, statement);
+ ResultSet<SqlRow> rs2 = sql.execute((Transaction) null, statement);
+ ResultSet<SqlRow> rs3 = sql.execute((Transaction) null, statement);
assertMetricValue(SqlClientMetricSource.METRIC_OPEN_CURSORS, 2);
@@ -108,10 +109,10 @@ public class ItSqlClientMetricsTest extends BaseSqlIntegrationTest {
assertThrowsSqlException(
Sql.STMT_PARSE_ERR,
"Failed to parse query",
- () -> sql.execute(null, "SELECT * ODINfrom " + DEFAULT_TABLE_NAME));
+ () -> sql.execute("SELECT * ODINfrom " + DEFAULT_TABLE_NAME));
assertMetricValue(SqlClientMetricSource.METRIC_OPEN_CURSORS, 0);
- assertInternalSqlException("Column 'A' not found in any table", () -> sql.execute(null, "SELECT a from " + DEFAULT_TABLE_NAME));
+ assertInternalSqlException("Column 'A' not found in any table", () -> sql.execute("SELECT a from " + DEFAULT_TABLE_NAME));
assertMetricValue(SqlClientMetricSource.METRIC_OPEN_CURSORS, 0);
}
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlClientSynchronousApiTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlClientSynchronousApiTest.java
index 339b2fab18f..e928b91b06e 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlClientSynchronousApiTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlClientSynchronousApiTest.java
@@ -30,6 +30,7 @@ import org.apache.ignite.sql.ResultSet;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.Statement;
import org.apache.ignite.tx.IgniteTransactions;
+import org.apache.ignite.tx.Transaction;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
@@ -77,7 +78,7 @@ public class ItSqlClientSynchronousApiTest extends ItSqlSynchronousApiTest {
.pageSize(1)
.build();
- ResultSet<SqlRow> rs = client0.sql().execute(null, stmt);
+ ResultSet<SqlRow> rs = client0.sql().execute((Transaction) null, stmt);
client0.close();
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlSynchronousApiTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlSynchronousApiTest.java
index 8a9c8f9691c..685a43e1dd2 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlSynchronousApiTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlSynchronousApiTest.java
@@ -72,7 +72,7 @@ public class ItSqlSynchronousApiTest extends ItSqlApiBaseTest {
.query(query)
.build();
- return sql.execute(null, token, statement);
+ return sql.execute((Transaction) null, token, statement);
});
// with transaction
@@ -96,9 +96,7 @@ public class ItSqlSynchronousApiTest extends ItSqlApiBaseTest {
String query = "SELECT * FROM system_range(0, 10000000000)";
// no transaction
- executeAndCancel((token) -> {
- return sql.execute(null, token, query);
- });
+ executeAndCancel((token) -> sql.execute((Transaction) null, token, query));
// with transaction
executeAndCancel((token) -> {
@@ -146,7 +144,7 @@ public class ItSqlSynchronousApiTest extends ItSqlApiBaseTest {
.pageSize(1)
.build();
- try (var ignored = sql.execute(null, stmt)) {
+ try (var ignored = sql.execute((Transaction) null, stmt)) {
// No-op.
}
}
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItLimitOffsetTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItLimitOffsetTest.java
index d7175490a74..230c57aee7e 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItLimitOffsetTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItLimitOffsetTest.java
@@ -52,49 +52,49 @@ public class ItLimitOffsetTest extends BaseSqlIntegrationTest {
BigDecimal moreThanUpperLong = new BigDecimal(Long.MAX_VALUE).add(new BigDecimal(1));
// cache the plan with concrete type param
- igniteSql().execute(null, "SELECT * FROM test OFFSET ? ROWS", new BigDecimal(Long.MAX_VALUE));
+ igniteSql().execute("SELECT * FROM test OFFSET ? ROWS", new BigDecimal(Long.MAX_VALUE));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of offset",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET ? ROWS", new BigDecimal(-1)));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET ? ROWS", new BigDecimal(-1)));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of offset",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET ? ROWS", -1));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET ? ROWS", -1));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of offset",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET ? ROWS", (Object) null));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET ? ROWS", (Object) null));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of offset",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET ? ROWS", moreThanUpperLong));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET ? ROWS", moreThanUpperLong));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of offset",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET ? ROWS", (double) Long.MAX_VALUE + 1));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET ? ROWS", (double) Long.MAX_VALUE + 1));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of offset",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET ? ROWS", (float) Long.MAX_VALUE + 1));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET ? ROWS", (float) Long.MAX_VALUE + 1));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of offset",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET " + moreThanUpperLong + " ROWS"));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET " + moreThanUpperLong + " ROWS"));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of fetch / limit",
- () -> igniteSql().execute(null, "SELECT * FROM test FETCH FIRST " + moreThanUpperLong + " ROWS ONLY"));
+ () -> igniteSql().execute("SELECT * FROM test FETCH FIRST " + moreThanUpperLong + " ROWS ONLY"));
assertThrowsSqlException(Sql.STMT_VALIDATION_ERR, "Illegal value of fetch / limit",
- () -> igniteSql().execute(null, "SELECT * FROM test LIMIT " + moreThanUpperLong));
+ () -> igniteSql().execute("SELECT * FROM test LIMIT " + moreThanUpperLong));
assertThrowsSqlException(Sql.STMT_PARSE_ERR,
"Failed to parse query: Encountered \"-\"",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET -1 ROWS FETCH FIRST -1 ROWS ONLY"));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET -1 ROWS FETCH FIRST -1 ROWS ONLY"));
assertThrowsSqlException(Sql.STMT_PARSE_ERR,
"Failed to parse query: Encountered \"-\"",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET -1 ROWS"));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET -1 ROWS"));
assertThrowsSqlException(Sql.STMT_PARSE_ERR, "Failed to parse query: Encountered \"-\"",
- () -> igniteSql().execute(null, "SELECT * FROM test FETCH FIRST -1 ROWS ONLY"));
+ () -> igniteSql().execute("SELECT * FROM test FETCH FIRST -1 ROWS ONLY"));
assertThrowsSqlException(Sql.STMT_PARSE_ERR,
"Failed to parse query: Encountered \"+\"",
- () -> igniteSql().execute(null, "SELECT * FROM test OFFSET 2+1 ROWS"));
+ () -> igniteSql().execute("SELECT * FROM test OFFSET 2+1 ROWS"));
}
/**
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItMetadataTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItMetadataTest.java
index b31dc55e55d..401ead4d050 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItMetadataTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItMetadataTest.java
@@ -274,7 +274,7 @@ public class ItMetadataTest extends BaseSqlIntegrationTest {
sql("INSERT INTO sens VALUES (1, 1, 1, 1)");
- ResultSet<SqlRow> res = igniteSql().execute(null, "select * from sens");
+ ResultSet<SqlRow> res = igniteSql().execute("select * from sens");
SqlRow row = res.next();
assertNotNull(row.intValue("\"Col1\""));
assertThrows(IllegalArgumentException.class, () -> row.intValue("col1"));
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItNotNullConstraintTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItNotNullConstraintTest.java
index 278cff9a2d8..340aa59564c 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItNotNullConstraintTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItNotNullConstraintTest.java
@@ -39,6 +39,7 @@ import org.apache.ignite.table.KeyValueView;
import org.apache.ignite.table.RecordView;
import org.apache.ignite.table.Table;
import org.apache.ignite.table.Tuple;
+import org.apache.ignite.tx.Transaction;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
@@ -60,7 +61,7 @@ public abstract class ItNotNullConstraintTest extends ClusterPerClassIntegration
protected void runSql(String stmt) {
Ignite ignite = ignite();
- try (ResultSet<SqlRow> rs = ignite.sql().execute(null, stmt)) {
+ try (ResultSet<SqlRow> rs = ignite.sql().execute((Transaction) null, stmt)) {
assertNotNull(rs);
}
}
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItPublicSchemaTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItPublicSchemaTest.java
index 28924e083e4..9f07ddde39c 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItPublicSchemaTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItPublicSchemaTest.java
@@ -28,6 +28,7 @@ import org.apache.ignite.lang.ErrorGroups.Sql;
import org.apache.ignite.sql.IgniteSql;
import org.apache.ignite.sql.ResultSet;
import org.apache.ignite.sql.Statement;
+import org.apache.ignite.tx.Transaction;
import org.junit.jupiter.api.Test;
/**
@@ -86,7 +87,7 @@ public class ItPublicSchemaTest extends ClusterPerTestIntegrationTest {
.defaultSchema(defaultSchema)
.build();
- try (ResultSet<?> rs = sql.execute(null, statement)) {
+ try (ResultSet<?> rs = sql.execute((Transaction) null, statement)) {
assertTrue(rs.hasRowSet() || rs.wasApplied());
}
}
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlConcurrentSchemaModificationTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlConcurrentSchemaModificationTest.java
index a08391e8e1b..b95d67199bb 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlConcurrentSchemaModificationTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlConcurrentSchemaModificationTest.java
@@ -75,7 +75,7 @@ public class ItSqlConcurrentSchemaModificationTest extends BaseSqlIntegrationTes
? "ALTER TABLE t ADD COLUMN val VARCHAR DEFAULT 'abc'"
: "ALTER TABLE t DROP COLUMN val";
- CompletableFuture<AsyncResultSet<SqlRow>> ddlFut = sql.executeAsync(null, ddlQuery);
+ CompletableFuture<AsyncResultSet<SqlRow>> ddlFut = sql.executeAsync(ddlQuery);
Thread.sleep(ThreadLocalRandom.current().nextInt(15) * 10);
@@ -109,7 +109,7 @@ public class ItSqlConcurrentSchemaModificationTest extends BaseSqlIntegrationTes
? "ALTER TABLE t ADD COLUMN val VARCHAR DEFAULT 'abc'"
: "ALTER TABLE t DROP COLUMN val";
- CompletableFuture<AsyncResultSet<SqlRow>> ddlFut = sql.executeAsync(null, ddlQuery);
+ CompletableFuture<AsyncResultSet<SqlRow>> ddlFut = sql.executeAsync(ddlQuery);
Thread.sleep(ThreadLocalRandom.current().nextInt(15) * 10);
int id = i % 10;
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlOperatorsTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlOperatorsTest.java
index 842b536243c..3129d720b9f 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlOperatorsTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlOperatorsTest.java
@@ -411,7 +411,7 @@ public class ItSqlOperatorsTest extends BaseSqlIntegrationTest {
public void testCurrentUser() {
IgniteSql sql = igniteSql();
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT CURRENT_USER")) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT CURRENT_USER")) {
assertEquals(ColumnType.STRING, rs.metadata().columns().get(0).type());
assertTrue(rs.hasNext());
assertEquals(Commons.SYSTEM_USER_NAME, rs.next().stringValue(0));
@@ -421,7 +421,7 @@ public class ItSqlOperatorsTest extends BaseSqlIntegrationTest {
sql("CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR)");
sql("INSERT INTO t1 (id, val) VALUES (1, CURRENT_USER)");
- try (ResultSet<SqlRow> rs = sql.execute(null, "SELECT val FROM t1 WHERE val = CURRENT_USER")) {
+ try (ResultSet<SqlRow> rs = sql.execute("SELECT val FROM t1 WHERE val = CURRENT_USER")) {
assertEquals(ColumnType.STRING, rs.metadata().columns().get(0).type());
assertTrue(rs.hasNext());
assertEquals(Commons.SYSTEM_USER_NAME, rs.next().stringValue(0));
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlQueryEventLogTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlQueryEventLogTest.java
index 973f4bf5a91..1f7ead804b4 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlQueryEventLogTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlQueryEventLogTest.java
@@ -315,7 +315,7 @@ public class ItSqlQueryEventLogTest extends BaseSqlIntegrationTest {
assertThrowsSqlException(
Sql.EXECUTION_CANCELLED_ERR,
QueryCancelledException.TIMEOUT_MSG,
- () -> igniteSql().execute(null, stmt)
+ () -> igniteSql().execute((Transaction) null, stmt)
);
List<String> events = readEvents(2);
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlQueryExecutionMetricsTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlQueryExecutionMetricsTest.java
index 436768a8a50..9f1cb349c9f 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlQueryExecutionMetricsTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlQueryExecutionMetricsTest.java
@@ -50,6 +50,7 @@ import org.apache.ignite.sql.SqlException;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.Statement;
import org.apache.ignite.sql.async.AsyncResultSet;
+import org.apache.ignite.tx.Transaction;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -138,7 +139,7 @@ public class ItSqlQueryExecutionMetricsTest extends BaseSqlIntegrationTest {
CancelHandle cancelHandle = CancelHandle.create();
assertMetricIncreased(() -> assertThrows(CompletionException.class, () -> {
- CompletableFuture<AsyncResultSet<SqlRow>> f = sql.executeAsync(null, cancelHandle.token(),
+ CompletableFuture<AsyncResultSet<SqlRow>> f = sql.executeAsync((Transaction) null, cancelHandle.token(),
"SELECT x FROM system_range(1, 10000000000)");
cancelHandle.cancelAsync();
f.join();
@@ -165,7 +166,7 @@ public class ItSqlQueryExecutionMetricsTest extends BaseSqlIntegrationTest {
.queryTimeout(timeoutSeconds, timeoutUnit)
.build();
- try (ResultSet<SqlRow> rs = sql.execute(null, statement)) {
+ try (ResultSet<SqlRow> rs = sql.execute((Transaction) null, statement)) {
timeoutUnit.sleep(timeoutSeconds);
// Triggers timeout
while (rs.hasNext()) {
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/kill/ItSqlKillCommandTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/kill/ItSqlKillCommandTest.java
index 6ce4cc0621b..bf07e4b31b2 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/kill/ItSqlKillCommandTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/kill/ItSqlKillCommandTest.java
@@ -109,7 +109,7 @@ public class ItSqlKillCommandTest extends BaseSqlIntegrationTest {
SqlException.class,
Sql.RUNTIME_ERR,
format("Invalid operation ID format [operationId=123, type={}]", type),
- () -> await(igniteSql().executeAsync(null, format("KILL {} '123' NO WAIT", type)))
+ () -> await(igniteSql().executeAsync(format("KILL {} '123' NO WAIT", type)))
);
assertThat(err.getCause(), instanceOf(IllegalArgumentException.class));
@@ -293,7 +293,7 @@ public class ItSqlKillCommandTest extends BaseSqlIntegrationTest {
private static boolean executeKill(Ignite node, CancellableOperationType type, UUID queryId, boolean noWait) {
String query = format("KILL {} '{}'{}", type, queryId, noWait ? " NO WAIT" : "");
- try (ResultSet<SqlRow> res = node.sql().execute(null, query)) {
+ try (ResultSet<SqlRow> res = node.sql().execute(query)) {
assertThat(res.hasRowSet(), is(false));
return res.wasApplied();
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/ScriptContext.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/ScriptContext.java
index 958fa16ca01..b79fc704315 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/ScriptContext.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/ScriptContext.java
@@ -35,6 +35,7 @@ import org.apache.ignite.sql.IgniteSql;
import org.apache.ignite.sql.ResultSet;
import org.apache.ignite.sql.SqlRow;
import org.apache.ignite.sql.Statement;
+import org.apache.ignite.tx.Transaction;
import org.jetbrains.annotations.Nullable;
/**
@@ -94,7 +95,7 @@ final class ScriptContext {
statement = statement.timeZoneId(timeZone);
}
- try (ResultSet<SqlRow> rs = ignSql.execute(null, statement.build())) {
+ try (ResultSet<SqlRow> rs = ignSql.execute((Transaction) null, statement.build())) {
if (rs.hasRowSet()) {
List<List<?>> out = new ArrayList<>();
diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/threading/ItSqlApiThreadingTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/threading/ItSqlApiThreadingTest.java
index 42dca2ed356..12e9b9c47ac 100644
--- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/threading/ItSqlApiThreadingTest.java
+++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/threading/ItSqlApiThreadingTest.java
@@ -43,6 +43,7 @@ import org.apache.ignite.sql.Statement;
import org.apache.ignite.sql.async.AsyncResultSet;
import org.apache.ignite.table.KeyValueView;
import org.apache.ignite.table.Table;
+import org.apache.ignite.tx.Transaction;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
@@ -128,7 +129,7 @@ class ItSqlApiThreadingTest extends ClusterPerClassIntegrationTest {
// cursor even after we call its second page.
Statement statement = igniteSql.statementBuilder().query(SELECT_QUERY).pageSize(1).build();
- return igniteSql.executeAsync(null, statement).get(10, SECONDS);
+ return igniteSql.executeAsync((Transaction) null, statement).get(10, SECONDS);
}
@ParameterizedTest
@@ -190,8 +191,8 @@ class ItSqlApiThreadingTest extends ClusterPerClassIntegrationTest {
}
private enum SqlAsyncOperation {
- EXECUTE_QUERY_ASYNC(sql -> sql.executeAsync(null, SELECT_QUERY)),
- EXECUTE_STATEMENT_ASYNC(sql -> sql.executeAsync(null, sql.createStatement(SELECT_QUERY))),
+ EXECUTE_QUERY_ASYNC(sql -> sql.executeAsync(SELECT_QUERY)),
+ EXECUTE_STATEMENT_ASYNC(sql -> sql.executeAsync((Transaction) null, sql.createStatement(SELECT_QUERY))),
// TODO: IGNITE-18695 - uncomment 2 following lines.
// EXECUTE_QUERY_WITH_MAPPER_ASYNC(sql -> sql.executeAsync(null, (Mapper<?>) null, SELECT_QUERY)),
// EXECUTE_STATEMENT_WITH_MAPPER_ASYNC(sql -> sql.executeAsync(null, (Mapper<?>) null, sql.createStatement(SELECT_QUERY))),
diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/api/IgniteSqlImplTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/api/IgniteSqlImplTest.java
index 342c47aa0bc..e87ae585ca7 100644
--- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/api/IgniteSqlImplTest.java
+++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/api/IgniteSqlImplTest.java
@@ -102,7 +102,7 @@ class IgniteSqlImplTest extends BaseIgniteAbstractTest {
when(queryProcessor.queryAsync(any(), any(), any(), any(), any(), any(Object[].class)))
.thenReturn(completedFuture(result));
- AsyncResultSet<?> rs = await(igniteSql.executeAsync(null, "SELECT 1"));
+ AsyncResultSet<?> rs = await(igniteSql.executeAsync("SELECT 1"));
assertThat(rs, notNullValue());
assertThat(igniteSql.openedCursors(), hasSize(1));
@@ -125,7 +125,7 @@ class IgniteSqlImplTest extends BaseIgniteAbstractTest {
when(queryProcessor.queryAsync(any(), any(), any(), any(), any(), any(Object[].class)))
.thenReturn(completedFuture(result));
- AsyncResultSet<?> rs = await(igniteSql.executeAsync(null, "SELECT 1"));
+ AsyncResultSet<?> rs = await(igniteSql.executeAsync("SELECT 1"));
assertThat(rs, notNullValue());
assertThat(igniteSql.openedCursors(), hasSize(1));
@@ -146,7 +146,7 @@ class IgniteSqlImplTest extends BaseIgniteAbstractTest {
return cursorFuture;
});
- CompletableFuture<?> result = igniteSql.executeAsync(null, "SELECT 1");
+ CompletableFuture<?> result = igniteSql.executeAsync("SELECT 1");
assertThat(executeQueryLatch.await(5, TimeUnit.SECONDS), is(true));
@@ -236,7 +236,7 @@ class IgniteSqlImplTest extends BaseIgniteAbstractTest {
when(queryProcessor.queryAsync(any(), any(), any(), any(), any(), any(Object[].class)))
.thenReturn(completedFuture(result));
- AsyncResultSet<?> rs = await(igniteSql.executeAsync(null, "SELECT 1"));
+ AsyncResultSet<?> rs = await(igniteSql.executeAsync("SELECT 1"));
assertThat(rs, notNullValue());
assertThat(igniteSql.openedCursors(), hasSize(1));
diff --git a/modules/table/src/integrationTest/java/org/apache/ignite/internal/table/AsyncApiKeyValueViewAdapter.java b/modules/table/src/integrationTest/java/org/apache/ignite/internal/table/AsyncApiKeyValueViewAdapter.java
index e4a40d278c4..64e92d3ec4f 100644
--- a/modules/table/src/integrationTest/java/org/apache/ignite/internal/table/AsyncApiKeyValueViewAdapter.java
+++ b/modules/table/src/integrationTest/java/org/apache/ignite/internal/table/AsyncApiKeyValueViewAdapter.java
@@ -113,8 +113,8 @@ public class AsyncApiKeyValueViewAdapter<K, V> implements KeyValueView<K, V> {
}
@Override
- public boolean remove(@Nullable Transaction tx, K key, V val) {
- return await(delegate.removeAsync(tx, key, val));
+ public boolean removeExact(@Nullable Transaction tx, K key, V val) {
+ return await(delegate.removeExactAsync(tx, key, val));
}
@Override
@@ -138,8 +138,8 @@ public class AsyncApiKeyValueViewAdapter<K, V> implements KeyValueView<K, V> {
}
@Override
- public boolean replace(@Nullable Transaction tx, K key, @Nullable V oldValue, @Nullable V newValue) {
- return await(delegate.replaceAsync(tx, key, oldValue, newValue));
+ public boolean replaceExact(@Nullable Transaction tx, K key, @Nullable V oldValue, @Nullable V newValue) {
+ return await(delegate.replaceExactAsync(tx, key, oldValue, newValue));
}
@Override
@@ -213,7 +213,7 @@ public class AsyncApiKeyValueViewAdapter<K, V> implements KeyValueView<K, V> {
}
@Override
- public CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, V val) {
+ public CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, K key, V val) {
throw new UnsupportedOperationException("Must not be called");
}
@@ -248,7 +248,7 @@ public class AsyncApiKeyValueViewAdapter<K, V> implements KeyValueView<K, V> {
}
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
throw new UnsupportedOperationException("Must not be called");
}
diff --git a/modules/table/src/integrationTest/java/org/apache/ignite/internal/table/AsyncApiRecordViewAdapter.java b/modules/table/src/integrationTest/java/org/apache/ignite/internal/table/AsyncApiRecordViewAdapter.java
index fd8d971b9d3..ccd7c5bee54 100644
--- a/modules/table/src/integrationTest/java/org/apache/ignite/internal/table/AsyncApiRecordViewAdapter.java
+++ b/modules/table/src/integrationTest/java/org/apache/ignite/internal/table/AsyncApiRecordViewAdapter.java
@@ -101,8 +101,8 @@ public class AsyncApiRecordViewAdapter<V> implements RecordView<V> {
}
@Override
- public boolean replace(@Nullable Transaction tx, V oldRec, V newRec) {
- return await(delegate.replaceAsync(tx, oldRec, newRec));
+ public boolean replaceExact(@Nullable Transaction tx, V oldRec, V newRec) {
+ return await(delegate.replaceExactAsync(tx, oldRec, newRec));
}
@Override
@@ -191,7 +191,7 @@ public class AsyncApiRecordViewAdapter<V> implements RecordView<V> {
}
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, V oldRec, V newRec) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, V oldRec, V newRec) {
throw new UnsupportedOperationException("Must not be called");
}
diff --git a/modules/table/src/integrationTest/java/org/apache/ignite/internal/threading/ItKvRecordApiThreadingTest.java b/modules/table/src/integrationTest/java/org/apache/ignite/internal/threading/ItKvRecordApiThreadingTest.java
index 8cf14cf6ed2..f53e97acf0f 100644
--- a/modules/table/src/integrationTest/java/org/apache/ignite/internal/threading/ItKvRecordApiThreadingTest.java
+++ b/modules/table/src/integrationTest/java/org/apache/ignite/internal/threading/ItKvRecordApiThreadingTest.java
@@ -319,12 +319,12 @@ class ItKvRecordApiThreadingTest extends ClusterPerClassIntegrationTest {
GET_NULLABLE_AND_PUT_ASYNC((view, context) -> view.getNullableAndPutAsync(null, context.key, context.usualValue)),
PUT_IF_ABSENT_ASYNC((view, context) -> view.putIfAbsentAsync(null, context.key, context.usualValue)),
REMOVE_ASYNC((view, context) -> view.removeAsync(null, context.key)),
- REMOVE_EXACT_ASYNC((view, context) -> view.removeAsync(null, context.key, context.usualValue)),
+ REMOVE_EXACT_ASYNC((view, context) -> view.removeExactAsync(null, context.key, context.usualValue)),
REMOVE_ALL_ASYNC((view, context) -> view.removeAllAsync(null, List.of(context.key))),
GET_AND_REMOVE_ASYNC((view, context) -> view.getAndRemoveAsync(null, context.key)),
GET_NULLABLE_AND_REMOVE_ASYNC((view, context) -> view.getNullableAndRemoveAsync(null, context.key)),
REPLACE_ASYNC((view, context) -> view.replaceAsync(null, context.key, context.usualValue)),
- REPLACE_EXACT_ASYNC((view, context) -> view.replaceAsync(null, context.key, context.usualValue, context.anotherValue)),
+ REPLACE_EXACT_ASYNC((view, context) -> view.replaceExactAsync(null, context.key, context.usualValue, context.anotherValue)),
GET_AND_REPLACE_ASYNC((view, context) -> view.getAndReplaceAsync(null, context.key, context.usualValue)),
GET_NULLABLE_AND_REPLACE_ASYNC((view, context) -> view.getNullableAndReplaceAsync(null, context.key, context.usualValue)),
STREAM_DATA((view, context) -> {
diff --git a/modules/table/src/main/java/org/apache/ignite/internal/table/KeyValueBinaryViewImpl.java b/modules/table/src/main/java/org/apache/ignite/internal/table/KeyValueBinaryViewImpl.java
index e47242d107e..d58c8894a23 100644
--- a/modules/table/src/main/java/org/apache/ignite/internal/table/KeyValueBinaryViewImpl.java
+++ b/modules/table/src/main/java/org/apache/ignite/internal/table/KeyValueBinaryViewImpl.java
@@ -298,8 +298,8 @@ public class KeyValueBinaryViewImpl extends AbstractTableView<Entry<Tuple, Tuple
/** {@inheritDoc} */
@Override
- public boolean remove(@Nullable Transaction tx, Tuple key, Tuple val) {
- return sync(removeAsync(tx, key, val));
+ public boolean removeExact(@Nullable Transaction tx, Tuple key, Tuple val) {
+ return sync(removeExactAsync(tx, key, val));
}
/** {@inheritDoc} */
@@ -316,7 +316,7 @@ public class KeyValueBinaryViewImpl extends AbstractTableView<Entry<Tuple, Tuple
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, Tuple key, Tuple val) {
+ public CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, Tuple key, Tuple val) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(val, "val");
@@ -398,8 +398,8 @@ public class KeyValueBinaryViewImpl extends AbstractTableView<Entry<Tuple, Tuple
/** {@inheritDoc} */
@Override
- public boolean replace(@Nullable Transaction tx, Tuple key, Tuple oldVal, Tuple newVal) {
- return sync(replaceAsync(tx, key, oldVal, newVal));
+ public boolean replaceExact(@Nullable Transaction tx, Tuple key, Tuple oldVal, Tuple newVal) {
+ return sync(replaceExactAsync(tx, key, oldVal, newVal));
}
/** {@inheritDoc} */
@@ -417,7 +417,7 @@ public class KeyValueBinaryViewImpl extends AbstractTableView<Entry<Tuple, Tuple
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> replaceAsync(
+ public CompletableFuture<Boolean> replaceExactAsync(
@Nullable Transaction tx,
Tuple key,
Tuple oldVal,
diff --git a/modules/table/src/main/java/org/apache/ignite/internal/table/KeyValueViewImpl.java b/modules/table/src/main/java/org/apache/ignite/internal/table/KeyValueViewImpl.java
index 8648a08819c..6f5a91efc93 100644
--- a/modules/table/src/main/java/org/apache/ignite/internal/table/KeyValueViewImpl.java
+++ b/modules/table/src/main/java/org/apache/ignite/internal/table/KeyValueViewImpl.java
@@ -382,8 +382,8 @@ public class KeyValueViewImpl<K, V> extends AbstractTableView<Entry<K, V>> imple
/** {@inheritDoc} */
@Override
- public boolean remove(@Nullable Transaction tx, K key, @Nullable V val) {
- return sync(removeAsync(tx, key, val));
+ public boolean removeExact(@Nullable Transaction tx, K key, @Nullable V val) {
+ return sync(removeExactAsync(tx, key, val));
}
/** {@inheritDoc} */
@@ -400,7 +400,7 @@ public class KeyValueViewImpl<K, V> extends AbstractTableView<Entry<K, V>> imple
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, @Nullable V val) {
+ public CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, K key, @Nullable V val) {
Objects.requireNonNull(key, "key");
validateNullableValue(val, valueMapper.targetType());
@@ -502,8 +502,8 @@ public class KeyValueViewImpl<K, V> extends AbstractTableView<Entry<K, V>> imple
/** {@inheritDoc} */
@Override
- public boolean replace(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
- return sync(replaceAsync(tx, key, oldVal, newVal));
+ public boolean replaceExact(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
+ return sync(replaceExactAsync(tx, key, oldVal, newVal));
}
/** {@inheritDoc} */
@@ -522,7 +522,7 @@ public class KeyValueViewImpl<K, V> extends AbstractTableView<Entry<K, V>> imple
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
Objects.requireNonNull(key, "key");
validateNullableValue(oldVal, valueMapper.targetType());
diff --git a/modules/table/src/main/java/org/apache/ignite/internal/table/PublicApiThreadingKeyValueView.java b/modules/table/src/main/java/org/apache/ignite/internal/table/PublicApiThreadingKeyValueView.java
index 169eeb7309c..c6abaa288d7 100644
--- a/modules/table/src/main/java/org/apache/ignite/internal/table/PublicApiThreadingKeyValueView.java
+++ b/modules/table/src/main/java/org/apache/ignite/internal/table/PublicApiThreadingKeyValueView.java
@@ -168,8 +168,8 @@ public class PublicApiThreadingKeyValueView<K, V> extends PublicApiThreadingView
}
@Override
- public boolean remove(@Nullable Transaction tx, K key, V val) {
- return executeSyncOp(() -> view.remove(tx, key, val));
+ public boolean removeExact(@Nullable Transaction tx, K key, V val) {
+ return executeSyncOp(() -> view.removeExact(tx, key, val));
}
@Override
@@ -178,8 +178,8 @@ public class PublicApiThreadingKeyValueView<K, V> extends PublicApiThreadingView
}
@Override
- public CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, V val) {
- return executeAsyncOp(() -> view.removeAsync(tx, key, val));
+ public CompletableFuture<Boolean> removeExactAsync(@Nullable Transaction tx, K key, V val) {
+ return executeAsyncOp(() -> view.removeExactAsync(tx, key, val));
}
@Override
@@ -228,8 +228,8 @@ public class PublicApiThreadingKeyValueView<K, V> extends PublicApiThreadingView
}
@Override
- public boolean replace(@Nullable Transaction tx, K key, V oldValue, @Nullable V newValue) {
- return executeSyncOp(() -> view.replace(tx, key, oldValue, newValue));
+ public boolean replaceExact(@Nullable Transaction tx, K key, V oldValue, @Nullable V newValue) {
+ return executeSyncOp(() -> view.replaceExact(tx, key, oldValue, newValue));
}
@Override
@@ -238,8 +238,8 @@ public class PublicApiThreadingKeyValueView<K, V> extends PublicApiThreadingView
}
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
- return executeAsyncOp(() -> view.replaceAsync(tx, key, oldVal, newVal));
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
+ return executeAsyncOp(() -> view.replaceExactAsync(tx, key, oldVal, newVal));
}
@Override
diff --git a/modules/table/src/main/java/org/apache/ignite/internal/table/PublicApiThreadingRecordView.java b/modules/table/src/main/java/org/apache/ignite/internal/table/PublicApiThreadingRecordView.java
index 225432f1ed7..52dc3393ab2 100644
--- a/modules/table/src/main/java/org/apache/ignite/internal/table/PublicApiThreadingRecordView.java
+++ b/modules/table/src/main/java/org/apache/ignite/internal/table/PublicApiThreadingRecordView.java
@@ -147,8 +147,8 @@ public class PublicApiThreadingRecordView<R> extends PublicApiThreadingViewBase<
}
@Override
- public boolean replace(@Nullable Transaction tx, R oldRec, R newRec) {
- return executeSyncOp(() -> view.replace(tx, oldRec, newRec));
+ public boolean replaceExact(@Nullable Transaction tx, R oldRec, R newRec) {
+ return executeSyncOp(() -> view.replaceExact(tx, oldRec, newRec));
}
@Override
@@ -157,8 +157,8 @@ public class PublicApiThreadingRecordView<R> extends PublicApiThreadingViewBase<
}
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, R oldRec, R newRec) {
- return executeAsyncOp(() -> view.replaceAsync(tx, oldRec, newRec));
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, R oldRec, R newRec) {
+ return executeAsyncOp(() -> view.replaceExactAsync(tx, oldRec, newRec));
}
@Override
diff --git a/modules/table/src/main/java/org/apache/ignite/internal/table/RecordBinaryViewImpl.java b/modules/table/src/main/java/org/apache/ignite/internal/table/RecordBinaryViewImpl.java
index caf76c3f74e..76fdd135fc2 100644
--- a/modules/table/src/main/java/org/apache/ignite/internal/table/RecordBinaryViewImpl.java
+++ b/modules/table/src/main/java/org/apache/ignite/internal/table/RecordBinaryViewImpl.java
@@ -268,8 +268,8 @@ public class RecordBinaryViewImpl extends AbstractTableView<Tuple> implements Re
/** {@inheritDoc} */
@Override
- public boolean replace(@Nullable Transaction tx, Tuple oldRec, Tuple newRec) {
- return sync(replaceAsync(tx, oldRec, newRec));
+ public boolean replaceExact(@Nullable Transaction tx, Tuple oldRec, Tuple newRec) {
+ return sync(replaceExactAsync(tx, oldRec, newRec));
}
/** {@inheritDoc} */
@@ -286,7 +286,7 @@ public class RecordBinaryViewImpl extends AbstractTableView<Tuple> implements Re
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, Tuple oldRec, Tuple newRec) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, Tuple oldRec, Tuple newRec) {
Objects.requireNonNull(oldRec);
Objects.requireNonNull(newRec);
diff --git a/modules/table/src/main/java/org/apache/ignite/internal/table/RecordViewImpl.java b/modules/table/src/main/java/org/apache/ignite/internal/table/RecordViewImpl.java
index 5045b9fa271..76592b46319 100644
--- a/modules/table/src/main/java/org/apache/ignite/internal/table/RecordViewImpl.java
+++ b/modules/table/src/main/java/org/apache/ignite/internal/table/RecordViewImpl.java
@@ -277,8 +277,8 @@ public class RecordViewImpl<R> extends AbstractTableView<R> implements RecordVie
/** {@inheritDoc} */
@Override
- public boolean replace(@Nullable Transaction tx, R oldRec, R newRec) {
- return sync(replaceAsync(tx, oldRec, newRec));
+ public boolean replaceExact(@Nullable Transaction tx, R oldRec, R newRec) {
+ return sync(replaceExactAsync(tx, oldRec, newRec));
}
/** {@inheritDoc} */
@@ -295,7 +295,7 @@ public class RecordViewImpl<R> extends AbstractTableView<R> implements RecordVie
/** {@inheritDoc} */
@Override
- public CompletableFuture<Boolean> replaceAsync(@Nullable Transaction tx, R oldRec, R newRec) {
+ public CompletableFuture<Boolean> replaceExactAsync(@Nullable Transaction tx, R oldRec, R newRec) {
Objects.requireNonNull(oldRec);
Objects.requireNonNull(newRec);
diff --git a/modules/transactions/src/integrationTest/java/org/apache/ignite/internal/disaster/ItDisasterRecoveryManagerTest.java b/modules/transactions/src/integrationTest/java/org/apache/ignite/internal/disaster/ItDisasterRecoveryManagerTest.java
index 1da250b61dc..38dcc242662 100644
--- a/modules/transactions/src/integrationTest/java/org/apache/ignite/internal/disaster/ItDisasterRecoveryManagerTest.java
+++ b/modules/transactions/src/integrationTest/java/org/apache/ignite/internal/disaster/ItDisasterRecoveryManagerTest.java
@@ -537,7 +537,7 @@ public class ItDisasterRecoveryManagerTest extends ClusterPerTestIntegrationTest
assertValueOnSpecificNodes(tableName, runningNodes, 0, 0);
for (IgniteImpl igniteImpl : runningNodes) {
- assertEquals(1L, igniteImpl.sql().execute(null, "SELECT count(*) as cnt FROM TABLE_NAME").next().longValue("cnt"));
+ assertEquals(1L, igniteImpl.sql().execute("SELECT count(*) as cnt FROM TABLE_NAME").next().longValue("cnt"));
}
} else {
tx.commit();
@@ -546,7 +546,7 @@ public class ItDisasterRecoveryManagerTest extends ClusterPerTestIntegrationTest
assertValueOnSpecificNodes(tableName, runningNodes, 2, 2);
for (IgniteImpl igniteImpl : runningNodes) {
- assertEquals(2L, igniteImpl.sql().execute(null, "SELECT count(*) as cnt FROM TABLE_NAME").next().longValue("cnt"));
+ assertEquals(2L, igniteImpl.sql().execute("SELECT count(*) as cnt FROM TABLE_NAME").next().longValue("cnt"));
}
}
}
diff --git a/modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/ItMultipleLocksTest.java b/modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/ItMultipleLocksTest.java
index 92980f47bf0..d5b3841bac1 100644
--- a/modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/ItMultipleLocksTest.java
+++ b/modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/ItMultipleLocksTest.java
@@ -37,15 +37,15 @@ public class ItMultipleLocksTest extends ClusterPerTestIntegrationTest {
var node0 = runningNodes().findAny().orElseThrow();
IgniteSql sql = node0.sql();
- sql.execute(null, "CREATE TABLE test("
+ sql.execute("CREATE TABLE test("
+ "c1 INT PRIMARY KEY, c2 INT, c3 INT, c4 INT, c5 INT,"
+ "c6 INT, c7 INT, c8 INT, c9 INT, c10 INT)");
for (int i = 2; i <= 10; i++) {
- sql.execute(null, format("CREATE INDEX c{}_idx ON test (c{})", i, i));
+ sql.execute(format("CREATE INDEX c{}_idx ON test (c{})", i, i));
}
- sql.execute(null, "INSERT INTO test"
+ sql.execute("INSERT INTO test"
+ " SELECT x as c1, x as c2, x as c3, x as c4, x as c5, "
+ " x as c6, x as c7, x as c8, x as c9, x as c10"
+ " FROM TABLE (system_range(1, 20000))");