@Test @Category(UnitTest.class) public void testNullEnd() throws Exception { subject = createDefaultSubject(firstPartitionTileIds[1], null); Assert.assertTrue(subject.hasNext()); assertIterateOverTiles(1, firstPartitionTileIds.length + secondPartitionTileIds.length - 1); Assert.assertFalse(subject.hasNext()); }
@Override public boolean hasNext() { try { if (mapfile == null) { throw new MrsImageException("Mapfile.Reader has been closed"); } if (currentKey == null) { return false; } if (readFirstKey) { readFirstKey = false; return (currentKey.compareTo(endKey) <= 0); } while (true) { boolean found = mapfile.getReader().next(currentKey, currentValue); if (found) { if (currentKey.compareTo(endKey) <= 0) { if (zoom > 0) { Tile t = TMSUtils.tileid(currentKey.get(), zoom); if (t.tx >= rowStart && t.tx <= rowEnd) { return true; } } else { return true; } } else { return false; } } else { if (++curPartitionIndex >= reader.getMaxPartitions()) { return false; } if (!reader.canBeCached()) { mapfile.close(); } mapfile = reader.getReaderWrapper(curPartitionIndex); } } } catch (IOException e) { throw new MrsImageException(e); } }
HdfsImageResultScanner implements CloseableKVIterator<TileIdWritable, MrGeoRaster> { @Override public boolean hasNext() { try { if (mapfile == null) { throw new MrsImageException("Mapfile.Reader has been closed"); } if (currentKey == null) { return false; } if (readFirstKey) { readFirstKey = false; return (currentKey.compareTo(endKey) <= 0); } while (true) { boolean found = mapfile.getReader().next(currentKey, currentValue); if (found) { if (currentKey.compareTo(endKey) <= 0) { if (zoom > 0) { Tile t = TMSUtils.tileid(currentKey.get(), zoom); if (t.tx >= rowStart && t.tx <= rowEnd) { return true; } } else { return true; } } else { return false; } } else { if (++curPartitionIndex >= reader.getMaxPartitions()) { return false; } if (!reader.canBeCached()) { mapfile.close(); } mapfile = reader.getReaderWrapper(curPartitionIndex); } } } catch (IOException e) { throw new MrsImageException(e); } } }
HdfsImageResultScanner implements CloseableKVIterator<TileIdWritable, MrGeoRaster> { @Override public boolean hasNext() { try { if (mapfile == null) { throw new MrsImageException("Mapfile.Reader has been closed"); } if (currentKey == null) { return false; } if (readFirstKey) { readFirstKey = false; return (currentKey.compareTo(endKey) <= 0); } while (true) { boolean found = mapfile.getReader().next(currentKey, currentValue); if (found) { if (currentKey.compareTo(endKey) <= 0) { if (zoom > 0) { Tile t = TMSUtils.tileid(currentKey.get(), zoom); if (t.tx >= rowStart && t.tx <= rowEnd) { return true; } } else { return true; } } else { return false; } } else { if (++curPartitionIndex >= reader.getMaxPartitions()) { return false; } if (!reader.canBeCached()) { mapfile.close(); } mapfile = reader.getReaderWrapper(curPartitionIndex); } } } catch (IOException e) { throw new MrsImageException(e); } } HdfsImageResultScanner(LongRectangle bounds,
    HdfsMrsImageReader reader);   HdfsImageResultScanner(TileIdWritable startKey, TileIdWritable endKey,
    HdfsMrsImageReader reader); }
HdfsImageResultScanner implements CloseableKVIterator<TileIdWritable, MrGeoRaster> { @Override public boolean hasNext() { try { if (mapfile == null) { throw new MrsImageException("Mapfile.Reader has been closed"); } if (currentKey == null) { return false; } if (readFirstKey) { readFirstKey = false; return (currentKey.compareTo(endKey) <= 0); } while (true) { boolean found = mapfile.getReader().next(currentKey, currentValue); if (found) { if (currentKey.compareTo(endKey) <= 0) { if (zoom > 0) { Tile t = TMSUtils.tileid(currentKey.get(), zoom); if (t.tx >= rowStart && t.tx <= rowEnd) { return true; } } else { return true; } } else { return false; } } else { if (++curPartitionIndex >= reader.getMaxPartitions()) { return false; } if (!reader.canBeCached()) { mapfile.close(); } mapfile = reader.getReaderWrapper(curPartitionIndex); } } } catch (IOException e) { throw new MrsImageException(e); } } HdfsImageResultScanner(LongRectangle bounds,
    HdfsMrsImageReader reader);   HdfsImageResultScanner(TileIdWritable startKey, TileIdWritable endKey,
    HdfsMrsImageReader reader); @Override void close(); @Override TileIdWritable currentKey(); @Override MrGeoRaster currentValue(); @Override boolean hasNext(); @Override MrGeoRaster next(); @Override void remove(); }
HdfsImageResultScanner implements CloseableKVIterator<TileIdWritable, MrGeoRaster> { @Override public boolean hasNext() { try { if (mapfile == null) { throw new MrsImageException("Mapfile.Reader has been closed"); } if (currentKey == null) { return false; } if (readFirstKey) { readFirstKey = false; return (currentKey.compareTo(endKey) <= 0); } while (true) { boolean found = mapfile.getReader().next(currentKey, currentValue); if (found) { if (currentKey.compareTo(endKey) <= 0) { if (zoom > 0) { Tile t = TMSUtils.tileid(currentKey.get(), zoom); if (t.tx >= rowStart && t.tx <= rowEnd) { return true; } } else { return true; } } else { return false; } } else { if (++curPartitionIndex >= reader.getMaxPartitions()) { return false; } if (!reader.canBeCached()) { mapfile.close(); } mapfile = reader.getReaderWrapper(curPartitionIndex); } } } catch (IOException e) { throw new MrsImageException(e); } } HdfsImageResultScanner(LongRectangle bounds,
    HdfsMrsImageReader reader);   HdfsImageResultScanner(TileIdWritable startKey, TileIdWritable endKey,
    HdfsMrsImageReader reader); @Override void close(); @Override TileIdWritable currentKey(); @Override MrGeoRaster currentValue(); @Override boolean hasNext(); @Override MrGeoRaster next(); @Override void remove();  }