sergeyuttsel commented on code in PR #2227:
URL: https://github.com/apache/ignite-3/pull/2227#discussion_r1238293000


##########
modules/metastorage-api/src/main/java/org/apache/ignite/internal/metastorage/MetaStorageManager.java:
##########
@@ -60,6 +61,13 @@ public interface MetaStorageManager extends IgniteComponent {
      */
     CompletableFuture<Entry> get(ByteArray key, long revUpperBound);
 
+    /**
+     * Retrieves entries for the given key and bound revisions.

Review Comment:
   I've updated javadoc. I tried to describe it more clearly. Not sure if I 
succeeded. But I can't write better.



##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/persistence/RocksDbKeyValueStorage.java:
##########
@@ -1215,6 +1227,50 @@ private Entry doGet(byte[] key, long revUpperBound) {
         return doGetValue(key, lastRev);
     }
 
+    /**
+     * Gets the value by key and revisions.
+     *
+     * @param key            Target key.
+     * @param revLowerBound  Target lower bound of revision.
+     * @param revUpperBound  Target upper bound of revision.
+     * @return Value.
+     */
+    private List<Entry> doGet(byte[] key, long revLowerBound, long 
revUpperBound) {
+        assert revLowerBound >= 0 : "Invalid arguments: [revLowerBound=" + 
revLowerBound + ']';
+        assert revUpperBound >= 0 : "Invalid arguments: [revUpperBound=" + 
revUpperBound + ']';
+        assert revUpperBound >= revLowerBound
+                : "Invalid arguments: [revLowerBound=" + revLowerBound + ", 
revUpperBound=" + revUpperBound + ']';
+        // TODO: IGNITE-19782 assert that revLowerBound is not compacted.
+
+        long[] revs;
+
+        try {
+            revs = getRevisions(key);
+        } catch (RocksDBException e) {
+            throw new MetaStorageException(OP_EXECUTION_ERR, e);
+        }
+
+        if (revs.length == 0) {
+            return Collections.emptyList();
+        }
+
+        int firstRev = minRevisionIndex(revs, revLowerBound);

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

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

Reply via email to