@Test @Category(UnitTest.class) public void testMove() throws Exception { String name = HadoopFileUtils.createUniqueTmpPath().toString(); HadoopFileUtils.copyToHdfs(all_ones, name); HdfsMrsImageDataProvider mover = new HdfsMrsImageDataProvider(conf, name, null); Assert.assertTrue("Image should exist!", HadoopFileUtils.exists(name)); Assert.assertNotNull("Image doesn't exist!", mover.getResourceName()); String newname = HadoopFileUtils.createUniqueTmpPath().toString(); mover.move(newname); Assert.assertFalse("Image was not moved!", HadoopFileUtils.exists(name)); Assert.assertTrue("Image was not moved!", HadoopFileUtils.exists(newname)); HdfsMrsImageDataProvider.delete(conf, newname, null); Assert.assertFalse("Image was not deleted!", HadoopFileUtils.exists(newname)); }
@Override public void move(String toResource) throws IOException { try { HadoopFileUtils.move(getConfiguration(), resolveNameToPath(getConfiguration(), getResourceName(), providerProperties, true, true), new Path(toResource)); } catch (IllegalArgumentException e) { throw new IOException(e); } }
HdfsMrsImageDataProvider extends MrsImageDataProvider { @Override public void move(String toResource) throws IOException { try { HadoopFileUtils.move(getConfiguration(), resolveNameToPath(getConfiguration(), getResourceName(), providerProperties, true, true), new Path(toResource)); } catch (IllegalArgumentException e) { throw new IOException(e); } } }
HdfsMrsImageDataProvider extends MrsImageDataProvider { @Override public void move(String toResource) throws IOException { try { HadoopFileUtils.move(getConfiguration(), resolveNameToPath(getConfiguration(), getResourceName(), providerProperties, true, true), new Path(toResource)); } catch (IllegalArgumentException e) { throw new IOException(e); } } HdfsMrsImageDataProvider(Configuration conf,
    String resourceName, ProviderProperties providerProperties); }
HdfsMrsImageDataProvider extends MrsImageDataProvider { @Override public void move(String toResource) throws IOException { try { HadoopFileUtils.move(getConfiguration(), resolveNameToPath(getConfiguration(), getResourceName(), providerProperties, true, true), new Path(toResource)); } catch (IllegalArgumentException e) { throw new IOException(e); } } HdfsMrsImageDataProvider(Configuration conf,
    String resourceName, ProviderProperties providerProperties); @SuppressWarnings("squid:S1166") // Exception caught and handled static boolean canOpen(Configuration conf, String input,
    ProviderProperties providerProperties); static boolean exists(Configuration conf, String input,
    ProviderProperties providerProperties); static void delete(Configuration conf, String input,
    ProviderProperties providerProperties); @SuppressWarnings("squid:S1166") // Exception caught and handled static boolean canWrite(Configuration conf, String input,
    ProviderProperties providerProperties); static Path getBasePath(Configuration conf); @Override String getSimpleResourceName(); String getResolvedResourceName(boolean mustExist); Path getResourcePath(boolean mustExist); @Override MrsImageInputFormatProvider getImageInputFormatProvider(ImageInputFormatContext context); @Override MrsImageOutputFormatProvider getTiledOutputFormatProvider(ImageOutputFormatContext context); @Override RecordReader<TileIdWritable, RasterWritable> getRecordReader(); @Override RecordWriter<TileIdWritable, RasterWritable> getRecordWriter(); @Override MrsImageReader getMrsTileReader(MrsPyramidReaderContext context); @Override void delete(int zoomlevel); @Override MrsImageWriter getMrsTileWriter(MrsPyramidWriterContext context); @Override MrsPyramidMetadataReader getMetadataReader(MrsPyramidMetadataReaderContext context); @Override MrsPyramidMetadataWriter getMetadataWriter(MrsPyramidMetadataWriterContext context); @Override void delete(); @Override void move(String toResource); @Override boolean validateProtectionLevel(String protectionLevel); }
HdfsMrsImageDataProvider extends MrsImageDataProvider { @Override public void move(String toResource) throws IOException { try { HadoopFileUtils.move(getConfiguration(), resolveNameToPath(getConfiguration(), getResourceName(), providerProperties, true, true), new Path(toResource)); } catch (IllegalArgumentException e) { throw new IOException(e); } } HdfsMrsImageDataProvider(Configuration conf,
    String resourceName, ProviderProperties providerProperties); @SuppressWarnings("squid:S1166") // Exception caught and handled static boolean canOpen(Configuration conf, String input,
    ProviderProperties providerProperties); static boolean exists(Configuration conf, String input,
    ProviderProperties providerProperties); static void delete(Configuration conf, String input,
    ProviderProperties providerProperties); @SuppressWarnings("squid:S1166") // Exception caught and handled static boolean canWrite(Configuration conf, String input,
    ProviderProperties providerProperties); static Path getBasePath(Configuration conf); @Override String getSimpleResourceName(); String getResolvedResourceName(boolean mustExist); Path getResourcePath(boolean mustExist); @Override MrsImageInputFormatProvider getImageInputFormatProvider(ImageInputFormatContext context); @Override MrsImageOutputFormatProvider getTiledOutputFormatProvider(ImageOutputFormatContext context); @Override RecordReader<TileIdWritable, RasterWritable> getRecordReader(); @Override RecordWriter<TileIdWritable, RasterWritable> getRecordWriter(); @Override MrsImageReader getMrsTileReader(MrsPyramidReaderContext context); @Override void delete(int zoomlevel); @Override MrsImageWriter getMrsTileWriter(MrsPyramidWriterContext context); @Override MrsPyramidMetadataReader getMetadataReader(MrsPyramidMetadataReaderContext context); @Override MrsPyramidMetadataWriter getMetadataWriter(MrsPyramidMetadataWriterContext context); @Override void delete(); @Override void move(String toResource); @Override boolean validateProtectionLevel(String protectionLevel); final static String METADATA; }