Skip to content

Commit

Permalink
Add back RemoteFsTranslog.getRemoteTranslogTracker()
Browse files Browse the repository at this point in the history
Signed-off-by: Bhumika Saini <sabhumik@amazon.com>
  • Loading branch information
Bhumika Saini committed Sep 4, 2023
1 parent 875a5e5 commit 84c6374
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ public RemoteFsTranslog(
}
}

// visible for testing
RemoteTranslogTransferTracker getRemoteTranslogTracker() {
return remoteTranslogTransferTracker;
}

public static void download(Repository repository, ShardId shardId, ThreadPool threadPool, Path location, Logger logger)
throws IOException {
assert repository instanceof BlobStoreRepository : String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public boolean transferSnapshot(TransferSnapshot transferSnapshot, TranslogTrans

uploadStartTime = System.nanoTime();
// TODO: Ideally each file's upload start time should be when it is actually picked for upload
// https://github.com/opensearch-project/OpenSearch/issues/9729
fileTransferTracker.recordFileTransferStartTime(uploadStartTime);
transferService.uploadBlobs(toUpload, blobPathMap, latchedActionListener, WritePriority.HIGH);

Expand Down Expand Up @@ -199,6 +200,7 @@ public boolean transferSnapshot(TransferSnapshot transferSnapshot, TranslogTrans
private void captureStatsBeforeUpload() {
remoteTranslogTransferTracker.incrementTotalUploadsStarted();
// TODO: Ideally each file's byte uploads started should be when it is actually picked for upload
// https://github.com/opensearch-project/OpenSearch/issues/9729
remoteTranslogTransferTracker.addUploadBytesStarted(fileTransferTracker.getTotalBytesToUpload());
}

Expand Down

0 comments on commit 84c6374

Please sign in to comment.