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


##########
modules/metastorage/src/testFixtures/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java:
##########
@@ -646,6 +655,40 @@ private Entry doGet(byte[] key, long revUpperBound) {
         return doGetValue(key, lastRev);
     }
 
+    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 throw CompactedException if revLowerBound is 
compacted.
+
+        List<Long> revs = keysIdx.get(key);
+
+        if (revs == null || revs.isEmpty()) {
+            return Collections.emptyList();
+        }
+
+        long firstRev = minRevision(revs, revLowerBound);
+        long lastRev = maxRevision(revs, revUpperBound);
+
+        // firstRev can be -1 if minRevision return -1. lastRev can be -1 if 
maxRevision return -1.
+        if (firstRev == -1 || lastRev == -1) {
+            return Collections.emptyList();
+        }
+
+        List<Entry> entries = new ArrayList<>();
+
+        for (int i = 0; i < revs.size(); i++) {
+            long rev = revs.get(i);
+
+            if (rev >= firstRev && rev <= lastRev) {

Review Comment:
   Sorry. 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