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

rpuch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 2b7431a878 IGNITE-23216 Remove special handling of getNullable() 
variants from tests of KeyValueView (#4404)
2b7431a878 is described below

commit 2b7431a878716624672a50513db733c91c754f38
Author: Roman Puchkovskiy <[email protected]>
AuthorDate: Tue Sep 17 15:03:04 2024 +0400

    IGNITE-23216 Remove special handling of getNullable() variants from tests 
of KeyValueView (#4404)
    
    getNullable() and its variants now work for binary KeyValueView 
implementations (instead of throwing an UnsupportedOperationException as they 
were doing before IGNITE-23003), so special handling for binary views is 
removed from tests
---
 .../ignite/internal/app/AsyncApiOperation.java     | 10 ++++-----
 .../ignite/internal/app/SyncApiOperation.java      | 10 ++++-----
 .../threading/ItKvRecordApiThreadingTest.java      | 24 ----------------------
 3 files changed, 10 insertions(+), 34 deletions(-)

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 128b964829..c37793ed8b 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
@@ -48,6 +48,7 @@ enum AsyncApiOperation {
     TABLES_TABLE(refs -> refs.tables.tableAsync(TEST_TABLE_NAME)),
 
     KV_VIEW_GET(refs -> refs.kvView.getAsync(null, KEY_TUPLE)),
+    KV_VIEW_GET_NULLABLE(refs -> refs.kvView.getNullableAsync(null, 
KEY_TUPLE)),
     KV_VIEW_GET_OR_DEFAULT(refs -> refs.kvView.getOrDefaultAsync(null, 
KEY_TUPLE, null)),
     KV_VIEW_GET_ALL(refs -> refs.kvView.getAllAsync(null, List.of(KEY_TUPLE))),
     KV_VIEW_CONTAINS(refs -> refs.kvView.containsAsync(null, KEY_TUPLE)),
@@ -55,14 +56,17 @@ enum AsyncApiOperation {
     KV_VIEW_PUT(refs -> refs.kvView.putAsync(null, KEY_TUPLE, VALUE_TUPLE)),
     KV_VIEW_PUT_ALL(refs -> refs.kvView.putAllAsync(null, Map.of(KEY_TUPLE, 
VALUE_TUPLE))),
     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_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_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)),
     KV_VIEW_STREAM_DATA(refs -> {
         CompletableFuture<?> future;
         try (var publisher = new SimplePublisher<Entry<Tuple, Tuple>>()) {
@@ -75,11 +79,7 @@ enum AsyncApiOperation {
     KV_VIEW_QUERY_WITH_INDEX(refs -> refs.kvView.queryAsync(null, null, null)),
     KV_VIEW_QUERY_WITH_OPTIONS(refs -> refs.kvView.queryAsync(null, null, 
null, null)),
 
-    TYPED_KV_VIEW_GET_NULLABLE(refs -> refs.typedKvView.getNullableAsync(null, 
1)),
-    TYPED_KV_VIEW_GET_NULLABLE_AND_PUT(refs -> 
refs.typedKvView.getNullableAndPutAsync(null, 1, "one")),
-    TYPED_KV_VIEW_GET_NULLABLE_AND_REMOVE(refs -> 
refs.typedKvView.getNullableAndRemoveAsync(null, 1)),
-    TYPED_KV_VIEW_GET_NULLABLE_AND_REPLACE(refs -> 
refs.typedKvView.getNullableAndReplaceAsync(null, 1, "one")),
-
+    TYPED_KV_VIEW_GET(refs -> refs.typedKvView.getAsync(null, 1)),
     MAPPED_KV_VIEW_GET(refs -> refs.mappedKvView.getAsync(null, 1)),
 
     RECORD_VIEW_GET(refs -> refs.recordView.getAsync(null, KEY_TUPLE)),
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 d187c139e5..4befa89961 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
@@ -64,6 +64,7 @@ enum SyncApiOperation {
     TABLE_FROM_TABLES_ASYNC_PUT(refs -> 
refs.tableFromTablesAsync.keyValueView().put(null, KEY_TUPLE, VALUE_TUPLE)),
 
     KV_VIEW_GET(refs -> refs.kvView.get(null, KEY_TUPLE)),
+    KV_VIEW_GET_NULLABLE(refs -> refs.kvView.getNullable(null, KEY_TUPLE)),
     KV_VIEW_GET_OR_DEFAULT(refs -> refs.kvView.getOrDefault(null, KEY_TUPLE, 
null)),
     KV_VIEW_GET_ALL(refs -> refs.kvView.getAll(null, List.of(KEY_TUPLE))),
     KV_VIEW_CONTAINS(refs -> refs.kvView.contains(null, KEY_TUPLE)),
@@ -71,23 +72,22 @@ enum SyncApiOperation {
     KV_VIEW_PUT(refs -> refs.kvView.put(null, KEY_TUPLE, VALUE_TUPLE)),
     KV_VIEW_PUT_ALL(refs -> refs.kvView.putAll(null, Map.of(KEY_TUPLE, 
VALUE_TUPLE))),
     KV_VIEW_GET_AND_PUT(refs -> refs.kvView.getAndPut(null, KEY_TUPLE, 
VALUE_TUPLE)),
+    KV_VIEW_GET_NULLABLE_AND_PUT(refs -> refs.kvView.getNullableAndPut(null, 
KEY_TUPLE, VALUE_TUPLE)),
     KV_VIEW_PUT_IF_ABSENT(refs -> refs.kvView.putIfAbsent(null, KEY_TUPLE, 
VALUE_TUPLE)),
     KV_VIEW_REMOVE(refs -> refs.kvView.remove(null, KEY_TUPLE)),
     KV_VIEW_REMOVE_EXACT(refs -> refs.kvView.remove(null, KEY_TUPLE, 
VALUE_TUPLE)),
     KV_VIEW_REMOVE_ALL(refs -> refs.kvView.removeAll(null, 
List.of(KEY_TUPLE))),
     KV_VIEW_GET_AND_REMOVE(refs -> refs.kvView.getAndRemove(null, KEY_TUPLE)),
+    KV_VIEW_GET_NULLABLE_AND_REMOVE(refs -> 
refs.kvView.getNullableAndRemove(null, KEY_TUPLE)),
     KV_VIEW_REPLACE(refs -> refs.kvView.replace(null, KEY_TUPLE, VALUE_TUPLE)),
     KV_VIEW_REPLACE_EXACT(refs -> refs.kvView.replace(null, KEY_TUPLE, 
VALUE_TUPLE, VALUE_TUPLE)),
     KV_VIEW_GET_AND_REPLACE(refs -> refs.kvView.getAndReplace(null, KEY_TUPLE, 
VALUE_TUPLE)),
+    KV_VIEW_GET_NULLABLE_AND_REPLACE(refs -> 
refs.kvView.getNullableAndReplace(null, KEY_TUPLE, VALUE_TUPLE)),
     KV_VIEW_QUERY(refs -> refs.kvView.query(null, null)),
     KV_VIEW_QUERY_WITH_INDEX(refs -> refs.kvView.query(null, null, null)),
     KV_VIEW_QUERY_WITH_OPTIONS(refs -> refs.kvView.query(null, null, null, 
null)),
 
-    TYPED_KV_VIEW_GET_NULLABLE(refs -> refs.typedKvView.getNullable(null, 1)),
-    TYPED_KV_VIEW_GET_NULLABLE_AND_PUT(refs -> 
refs.typedKvView.getNullableAndPut(null, 1, "one")),
-    TYPED_KV_VIEW_GET_NULLABLE_AND_REMOVE(refs -> 
refs.typedKvView.getNullableAndRemove(null, 1)),
-    TYPED_KV_VIEW_GET_NULLABLE_AND_REPLACE(refs -> 
refs.typedKvView.getNullableAndReplace(null, 1, "one")),
-
+    TYPED_KV_VIEW_GET(refs -> refs.typedKvView.get(null, 1)),
     MAPPED_KV_VIEW_GET(refs -> refs.mappedKvView.get(null, 1)),
 
     RECORD_VIEW_GET(refs -> refs.recordView.get(null, KEY_TUPLE)),
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 fc2cbad42b..8cf14cf6ed 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
@@ -25,7 +25,6 @@ import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutur
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.either;
 import static org.hamcrest.Matchers.is;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
 import java.util.List;
 import java.util.Map;
@@ -111,11 +110,6 @@ class ItKvRecordApiThreadingTest extends 
ClusterPerClassIntegrationTest {
             @Enum KeyValueViewAsyncOperation operation,
             @Enum KeyValueViewKind kind
     ) {
-        assumeTrue(
-                kind.supportsGetNullable() || !operation.isGetNullable(),
-                "Skipping the test as getNullable() is not supported by views 
of kind " + kind
-        );
-
         KeyValueView<?, ?> tableView = kind.view();
 
         CompletableFuture<Thread> completerFuture = 
forcingSwitchFromUserThread(
@@ -174,8 +168,6 @@ class ItKvRecordApiThreadingTest extends 
ClusterPerClassIntegrationTest {
             @Enum KeyValueViewAsyncOperation operation,
             @Enum KeyValueViewKind kind
     ) {
-        assumeTrue(kind.supportsGetNullable() || !operation.isGetNullable());
-
         KeyValueView<?, ?> tableView = kind.viewForInternalUse();
 
         CompletableFuture<Thread> completerFuture = 
forcingSwitchFromUserThread(
@@ -353,18 +345,6 @@ class ItKvRecordApiThreadingTest extends 
ClusterPerClassIntegrationTest {
         CompletableFuture<?> executeOn(KeyValueView<?, ?> tableView, 
KeyValueContext<?, ?> context) {
             return action.apply((KeyValueView<Object, Object>) tableView, 
(KeyValueContext<Object, Object>) context);
         }
-
-        boolean isGetNullable() {
-            switch (this) {
-                case GET_NULLABLE_ASYNC:
-                case GET_NULLABLE_AND_PUT_ASYNC:
-                case GET_NULLABLE_AND_REMOVE_ASYNC:
-                case GET_NULLABLE_AND_REPLACE_ASYNC:
-                    return true;
-                default:
-                    return false;
-            }
-        }
     }
 
     private static class KeyValueContext<K, V> {
@@ -393,10 +373,6 @@ class ItKvRecordApiThreadingTest extends 
ClusterPerClassIntegrationTest {
         KeyValueContext<?, ?> context() {
             return this == PLAIN ? plainKeyValueContext() : 
binaryKeyValueContext();
         }
-
-        boolean supportsGetNullable() {
-            return this == PLAIN;
-        }
     }
 
     @SuppressWarnings({"FieldCanBeLocal", "unused"})

Reply via email to