@Test public void update() 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 first = cache.resolve(path(source)); put(source, "UPDATED"); Path retry = cache.resolve(path(source)); assertThat(retry, is(first)); assertThat(get(file(retry)), is("UPDATED")); }
@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);  }