You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "vldpyatkov (via GitHub)" <gi...@apache.org> on 2023/05/17 20:34:48 UTC

[GitHub] [ignite-3] vldpyatkov opened a new pull request, #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

vldpyatkov opened a new pull request, #2083:
URL: https://github.com/apache/ignite-3/pull/2083

   (no comment)


-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1197890952


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {
-
-    private static final SchemaDescriptor INFINITY_TUPLE_SCHEMA = new SchemaDescriptor(
-            1,
-            new Column[]{
-                    new Column("indexId", NativeTypes.UUID, false),
-                    new Column("partId", NativeTypes.INT32, false)
-            },
-            new Column[0]
-    );
-
     /** Index INF+ value object. */
-    private final BinaryTuple positiveInf;
+    private final Integer positiveInf;

Review Comment:
   Well, to be honest, despite the fact that currently it should work because index key is a byte array, I'll still favor custom InfWrapper here.



-- 
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] vldpyatkov commented on a diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "vldpyatkov (via GitHub)" <gi...@apache.org>.
vldpyatkov commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1199110005


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -186,21 +151,16 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         BinaryTuplePrefix prefix = BinaryTuplePrefix.fromBinaryTuple(key);
 
         // Find next key.
-        Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);
+        try (Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER)) {
+            IndexRow nextRow = cursor.hasNext() ? cursor.next() : null;

Review Comment:
   Why? The rest part is async and does not influence the time when the cursor is being open.
   In the other hand, we do not know what we will deal with without cursor there. 



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1197884001


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {

Review Comment:
   What about HashIndexLocker?



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1199141145


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -186,21 +151,16 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         BinaryTuplePrefix prefix = BinaryTuplePrefix.fromBinaryTuple(key);
 
         // Find next key.
-        Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);
+        try (Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER)) {
+            IndexRow nextRow = cursor.hasNext() ? cursor.next() : null;

Review Comment:
   Thanks!



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1197911497


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -188,14 +154,9 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         // Find next key.
         Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);

Review Comment:
   Not related to your changes, but we should close the cursor. try-with-resources?



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1199057220


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {
-
-    private static final SchemaDescriptor INFINITY_TUPLE_SCHEMA = new SchemaDescriptor(
-            1,
-            new Column[]{
-                    new Column("indexId", NativeTypes.UUID, false),
-                    new Column("partId", NativeTypes.INT32, false)
-            },
-            new Column[0]
-    );
-
     /** Index INF+ value object. */
-    private final BinaryTuple positiveInf;
+    private final Integer positiveInf;

Review Comment:
   No sure what "specific class to define infinite infinity" means))
   I believe that we may create `Infinity(int parIdx)` class.



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1197884001


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {

Review Comment:
   What about HashIndexLocker?



-- 
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] vldpyatkov commented on a diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "vldpyatkov (via GitHub)" <gi...@apache.org>.
vldpyatkov commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1199178880


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -186,21 +151,16 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         BinaryTuplePrefix prefix = BinaryTuplePrefix.fromBinaryTuple(key);
 
         // Find next key.
-        Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);
+        try (Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER)) {
+            IndexRow nextRow = cursor.hasNext() ? cursor.next() : null;

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] vldpyatkov merged pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "vldpyatkov (via GitHub)" <gi...@apache.org>.
vldpyatkov merged PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083


