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

[GitHub] [ignite-3] sashapolo commented on a diff in pull request #2021: IGNITE-19394 "peek" contract improved to avoid missing data on RW scans.

sashapolo commented on code in PR #2021:
URL: https://github.com/apache/ignite-3/pull/2021#discussion_r1184753129


##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/index/impl/TestSortedIndexStorage.java:
##########
@@ -61,8 +54,21 @@ public class TestSortedIndexStorage extends AbstractTestIndexStorage implements
     public TestSortedIndexStorage(int partitionId, SortedIndexDescriptor descriptor) {
         super(partitionId);
 
+        BinaryTupleComparator binaryTupleComparator = new BinaryTupleComparator(descriptor);
+
         this.descriptor = descriptor;
-        this.index = new ConcurrentSkipListMap<>(new BinaryTupleComparator(descriptor));
+        this.index = new ConcurrentSkipListSet<>((indexRow0, indexRow1) -> {
+            int cmp = binaryTupleComparator.compare(

Review Comment:
   Can be written shorter:
   ```
   Comparator<IndexRow> comparator = Comparator.comparing((IndexRow row) -> row.indexColumns().byteBuffer(), binaryTupleComparator)
           .thenComparing(IndexRow::rowId);
   ```
           



##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/index/impl/AbstractTestIndexStorage.java:
##########
@@ -30,6 +30,8 @@
  * Test-only abstract index storage class.
  */
 abstract class AbstractTestIndexStorage implements IndexStorage {
+    protected final int partitionId;

Review Comment:
   This field is only used in `TestSortedIndexStorage` maybe it should be moved 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