@Override protected FileSKVIterator openReader(FileOptions options) throws IOException { FileSKVIterator iter = new RangeIterator(new MapFileIterator(options.getTableConfiguration(), options.getFileSystem(), options.getFilename(), options.getConfiguration())); if (options.isSeekToBeginning()) { iter.seek(new Range(new Key(), null), new ArrayList<>(), false); } return iter; }
@Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { if (columnFamilies.size() != 0 || inclusive) { throw new IllegalArgumentException("I do not know how to filter column families"); } if (range == null) throw new IllegalArgumentException("Cannot seek to null range"); if (interruptFlag != null && interruptFlag.get()) throw new IterationInterruptedException(); Key key = range.getStartKey(); if (key == null) { key = new Key(); } reader.seek(key); while (hasTop() && range.beforeStartKey(getTopKey())) { next(); } }
@Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { if (columnFamilies.size() != 0 || inclusive) { throw new IllegalArgumentException("I do not know how to filter column families"); } if (range == null) throw new IllegalArgumentException("Cannot seek to null range"); if (interruptFlag != null && interruptFlag.get()) throw new IterationInterruptedException(); Key key = range.getStartKey(); if (key == null) { key = new Key(); } reader.seek(key); while (hasTop() && range.beforeStartKey(getTopKey())) { next(); } }
@Override protected FileSKVIterator openScanReader(FileOptions options) throws IOException { MapFileIterator mfIter = new MapFileIterator(options.getTableConfiguration(), options.getFileSystem(), options.getFilename(), options.getConfiguration()); FileSKVIterator iter = new RangeIterator(mfIter); iter.seek(options.getRange(), options.getColumnFamilies(), options.isRangeInclusive()); return iter; } }
@Override protected FileSKVIterator openReader(OpenReaderOperation options) throws IOException { FileSKVIterator iter = new RangeIterator(new MapFileIterator(options.getTableConfiguration(), options.getFileSystem(), options.getFilename(), options.getConfiguration())); if (options.isSeekToBeginning()) { iter.seek(new Range(new Key(), null), new ArrayList<ByteSequence>(), false); } return iter; }
@Override protected FileSKVIterator openScanReader(OpenScanReaderOperation options) throws IOException { MapFileIterator mfIter = new MapFileIterator(options.getTableConfiguration(), options.getFileSystem(), options.getFilename(), options.getConfiguration()); FileSKVIterator iter = new RangeIterator(mfIter); iter.seek(options.getRange(), options.getColumnFamilies(), options.isRangeInclusive()); return iter; } }