diff --git a/test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java b/test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java index 9b4c137bb2d..4dd506a165d 100644 --- a/test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java +++ b/test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java @@ -182,7 +182,7 @@ public final class BlobStoreTestUtil { throws InterruptedException, ExecutionException { final PlainActionFuture future = PlainActionFuture.newFuture(); final AtomicLong totalSize = new AtomicLong(); - repository.threadPool().generic().execute(new ActionRunnable<>(future) { + repository.threadPool().generic().execute(new ActionRunnable(future) { @Override protected void doRun() throws Exception { final BlobStore blobStore = repository.blobStore(); @@ -202,7 +202,7 @@ public final class BlobStoreTestUtil { public static void assertCorruptionVisible(BlobStoreRepository repository, Map> indexToFiles) { final PlainActionFuture future = PlainActionFuture.newFuture(); - repository.threadPool().generic().execute(new ActionRunnable<>(future) { + repository.threadPool().generic().execute(new ActionRunnable(future) { @Override protected void doRun() throws Exception { final BlobStore blobStore = repository.blobStore(); @@ -213,8 +213,9 @@ public final class BlobStoreTestUtil { return; } for (String file : indexToFiles.get(index)) { - if (blobStore.blobContainer(repository.basePath().add("indices").add(index)) - .blobExists(file) == false) { + try (InputStream ignored = + blobStore.blobContainer(repository.basePath().add("indices").add(index)).readBlob(file)) { + } catch (NoSuchFileException e) { future.onResponse(false); return; } @@ -228,7 +229,7 @@ public final class BlobStoreTestUtil { public static void assertBlobsByPrefix(BlobStoreRepository repository, BlobPath path, String prefix, Map blobs) { final PlainActionFuture> future = PlainActionFuture.newFuture(); - repository.threadPool().generic().execute(new ActionRunnable<>(future) { + repository.threadPool().generic().execute(new ActionRunnable>(future) { @Override protected void doRun() throws Exception { final BlobStore blobStore = repository.blobStore();