Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a record class for ShardSnapshotMetaDeleteResult #88721

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3517,26 +3517,16 @@ public int getReadBufferSizeInBytes() {

/**
* The result of removing a snapshot from a shard folder in the repository.
*
* @param indexId Index that the snapshot was removed from
* @param shardId Shard id that the snapshot was removed from
* @param newGeneration Id of the new index-${uuid} blob that does not include the snapshot any more
* @param blobsToDelete Blob names in the shard directory that have become unreferenced in the new shard generation
*/
private static final class ShardSnapshotMetaDeleteResult {

// Index that the snapshot was removed from
private final IndexId indexId;

// Shard id that the snapshot was removed from
private final int shardId;

// Id of the new index-${uuid} blob that does not include the snapshot any more
private final ShardGeneration newGeneration;

// Blob names in the shard directory that have become unreferenced in the new shard generation
private final Collection<String> blobsToDelete;

ShardSnapshotMetaDeleteResult(IndexId indexId, int shardId, ShardGeneration newGeneration, Collection<String> blobsToDelete) {
this.indexId = indexId;
this.shardId = shardId;
this.newGeneration = newGeneration;
this.blobsToDelete = blobsToDelete;
}
}
private record ShardSnapshotMetaDeleteResult(
IndexId indexId,
int shardId,
ShardGeneration newGeneration,
Collection<String> blobsToDelete
) {}
}