-- 
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] vldpyatkov commented on a diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "vldpyatkov (via GitHub)" <gi...@apache.org>.
vldpyatkov commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1198835096


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {
-
-    private static final SchemaDescriptor INFINITY_TUPLE_SCHEMA = new SchemaDescriptor(
-            1,
-            new Column[]{
-                    new Column("indexId", NativeTypes.UUID, false),
-                    new Column("partId", NativeTypes.INT32, false)
-            },
-            new Column[0]
-    );
-
     /** Index INF+ value object. */
-    private final BinaryTuple positiveInf;
+    private final Integer positiveInf;

Review Comment:
   Is it enough to use object here, or you want to have a specific class to define infinite infinity?



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1199124024


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -186,21 +151,16 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         BinaryTuplePrefix prefix = BinaryTuplePrefix.fromBinaryTuple(key);
 
         // Find next key.
-        Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);
+        try (Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER)) {
+            IndexRow nextRow = cursor.hasNext() ? cursor.next() : null;

Review Comment:
   > In the other hand, we do not know what we will deal with without cursor there.
   What do you mean?
   
   Generally it's better to wrap with try-with-resources as less code as possible.



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -186,21 +151,16 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         BinaryTuplePrefix prefix = BinaryTuplePrefix.fromBinaryTuple(key);
 
         // Find next key.
-        Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);
+        try (Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER)) {
+            IndexRow nextRow = cursor.hasNext() ? cursor.next() : null;

Review Comment:
   > In the other hand, we do not know what we will deal with without cursor there.
   
   What do you mean?
   
   Generally it's better to wrap with try-with-resources as less code as possible.



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1197905137


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -83,26 +68,7 @@ public SortedIndexLocker(UUID indexId, int partId, LockManager lockManager, Sort
         this.storage = storage;
         this.indexRowResolver = indexRowResolver;
 
-        this.positiveInf = createInfiniteBoundary(partId, indexId);
-    }
-
-    /**
-     * Creates a tuple for positive infinity boundary.
-     *
-     * @param partId Partition id.
-     * @param indexId Index id.
-     * @return Infinity binary tuple.
-     */
-    private static BinaryTuple createInfiniteBoundary(int partId, UUID indexId) {
-        var binarySchema = BinaryTupleSchema.createSchema(INFINITY_TUPLE_SCHEMA, new int[]{
-                INFINITY_TUPLE_SCHEMA.column("indexId").schemaIndex(),
-                INFINITY_TUPLE_SCHEMA.column("partId").schemaIndex()
-        });
-
-        return new BinaryTuple(
-                binarySchema,
-                new BinaryTupleBuilder(binarySchema.elementCount(), false).appendUuid(indexId).appendInt(partId).build()
-        );
+        this.positiveInf = new Integer(partId);

Review Comment:
       @Deprecated(since="9", forRemoval = true)
       public Integer(int value) {



-- 
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] korlov42 commented on a diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1198584017


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -188,14 +154,9 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         // Find next key.
         Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);

Review Comment:
   good catch!



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {
-
-    private static final SchemaDescriptor INFINITY_TUPLE_SCHEMA = new SchemaDescriptor(
-            1,
-            new Column[]{
-                    new Column("indexId", NativeTypes.UUID, false),
-                    new Column("partId", NativeTypes.INT32, false)
-            },
-            new Column[0]
-    );
-
     /** Index INF+ value object. */
-    private final BinaryTuple positiveInf;
+    private final Integer positiveInf;

Review Comment:
   +1 for custom wrapper 



-- 
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] vldpyatkov commented on a diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "vldpyatkov (via GitHub)" <gi...@apache.org>.
vldpyatkov commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1198837567


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {
-
-    private static final SchemaDescriptor INFINITY_TUPLE_SCHEMA = new SchemaDescriptor(
-            1,
-            new Column[]{
-                    new Column("indexId", NativeTypes.UUID, false),
-                    new Column("partId", NativeTypes.INT32, false)
-            },
-            new Column[0]
-    );
-
     /** Index INF+ value object. */
-    private final BinaryTuple positiveInf;
+    private final Integer positiveInf;

Review Comment:
   Also, object like that (Integer) well cached by java.



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1197890952


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {
-
-    private static final SchemaDescriptor INFINITY_TUPLE_SCHEMA = new SchemaDescriptor(
-            1,
-            new Column[]{
-                    new Column("indexId", NativeTypes.UUID, false),
-                    new Column("partId", NativeTypes.INT32, false)
-            },
-            new Column[0]
-    );
-
     /** Index INF+ value object. */
-    private final BinaryTuple positiveInf;
+    private final Integer positiveInf;

Review Comment:
   Well, to be honest, despite the fact that currently it should work because index keys are Bytes, I'll still favor custom InfWrapper here.



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1197890952


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -45,18 +40,8 @@
  * <p>Simply acquires lock on a given row for lookup and remove, acquires lock on a next key for insert.
  */
 public class SortedIndexLocker implements IndexLocker {
-
-    private static final SchemaDescriptor INFINITY_TUPLE_SCHEMA = new SchemaDescriptor(
-            1,
-            new Column[]{
-                    new Column("indexId", NativeTypes.UUID, false),
-                    new Column("partId", NativeTypes.INT32, false)
-            },
-            new Column[0]
-    );
-
     /** Index INF+ value object. */
-    private final BinaryTuple positiveInf;
+    private final Integer positiveInf;

Review Comment:
   Well, to be honest, despite the fact that currently it should work because index key is a byte array, I'll still favor custom InfWrapper here. Up to you though.



-- 
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] vldpyatkov commented on a diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "vldpyatkov (via GitHub)" <gi...@apache.org>.
vldpyatkov commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1198838595


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -83,26 +68,7 @@ public SortedIndexLocker(UUID indexId, int partId, LockManager lockManager, Sort
         this.storage = storage;
         this.indexRowResolver = indexRowResolver;
 
-        this.positiveInf = createInfiniteBoundary(partId, indexId);
-    }
-
-    /**
-     * Creates a tuple for positive infinity boundary.
-     *
-     * @param partId Partition id.
-     * @param indexId Index id.
-     * @return Infinity binary tuple.
-     */
-    private static BinaryTuple createInfiniteBoundary(int partId, UUID indexId) {
-        var binarySchema = BinaryTupleSchema.createSchema(INFINITY_TUPLE_SCHEMA, new int[]{
-                INFINITY_TUPLE_SCHEMA.column("indexId").schemaIndex(),
-                INFINITY_TUPLE_SCHEMA.column("partId").schemaIndex()
-        });
-
-        return new BinaryTuple(
-                binarySchema,
-                new BinaryTupleBuilder(binarySchema.elementCount(), false).appendUuid(indexId).appendInt(partId).build()
-        );
+        this.positiveInf = new Integer(partId);

Review Comment:
   Replace to valueOf()



-- 
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 diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1199062674


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -186,21 +151,16 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         BinaryTuplePrefix prefix = BinaryTuplePrefix.fromBinaryTuple(key);
 
         // Find next key.
-        Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);
+        try (Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER)) {
+            IndexRow nextRow = cursor.hasNext() ? cursor.next() : null;

Review Comment:
   I believe that we may wrap only cursor related code with try-with-resources.



-- 
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] vldpyatkov commented on a diff in pull request #2083: IGNITE-19381 TimestampAware messages sometimes lacks timestamps

Posted by "vldpyatkov (via GitHub)" <gi...@apache.org>.
vldpyatkov commented on code in PR #2083:
URL: https://github.com/apache/ignite-3/pull/2083#discussion_r1198900717


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -188,14 +154,9 @@ public CompletableFuture<Lock> locksForInsert(UUID txId, BinaryRow tableRow, Row
         // Find next key.
         Cursor<IndexRow> cursor = storage.scan(prefix, null, SortedIndexStorage.GREATER);

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