Fix BlobStoreTestUtil
This commit is contained in:
parent
07cf2cb665
commit
6f5327ba45
|
@ -182,7 +182,7 @@ public final class BlobStoreTestUtil {
|
||||||
throws InterruptedException, ExecutionException {
|
throws InterruptedException, ExecutionException {
|
||||||
final PlainActionFuture<Void> future = PlainActionFuture.newFuture();
|
final PlainActionFuture<Void> future = PlainActionFuture.newFuture();
|
||||||
final AtomicLong totalSize = new AtomicLong();
|
final AtomicLong totalSize = new AtomicLong();
|
||||||
repository.threadPool().generic().execute(new ActionRunnable<>(future) {
|
repository.threadPool().generic().execute(new ActionRunnable<Void>(future) {
|
||||||
@Override
|
@Override
|
||||||
protected void doRun() throws Exception {
|
protected void doRun() throws Exception {
|
||||||
final BlobStore blobStore = repository.blobStore();
|
final BlobStore blobStore = repository.blobStore();
|
||||||
|
@ -202,7 +202,7 @@ public final class BlobStoreTestUtil {
|
||||||
|
|
||||||
public static void assertCorruptionVisible(BlobStoreRepository repository, Map<String, Set<String>> indexToFiles) {
|
public static void assertCorruptionVisible(BlobStoreRepository repository, Map<String, Set<String>> indexToFiles) {
|
||||||
final PlainActionFuture<Boolean> future = PlainActionFuture.newFuture();
|
final PlainActionFuture<Boolean> future = PlainActionFuture.newFuture();
|
||||||
repository.threadPool().generic().execute(new ActionRunnable<>(future) {
|
repository.threadPool().generic().execute(new ActionRunnable<Boolean>(future) {
|
||||||
@Override
|
@Override
|
||||||
protected void doRun() throws Exception {
|
protected void doRun() throws Exception {
|
||||||
final BlobStore blobStore = repository.blobStore();
|
final BlobStore blobStore = repository.blobStore();
|
||||||
|
@ -213,8 +213,9 @@ public final class BlobStoreTestUtil {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (String file : indexToFiles.get(index)) {
|
for (String file : indexToFiles.get(index)) {
|
||||||
if (blobStore.blobContainer(repository.basePath().add("indices").add(index))
|
try (InputStream ignored =
|
||||||
.blobExists(file) == false) {
|
blobStore.blobContainer(repository.basePath().add("indices").add(index)).readBlob(file)) {
|
||||||
|
} catch (NoSuchFileException e) {
|
||||||
future.onResponse(false);
|
future.onResponse(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -228,7 +229,7 @@ public final class BlobStoreTestUtil {
|
||||||
|
|
||||||
public static void assertBlobsByPrefix(BlobStoreRepository repository, BlobPath path, String prefix, Map<String, BlobMetaData> blobs) {
|
public static void assertBlobsByPrefix(BlobStoreRepository repository, BlobPath path, String prefix, Map<String, BlobMetaData> blobs) {
|
||||||
final PlainActionFuture<Map<String, BlobMetaData>> future = PlainActionFuture.newFuture();
|
final PlainActionFuture<Map<String, BlobMetaData>> future = PlainActionFuture.newFuture();
|
||||||
repository.threadPool().generic().execute(new ActionRunnable<>(future) {
|
repository.threadPool().generic().execute(new ActionRunnable<Map<String, BlobMetaData>>(future) {
|
||||||
@Override
|
@Override
|
||||||
protected void doRun() throws Exception {
|
protected void doRun() throws Exception {
|
||||||
final BlobStore blobStore = repository.blobStore();
|
final BlobStore blobStore = repository.blobStore();
|
||||||
|
|
Loading…
Reference in New Issue