Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.opensearch.common.annotation.ExperimentalApi;
Expand Down Expand Up @@ -206,7 +207,7 @@ private DelayedCreationCachedIndexInput(FileCache fileCache, StreamReader stream
@Override
public IndexInput getIndexInput() throws IOException {
if (isClosed.get()) {
throw new IllegalStateException("Already closed");
throw new AlreadyClosedException("Already closed");
}
if (isStarted.getAndSet(true) == false) {
// We're the first one here, need to download the block
Expand All @@ -233,7 +234,7 @@ public IndexInput getIndexInput() throws IOException {
public CompletableFuture<IndexInput> asyncLoadIndexInput(Executor executor) {
if (isClosed.get()) {
fileCache.decRef(request.getFilePath());
return CompletableFuture.failedFuture(new IllegalStateException("Already closed"));
return CompletableFuture.failedFuture(new AlreadyClosedException("Already closed"));
}
if (isStarted.getAndSet(true) == false) {
// Create new future and set it as the result
Expand Down
Loading