You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/03/05 14:43:02 UTC

[GitHub] [ignite-3] alievmirza opened a new pull request #706: IGNITE-16654 add an ability to compare entry values in meta storage conditional updates

alievmirza opened a new pull request #706:
URL: https://github.com/apache/ignite-3/pull/706


   https://issues.apache.org/jira/browse/IGNITE-16654


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] kgusakov commented on a change in pull request #706: IGNITE-16654 add an ability to compare entry values in meta storage conditional updates

Posted by GitBox <gi...@apache.org>.
kgusakov commented on a change in pull request #706:
URL: https://github.com/apache/ignite-3/pull/706#discussion_r820117962



##########
File path: modules/metastorage-server/src/test/java/org/apache/ignite/internal/metastorage/server/ValueConditionTest.java
##########
@@ -57,4 +61,54 @@ public void ne() {
 
         assertTrue(cond.test(new Entry(KEY, VAL_2, 1, 1)));
     }
+
+    /**
+     * Tests that value is greater than another one.
+     */
+    @Test
+    public void gt() {
+        Condition cond = new ValueCondition(GREATER, KEY, VAL_1);
+
+        // byte[]{22} > byte[]{11}.
+        assertTrue(cond.test(new Entry(KEY, VAL_2, 1, 1)));

Review comment:
       I'd test some cases, when method returns false. At the moment, implementation `return true` will pass the test :)

##########
File path: modules/metastorage-client/src/integrationTest/java/org/apache/ignite/internal/metastorage/client/ItMetaStorageServiceTest.java
##########
@@ -820,7 +823,80 @@ public void testMultiInvoke() throws Exception {
                 new StatementResult(false))));
 
         assertThat(resultIf.orElse().update(), upd(new Update(
-                Arrays.asList(new org.apache.ignite.internal.metastorage.server.Operation(OperationType.PUT, key2.bytes(), rval2)),
+                List.of(new org.apache.ignite.internal.metastorage.server.Operation(OperationType.PUT, key2.bytes(), rval2)),
+                new StatementResult(false))));
+    }
+
+    @Test
+    public void testMultiInvokeValueConditions() throws Exception {

Review comment:
       Due to the integration nature of this suite - I think we should avoid creation of many test methods with different combination of Conditions here. Conditions should be tested in according unit tests suites.
   
   But, I see, that you want to check integration of all parts for new value conditions - I think the good idea, just to extend current `testMultiInvoke` with the needed cases.




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] alievmirza commented on a change in pull request #706: IGNITE-16654 add an ability to compare entry values in meta storage conditional updates

Posted by GitBox <gi...@apache.org>.
alievmirza commented on a change in pull request #706:
URL: https://github.com/apache/ignite-3/pull/706#discussion_r822515688



##########
File path: modules/metastorage-client/src/integrationTest/java/org/apache/ignite/internal/metastorage/client/ItMetaStorageServiceTest.java
##########
@@ -820,7 +823,80 @@ public void testMultiInvoke() throws Exception {
                 new StatementResult(false))));
 
         assertThat(resultIf.orElse().update(), upd(new Update(
-                Arrays.asList(new org.apache.ignite.internal.metastorage.server.Operation(OperationType.PUT, key2.bytes(), rval2)),
+                List.of(new org.apache.ignite.internal.metastorage.server.Operation(OperationType.PUT, key2.bytes(), rval2)),
+                new StatementResult(false))));
+    }
+
+    @Test
+    public void testMultiInvokeValueConditions() throws Exception {

Review comment:
       done




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] asfgit closed pull request #706: IGNITE-16654 add an ability to compare entry values in meta storage conditional updates

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #706:
URL: https://github.com/apache/ignite-3/pull/706


   


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] alievmirza commented on a change in pull request #706: IGNITE-16654 add an ability to compare entry values in meta storage conditional updates

Posted by GitBox <gi...@apache.org>.
alievmirza commented on a change in pull request #706:
URL: https://github.com/apache/ignite-3/pull/706#discussion_r822515516



##########
File path: modules/metastorage-server/src/test/java/org/apache/ignite/internal/metastorage/server/ValueConditionTest.java
##########
@@ -57,4 +61,54 @@ public void ne() {
 
         assertTrue(cond.test(new Entry(KEY, VAL_2, 1, 1)));
     }
+
+    /**
+     * Tests that value is greater than another one.
+     */
+    @Test
+    public void gt() {
+        Condition cond = new ValueCondition(GREATER, KEY, VAL_1);
+
+        // byte[]{22} > byte[]{11}.
+        assertTrue(cond.test(new Entry(KEY, VAL_2, 1, 1)));

Review comment:
       done




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org