Skip to content

Commit

Permalink
Replication/Recovery changes for writable warm index
Browse files Browse the repository at this point in the history
  • Loading branch information
nisgoel-amazon committed May 29, 2024
1 parent f7ed4cc commit 7051168
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ public IndexInput openInput(String name, IOContext context) throws IOException {
}
// If file has been uploaded to the Remote Store, fetch it from the Remote Store in blocks via OnDemandCompositeBlockIndexInput
else {
logger.trace("Complete file not in FileCache, to be fetched in Blocks from Remote");
RemoteSegmentMetadata remoteSegmentMetadata = remoteDirectory.readLatestMetadataFile();
RemoteSegmentStoreDirectory.UploadedSegmentMetadata uploadedSegmentMetadata = remoteSegmentMetadata.getMetadata().get(name);
logger.trace("Complete file not in FileCache, to be fetched in Blocks from Remote {}", name);
RemoteSegmentStoreDirectory.UploadedSegmentMetadata uploadedSegmentMetadata = remoteDirectory.getSegmentsUploadedToRemoteStore().get(name);
// TODO : Refactor FileInfo and OnDemandBlockSnapshotIndexInput to more generic names as they are not Remote Snapshot specific
BlobStoreIndexShardSnapshot.FileInfo fileInfo = new BlobStoreIndexShardSnapshot.FileInfo(
name,
Expand All @@ -233,7 +232,6 @@ public IndexInput openInput(String name, IOContext context) throws IOException {
public void close() throws IOException {
Arrays.stream(localDirectory.listAll()).forEach(f -> fileCache.remove(localDirectory.getDirectory().resolve(f)));
localDirectory.close();
remoteDirectory.close();
}

/**
Expand Down

0 comments on commit 7051168

Please sign in to comment.