Skip to content

Commit

Permalink
Fixing API field name from routing to shards
Browse files Browse the repository at this point in the history
Signed-off-by: Shourya Dutta Biswas <114977491+shourya035@users.noreply.github.com>
  • Loading branch information
shourya035 committed Jul 11, 2023
1 parent 2213186 commit f282d54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public String toString() {
}

static final class Fields {
static final String SHARDS = "routing";
static final String SHARDS = "shards";
static final String INDICES = "indices";
}
}
18 changes: 13 additions & 5 deletions server/src/main/java/org/opensearch/index/shard/IndexShard.java
Original file line number Diff line number Diff line change
Expand Up @@ -4778,14 +4778,12 @@ private String copySegmentFiles(
skippedSegments.add(file);
}
if (targetRemoteDirectory != null) {
targetRemoteDirectory.copyFrom(storeDirectory, file, file, IOContext.DEFAULT);
}
if (file.startsWith(IndexFileNames.SEGMENTS)) {
assert segmentNFile == null : "There should be only one SegmentInfosSnapshot file";
segmentNFile = file;

}

}
beforeSegmentDownload(downloadStatsTracker, segmentsToDownload.size(), totalSizeOfSegmentsToDownload);
// Copying segments files to local store directory from remote store directory (Shard Recovery)
for (String file : segmentsToDownload) {
long startTimeInMs = System.currentTimeMillis();
try {
Expand All @@ -4797,6 +4795,16 @@ private String copySegmentFiles(
afterSegmentDownloadFailed(downloadStatsTracker, uploadedSegments.get(file).getLength());
}
}
// Copying segment files over to target remote directory from local store directory (Snapshot)
for (String file : uploadedSegments.keySet()) {
if (targetRemoteDirectory != null) {
targetRemoteDirectory.copyFrom(storeDirectory, file, file, IOContext.DEFAULT);
}
if (file.startsWith(IndexFileNames.SEGMENTS)) {
assert segmentNFile == null : "There should be only one SegmentInfosSnapshot file";
segmentNFile = file;
}
}
} finally {
logger.info("Downloaded segments here: {}", downloadedSegments);
logger.info("Skipped download for segments here: {}", skippedSegments);
Expand Down

0 comments on commit f282d54

Please sign in to comment.