Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Sandeep Kumawat <[email protected]>
  • Loading branch information
skumawat2025 committed May 7, 2024
1 parent 279c4f7 commit 7437c73
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ public void trimUnreferencedReaders() throws IOException {
// This enables us to restore translog from the metadata in case of failover or relocation.
Set<Long> generationsToDelete = new HashSet<>();
for (long generation = minRemoteGenReferenced - 1 - indexSettings().getRemoteTranslogExtraKeep(); generation >= 0; generation--) {
if (fileTransferTracker.uploaded(Translog.getFilename(generation)) == false) {
if (fileTransferTracker.translogGenerationUploaded(generation) == false) {
break;
}
generationsToDelete.add(generation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public boolean uploaded(String file) {
return fileTransferTracker.get(file) == TransferState.SUCCESS;
}

boolean translogGenerationUploaded(Long generation) {
public boolean translogGenerationUploaded(Long generation) {
return generationTransferTracker.get(generation) == TransferState.SUCCESS;
}

Expand All @@ -197,7 +197,7 @@ Set<TranslogCheckpointSnapshot> exclusionFilter(Set<TranslogCheckpointSnapshot>
.collect(Collectors.toSet());
}

Set<Long> allUploadedGeneration() {
public Set<Long> allUploadedGeneration() {
return getSuccessfulKeys(generationTransferTracker);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
*/
public class TranslogCkpAsMetadataFileTransferManager extends TranslogTransferManager {

TransferService transferService;

public TranslogCkpAsMetadataFileTransferManager(
ShardId shardId,
TransferService transferService,
Expand All @@ -50,7 +48,6 @@ public TranslogCkpAsMetadataFileTransferManager(
remoteTranslogTransferTracker,
remoteStoreSettings
);
this.transferService = transferService;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
* @opensearch.internal
*/
public class TranslogCkpFilesTransferManager extends TranslogTransferManager {

TransferService transferService;
FileTransferTracker fileTransferTracker;

public TranslogCkpFilesTransferManager(
ShardId shardId,
TransferService transferService,
Expand All @@ -54,8 +50,6 @@ public TranslogCkpFilesTransferManager(
remoteTranslogTransferTracker,
remoteStoreSettings
);
this.transferService = transferService;
this.fileTransferTracker = fileTransferTracker;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
public abstract class TranslogTransferManager {

private final ShardId shardId;
private final TransferService transferService;
protected final TransferService transferService;
private final BlobPath remoteDataTransferPath;
private final BlobPath remoteMetadataTransferPath;
private final FileTransferTracker fileTransferTracker;
protected final FileTransferTracker fileTransferTracker;
private final RemoteTranslogTransferTracker remoteTranslogTransferTracker;
private final RemoteStoreSettings remoteStoreSettings;
private static final int METADATA_FILES_TO_FETCH = 10;
Expand Down

0 comments on commit 7437c73

Please sign in to comment.