ptupitsyn commented on code in PR #5836:
URL: https://github.com/apache/ignite-3/pull/5836#discussion_r2704765928


##########
modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java:
##########
@@ -332,13 +681,34 @@ public interface KeyValueView<K, V> extends 
DataStreamerTarget<Entry<K, V>>, Cri
      */
     CompletableFuture<Boolean> removeAsync(@Nullable Transaction tx, K key, V 
val);
 
+    /**
+     * Asynchronously removes from a table an expected value associated with 
the given key.
+     * Opens 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.
+     */
+    default CompletableFuture<Boolean> removeAsync(K key, V val) {

Review Comment:
   Looks like `removeExactAsync` is missing.



##########
modules/api/src/main/java/org/apache/ignite/sql/IgniteSql.java:
##########
@@ -57,6 +57,19 @@ default ResultSet<SqlRow> execute(@Nullable Transaction 
transaction, String quer
         return execute(transaction, (CancellationToken) null, query, 
arguments);
     }
 
+    /**
+     * Executes a single SQL query.
+     * Opens implicit transaction.

Review Comment:
   This implies that the transaction is left open. 
   
   I think we can just remove this part and update javadoc in existing methods 
with `Transaction or {@code null} for implicit transaction.` text like we have 
in `RecordView` and other APIs.



##########
modules/api/src/test/java/org/apache/ignite/table/TableApiConsistencyTest.java:
##########
@@ -0,0 +1,93 @@
+/*
+ * 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 java.lang.reflect.Method;
+import java.lang.reflect.Parameter;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Set;
+import org.apache.ignite.tx.Transaction;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+/**
+ * Test class to verify various requirements to Table API.
+ */
+public class TableApiConsistencyTest {
+
+    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)
+    );
+
+    public TableApiConsistencyTest() throws NoSuchMethodException {
+    }
+
+    /**
+     * Test validates that if method public method requires {@link 
Transaction} parameter then overloaded
+     * method without such parameter should exists.

Review Comment:
   ```suggestion
        * method without such parameter should exist.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to