kaijchen commented on PR #3379:
URL: https://github.com/apache/ozone/pull/3379#issuecomment-1117527398
Thanks @rakeshadr for explaining the problem.
I think we can scan cache and table simultaneously and merge the result,
providing ordered results.
However, this requires cache to be a `SortedMap`.
```java
// input: keyName, startKey, numKeys
cIt = cache.seek(startKey);
tIt = table.seek(startKey);
for (i = 0; i < numKeys; i++) {
// check cIt and tIt are valid
if (cIt.key() < tIt.key()) {
it = cIt;
} else {
it = tIt;
}
result.add(it.key());
it.next()
}
return result;
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]