@Test @Category(UnitTest.class) public void testInitializeWithNonTiledInputSplit() throws Exception { InputSplit mockSplit = mock(InputSplit.class); try { subject.initialize(mockSplit, mockContext); Assert.fail("initialize did not throw an exception if the input split was not a TiledInputSplit"); } catch (IOException e) { } }
@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { if (split instanceof TiledInputSplit) { TiledInputSplit tiledInputSplit = (TiledInputSplit) split; startTileId = tiledInputSplit.getStartTileId(); endTileId = tiledInputSplit.getEndTileId(); FileSplit fileSplit = (FileSplit) ((TiledInputSplit) split).getWrappedSplit(); Configuration conf = context.getConfiguration(); Path path = fileSplit.getPath(); FileSystem fs = path.getFileSystem(conf); reader = readerFactory.createReader(fs, path, conf); try { key = (TileIdWritable) reader.getKeyClass().newInstance(); value = (RasterWritable) reader.getValueClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IOException(e); } } else { throw new IOException("Expected a TiledInputSplit but received " + split.getClass().getName()); } }
HdfsMrsPyramidRecordReader extends RecordReader<TileIdWritable, RasterWritable> { @Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { if (split instanceof TiledInputSplit) { TiledInputSplit tiledInputSplit = (TiledInputSplit) split; startTileId = tiledInputSplit.getStartTileId(); endTileId = tiledInputSplit.getEndTileId(); FileSplit fileSplit = (FileSplit) ((TiledInputSplit) split).getWrappedSplit(); Configuration conf = context.getConfiguration(); Path path = fileSplit.getPath(); FileSystem fs = path.getFileSystem(conf); reader = readerFactory.createReader(fs, path, conf); try { key = (TileIdWritable) reader.getKeyClass().newInstance(); value = (RasterWritable) reader.getValueClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IOException(e); } } else { throw new IOException("Expected a TiledInputSplit but received " + split.getClass().getName()); } } }
HdfsMrsPyramidRecordReader extends RecordReader<TileIdWritable, RasterWritable> { @Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { if (split instanceof TiledInputSplit) { TiledInputSplit tiledInputSplit = (TiledInputSplit) split; startTileId = tiledInputSplit.getStartTileId(); endTileId = tiledInputSplit.getEndTileId(); FileSplit fileSplit = (FileSplit) ((TiledInputSplit) split).getWrappedSplit(); Configuration conf = context.getConfiguration(); Path path = fileSplit.getPath(); FileSystem fs = path.getFileSystem(conf); reader = readerFactory.createReader(fs, path, conf); try { key = (TileIdWritable) reader.getKeyClass().newInstance(); value = (RasterWritable) reader.getValueClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IOException(e); } } else { throw new IOException("Expected a TiledInputSplit but received " + split.getClass().getName()); } } HdfsMrsPyramidRecordReader();  HdfsMrsPyramidRecordReader(ReaderFactory readerFactory); }
HdfsMrsPyramidRecordReader extends RecordReader<TileIdWritable, RasterWritable> { @Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { if (split instanceof TiledInputSplit) { TiledInputSplit tiledInputSplit = (TiledInputSplit) split; startTileId = tiledInputSplit.getStartTileId(); endTileId = tiledInputSplit.getEndTileId(); FileSplit fileSplit = (FileSplit) ((TiledInputSplit) split).getWrappedSplit(); Configuration conf = context.getConfiguration(); Path path = fileSplit.getPath(); FileSystem fs = path.getFileSystem(conf); reader = readerFactory.createReader(fs, path, conf); try { key = (TileIdWritable) reader.getKeyClass().newInstance(); value = (RasterWritable) reader.getValueClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IOException(e); } } else { throw new IOException("Expected a TiledInputSplit but received " + split.getClass().getName()); } } HdfsMrsPyramidRecordReader();  HdfsMrsPyramidRecordReader(ReaderFactory readerFactory); @Override TileIdWritable getCurrentKey(); @Override RasterWritable getCurrentValue(); @Override // TODO eaw this should probably throw an UnsupportedOperationException since it does not meet the contract on getProgress because recordCount is never updated float getProgress(); @Override void close(); @Override void initialize(InputSplit split, TaskAttemptContext context); @Override boolean nextKeyValue(); }
HdfsMrsPyramidRecordReader extends RecordReader<TileIdWritable, RasterWritable> { @Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { if (split instanceof TiledInputSplit) { TiledInputSplit tiledInputSplit = (TiledInputSplit) split; startTileId = tiledInputSplit.getStartTileId(); endTileId = tiledInputSplit.getEndTileId(); FileSplit fileSplit = (FileSplit) ((TiledInputSplit) split).getWrappedSplit(); Configuration conf = context.getConfiguration(); Path path = fileSplit.getPath(); FileSystem fs = path.getFileSystem(conf); reader = readerFactory.createReader(fs, path, conf); try { key = (TileIdWritable) reader.getKeyClass().newInstance(); value = (RasterWritable) reader.getValueClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IOException(e); } } else { throw new IOException("Expected a TiledInputSplit but received " + split.getClass().getName()); } } HdfsMrsPyramidRecordReader();  HdfsMrsPyramidRecordReader(ReaderFactory readerFactory); @Override TileIdWritable getCurrentKey(); @Override RasterWritable getCurrentValue(); @Override // TODO eaw this should probably throw an UnsupportedOperationException since it does not meet the contract on getProgress because recordCount is never updated float getProgress(); @Override void close(); @Override void initialize(InputSplit split, TaskAttemptContext context); @Override boolean nextKeyValue();  }