cshannon commented on code in PR #3332:
URL: https://github.com/apache/accumulo/pull/3332#discussion_r1180517931
##########
core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java:
##########
@@ -1553,4 +1556,117 @@ public void setCacheProvider(CacheProvider
cacheProvider) {
reader.setCacheProvider(cacheProvider);
}
}
+
+ interface IndexedFileSKVIterator extends FileSKVIterator {
+ FileSKVIterator getIndex() throws IOException;
+ }
+
+ static class FencedReader implements IndexedFileSKVIterator {
+
+ private final Reader reader;
+ private final Range fence;
+
+ public FencedReader(Reader reader, Range seekFence) {
+ this.reader = Objects.requireNonNull(reader);
+ this.fence = seekFence;
+ }
+
+ @Override
+ public void seek(Range range, Collection<ByteSequence> columnFamilies,
boolean inclusive)
+ throws IOException {
+ reader.clear();
+
+ if (fence != null) {
+ range = fence.clip(range, true);
+ if (range == null) {
+ return;
+ }
+ }
+
+ reader.seek(range, columnFamilies, inclusive);
Review Comment:
Right, we only need to fence by rows and don't care about the entire Key
object. I already commented in the now closed #3328 that I plan to use the
RowRange object when it is ready but it needs to support all the existing
methods like clip for it to be useful though. For now I can just keep using
Range and keep those other fields null and should be easy to swap it out later.
--
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]