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 2021/12/16 20:22:56 UTC

[GitHub] [ignite-3] sanpwc opened a new pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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


   - Explicit tx argument added to both RecordView and KeyValueView.
   - withTransaction() and transaction() are removed.


-- 
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 #514: IGNITE-15930 Implement explicit tx argument in table API

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


   


-- 
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] sanpwc commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -291,9 +317,10 @@ default V getOrDefault(K key, V defaultValue) {
      *
      * @param key A key with which the specified value is associated. The key cannot be {@code null}.
      * @param val Value to be associated with the specified key.
+     * @param tx  The transaction or {@code null} to auto commit.

Review comment:
       tx param added.




-- 
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] sk0x50 commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -347,36 +377,40 @@ default V getOrDefault(K key, V defaultValue) {
      *
      * @param key A key with which the specified value is associated. The key cannot be {@code null}.
      * @param val Value to be associated with the specified key.
+     * @param tx  The transaction or {@code null} to auto commit.

Review comment:
       please update code snippet




-- 
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] sanpwc commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -39,35 +39,38 @@
      * Gets a value associated with the given key.
      *
      * <p>Note: If the value mapper implies a value can be {@code null}, then a suitable method
-     * {@link #getNullable(Object)} must be used instead.
+     * {@link #getNullable(Object, Transaction)} must be used instead.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Value or {@code null}, if it does not exist.
      * @throws IllegalStateException If value for the key exists, and it is {@code null}.
-     * @see #getNullable(Object)
+     * @see #getNullable(Object, Transaction)
      */
-    V get(@NotNull K key);
+    V get(@NotNull K key, @Nullable Transaction tx);
 
     /**
      * Asynchronously gets a value associated with the given key.
      *
      * <p>Note: If the value mapper implies a value can be {@code null}, then a suitable method
-     * {@link #getNullableAsync(Object)} must be used instead.
+     * {@link #getNullableAsync(Object, Transaction)} must be used instead.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Future representing pending completion of the operation.
-     * @see #getNullableAsync(Object)
-     * @see #get(Object)
+     * @see #getNullableAsync(Object, Transaction)
+     * @see #getNullableAsync(Object, Transaction)

Review comment:
       Fixed.




-- 
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] sanpwc commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -76,38 +79,41 @@
      * Gets a nullable value associated with the given key.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Future representing pending completion of the operation.
-     * @see #getNullable(Object)
+     * @see #getNullable(Object, Transaction)
      */
-    default @NotNull CompletableFuture<NullableValue<V>> getNullableAsync(K key) {
+    default @NotNull CompletableFuture<NullableValue<V>> getNullableAsync(K key, @Nullable Transaction tx) {
         //TODO: to be implemented https://issues.apache.org/jira/browse/IGNITE-16115
         throw new UnsupportedOperationException("Not implemented yet.");
     }
 
     /**
      * Gets a value associated with the given key if exists, returns {@code defaultValue} otherwise.
      *
-     * <p>Note: method has same semantic as {@link #get(Object)} with regard to {@code null} values.
+     * <p>Note: method has same semantic as {@link #get(Object, Transaction)} with regard to {@code null} values.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Value or {@code defaultValue}, if does not exist.
      * @throws IllegalStateException If value for the key exists, and it is {@code null}.
      */
-    default V getOrDefault(K key, V defaultValue) {
+    default V getOrDefault(K key, V defaultValue, @Nullable Transaction tx) {
         //TODO: to be implemented https://issues.apache.org/jira/browse/IGNITE-16115
         throw new UnsupportedOperationException("Not implemented yet.");
     }
 
     /**
      * Gets a nullable value associated with the given key.
      *
-     * <p>Note: method has same semantic as {@link #get(Object)} with regard to {@code null} values.
+     * <p>Note: method has same semantic as {@link #get(Object, Transaction)} with regard to {@code null} values.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Future representing pending completion of the operation.
-     * @see #getOrDefault(Object, Object)
+     * @see #getOrDefaultAsync(Object, Object, Transaction)

Review comment:
       Fixed.




-- 
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] sanpwc commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -347,36 +377,40 @@ default V getOrDefault(K key, V defaultValue) {
      *
      * @param key A key with which the specified value is associated. The key cannot be {@code null}.
      * @param val Value to be associated with the specified key.
+     * @param tx  The transaction or {@code null} to auto commit.

Review comment:
       tx param added.




-- 
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] sanpwc commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -309,28 +336,31 @@ default V getOrDefault(K key, V defaultValue) {
      * @param key    A key with which the specified value is associated. The key cannot be {@code null}.
      * @param oldVal Expected value associated with the specified key.
      * @param newVal Value to be associated with the specified key.
+     * @param tx     The transaction or {@code null} to auto commit.

Review comment:
       tx param added.




-- 
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] sk0x50 commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -76,38 +79,41 @@
      * Gets a nullable value associated with the given key.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Future representing pending completion of the operation.
-     * @see #getNullable(Object)
+     * @see #getNullable(Object, Transaction)
      */
-    default @NotNull CompletableFuture<NullableValue<V>> getNullableAsync(K key) {
+    default @NotNull CompletableFuture<NullableValue<V>> getNullableAsync(K key, @Nullable Transaction tx) {
         //TODO: to be implemented https://issues.apache.org/jira/browse/IGNITE-16115
         throw new UnsupportedOperationException("Not implemented yet.");
     }
 
     /**
      * Gets a value associated with the given key if exists, returns {@code defaultValue} otherwise.
      *
-     * <p>Note: method has same semantic as {@link #get(Object)} with regard to {@code null} values.
+     * <p>Note: method has same semantic as {@link #get(Object, Transaction)} with regard to {@code null} values.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Value or {@code defaultValue}, if does not exist.
      * @throws IllegalStateException If value for the key exists, and it is {@code null}.
      */
-    default V getOrDefault(K key, V defaultValue) {
+    default V getOrDefault(K key, V defaultValue, @Nullable Transaction tx) {
         //TODO: to be implemented https://issues.apache.org/jira/browse/IGNITE-16115
         throw new UnsupportedOperationException("Not implemented yet.");
     }
 
     /**
      * Gets a nullable value associated with the given key.
      *
-     * <p>Note: method has same semantic as {@link #get(Object)} with regard to {@code null} values.
+     * <p>Note: method has same semantic as {@link #get(Object, Transaction)} with regard to {@code null} values.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Future representing pending completion of the operation.
-     * @see #getOrDefault(Object, Object)
+     * @see #getOrDefaultAsync(Object, Object, Transaction)

Review comment:
       `getOrDefault(Object, Object, Transaction)`




-- 
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] sk0x50 commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -39,35 +39,38 @@
      * Gets a value associated with the given key.
      *
      * <p>Note: If the value mapper implies a value can be {@code null}, then a suitable method
-     * {@link #getNullable(Object)} must be used instead.
+     * {@link #getNullable(Object, Transaction)} must be used instead.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Value or {@code null}, if it does not exist.
      * @throws IllegalStateException If value for the key exists, and it is {@code null}.
-     * @see #getNullable(Object)
+     * @see #getNullable(Object, Transaction)
      */
-    V get(@NotNull K key);
+    V get(@NotNull K key, @Nullable Transaction tx);
 
     /**
      * Asynchronously gets a value associated with the given key.
      *
      * <p>Note: If the value mapper implies a value can be {@code null}, then a suitable method
-     * {@link #getNullableAsync(Object)} must be used instead.
+     * {@link #getNullableAsync(Object, Transaction)} must be used instead.
      *
      * @param key A key which associated the value is to be returned. The key cannot be {@code null}.
+     * @param tx  The transaction or {@code null} to auto commit.
      * @return Future representing pending completion of the operation.
-     * @see #getNullableAsync(Object)
-     * @see #get(Object)
+     * @see #getNullableAsync(Object, Transaction)
+     * @see #getNullableAsync(Object, Transaction)

Review comment:
       I think it should be as follows:
   ```
       @see #get(Object, Transaction)
       @see #getNullableAsync(Object, Transaction)
   ```




-- 
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] sk0x50 commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -309,28 +336,31 @@ default V getOrDefault(K key, V defaultValue) {
      * @param key    A key with which the specified value is associated. The key cannot be {@code null}.
      * @param oldVal Expected value associated with the specified key.
      * @param newVal Value to be associated with the specified key.
+     * @param tx     The transaction or {@code null} to auto commit.

Review comment:
       please update code snippet




-- 
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] sk0x50 commented on a change in pull request #514: IGNITE-15930 Implement explicit tx argument in table API

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



##########
File path: modules/api/src/main/java/org/apache/ignite/table/KeyValueView.java
##########
@@ -291,9 +317,10 @@ default V getOrDefault(K key, V defaultValue) {
      *
      * @param key A key with which the specified value is associated. The key cannot be {@code null}.
      * @param val Value to be associated with the specified key.
+     * @param tx  The transaction or {@code null} to auto commit.

Review comment:
       The code snippet in the Javadoc for this method should be updated as well.
   ```
        * if (view.containsKey(key, tx)) {
        *   view.put(key, value, tx);
        *   return true;
        * } else {
        *   return false;
        * }</code></pre>
    ```




-- 
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