From c7e7d96f9c629a6561e2f84c1eba9de9c59ba57d Mon Sep 17 00:00:00 2001 From: bansvaru Date: Thu, 8 Jun 2023 14:59:53 +0530 Subject: [PATCH] rename instance method to reflect updated semantics Signed-off-by: bansvaru --- .../transfer/TranslogTransferManager.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java b/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java index 62be6fe2d406e..352e7dc2cc0e6 100644 --- a/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java +++ b/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java @@ -50,7 +50,7 @@ public class TranslogTransferManager { private final ShardId shardId; private final TransferService transferService; - private final BlobPath remoteBaseTransferPath; + private final BlobPath remoteDataTransferPath; private final BlobPath remoteMetadataTransferPath; private final FileTransferTracker fileTransferTracker; @@ -64,13 +64,13 @@ public class TranslogTransferManager { public TranslogTransferManager( ShardId shardId, TransferService transferService, - BlobPath remoteBaseTransferPath, + BlobPath remoteDataTransferPath, FileTransferTracker fileTransferTracker ) { this.shardId = shardId; this.transferService = transferService; - this.remoteBaseTransferPath = remoteBaseTransferPath.add(DATA_DIR); - this.remoteMetadataTransferPath = remoteBaseTransferPath.add(METADATA_DIR); + this.remoteDataTransferPath = remoteDataTransferPath.add(DATA_DIR); + this.remoteMetadataTransferPath = remoteDataTransferPath.add(METADATA_DIR); this.fileTransferTracker = fileTransferTracker; } @@ -111,7 +111,7 @@ public boolean transferSnapshot(TransferSnapshot transferSnapshot, TranslogTrans fileSnapshot -> transferService.uploadBlobAsync( ThreadPool.Names.TRANSLOG_TRANSFER, fileSnapshot, - remoteBaseTransferPath.add(String.valueOf(fileSnapshot.getPrimaryTerm())), + remoteDataTransferPath.add(String.valueOf(fileSnapshot.getPrimaryTerm())), latchedActionListener ) ); @@ -165,7 +165,7 @@ private void downloadToFS(String fileName, Path location, String primaryTerm) th if (Files.exists(filePath)) { Files.delete(filePath); } - try (InputStream inputStream = transferService.downloadBlob(remoteBaseTransferPath.add(primaryTerm), fileName)) { + try (InputStream inputStream = transferService.downloadBlob(remoteDataTransferPath.add(primaryTerm), fileName)) { Files.copy(inputStream, filePath); } // Mark in FileTransferTracker so that the same files are not uploaded at the time of translog sync @@ -239,7 +239,7 @@ public void deleteGenerationAsync(long primaryTerm, Set generations, Runna */ public void deletePrimaryTermsAsync(long minPrimaryTermToKeep) { logger.info("Deleting primary terms from remote store lesser than {} for {}", minPrimaryTermToKeep, shardId); - transferService.listFoldersAsync(ThreadPool.Names.REMOTE_PURGE, remoteBaseTransferPath, new ActionListener<>() { + transferService.listFoldersAsync(ThreadPool.Names.REMOTE_PURGE, remoteDataTransferPath, new ActionListener<>() { @Override public void onResponse(Set folders) { Set primaryTermsInRemote = folders.stream().filter(folderName -> { @@ -272,7 +272,7 @@ public void onFailure(Exception e) { private void deletePrimaryTermAsync(long primaryTerm) { transferService.deleteAsync( ThreadPool.Names.REMOTE_PURGE, - remoteBaseTransferPath.add(String.valueOf(primaryTerm)), + remoteDataTransferPath.add(String.valueOf(primaryTerm)), new ActionListener<>() { @Override public void onResponse(Void unused) { @@ -318,7 +318,7 @@ private void deleteTranslogFilesAsync(long primaryTerm, List files, Runn try { transferService.deleteBlobsAsync( ThreadPool.Names.REMOTE_PURGE, - remoteBaseTransferPath.add(String.valueOf(primaryTerm)), + remoteDataTransferPath.add(String.valueOf(primaryTerm)), files, new ActionListener<>() { @Override