@Test public void simple() throws Exception { File cacheRepo = folder.newFolder(); Configuration configuration = new ConfigurationProvider().newInstance(); LockProvider<Path> locks = new LocalFileLockProvider<>(folder.newFolder()); RetryStrategy retrier = new ConstantRetryStrategy(); HadoopFileCacheRepository cache = new HadoopFileCacheRepository(configuration, path(cacheRepo), locks, retrier); File source = put(folder.newFile(), "Hello, world!"); Path resolved = cache.resolve(path(source)); assertThat(get(file(resolved)), is("Hello, world!")); assertThat(resolved, is(not(path(source)))); assertThat(containsFile(cacheRepo, file(resolved)), is(true)); }
@Override public Path resolve(Path file) throws IOException, InterruptedException { FileSystem fs = file.getFileSystem(configuration); Path qualified = fs.makeQualified(file); return doResolve(qualified); }
HadoopFileCacheRepository implements FileCacheRepository { @Override public Path resolve(Path file) throws IOException, InterruptedException { FileSystem fs = file.getFileSystem(configuration); Path qualified = fs.makeQualified(file); return doResolve(qualified); } }
HadoopFileCacheRepository implements FileCacheRepository { @Override public Path resolve(Path file) throws IOException, InterruptedException { FileSystem fs = file.getFileSystem(configuration); Path qualified = fs.makeQualified(file); return doResolve(qualified); } HadoopFileCacheRepository(
            Configuration configuration,
            Path repository,
            LockProvider<? super Path> lockProvider,
            RetryStrategy retryStrategy); }
HadoopFileCacheRepository implements FileCacheRepository { @Override public Path resolve(Path file) throws IOException, InterruptedException { FileSystem fs = file.getFileSystem(configuration); Path qualified = fs.makeQualified(file); return doResolve(qualified); } HadoopFileCacheRepository(
            Configuration configuration,
            Path repository,
            LockProvider<? super Path> lockProvider,
            RetryStrategy retryStrategy); @Override Path resolve(Path file); }
HadoopFileCacheRepository implements FileCacheRepository { @Override public Path resolve(Path file) throws IOException, InterruptedException { FileSystem fs = file.getFileSystem(configuration); Path qualified = fs.makeQualified(file); return doResolve(qualified); } HadoopFileCacheRepository(
            Configuration configuration,
            Path repository,
            LockProvider<? super Path> lockProvider,
            RetryStrategy retryStrategy); @Override Path resolve(Path file);  }