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


##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbMvPartitionStorage.java:
##########
@@ -648,6 +649,37 @@ private static boolean matches(RowId rowId, ByteBuffer 
keyByf) {
         return rowId.mostSignificantBits() == keyByf.getLong() && 
rowId.leastSignificantBits() == keyByf.getLong();
     }
 
+    @Override
+    public Cursor<BinaryRow> scanVersions(RowId rowId) throws StorageException 
{
+        ByteBuffer keyBuf = prepareHeapKeyBuf(rowId);
+
+        byte[] lowerBound = copyOf(keyBuf.array(), ROW_PREFIX_SIZE);
+
+        incrementRowId(keyBuf);
+
+        Slice upperBound = new Slice(copyOf(keyBuf.array(), ROW_PREFIX_SIZE));
+
+        var options = new 
ReadOptions().setIterateUpperBound(upperBound).setTotalOrderSeek(true);
+
+        RocksIterator it = db.newIterator(cf, options);
+
+        it.seek(lowerBound);
+
+        return new RocksIteratorAdapter<>(it) {
+            @Override
+            protected BinaryRow decodeEntry(byte[] key, byte[] value) {
+                return wrapValueIntoBinaryRow(value, key.length == 
ROW_PREFIX_SIZE);
+            }
+
+            @Override
+            public void close() throws Exception {
+                super.close();
+
+                IgniteUtils.closeAll(it, options, upperBound);

Review Comment:
   `it` is also closed in the `super.close` call. I wonder why it doesn't 
fail...



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to