From a804a8809a07e6494c9f7dacf6ec76fa34856273 Mon Sep 17 00:00:00 2001 From: Pooya Salehi Date: Fri, 22 Jul 2022 15:20:15 +0200 Subject: [PATCH] Use a record class for ShardSnapshotMetaDeleteResult (#88721) --- .../blobstore/BlobStoreRepository.java | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index 8117bf7f10a23..3b6f61aad09ee 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -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 blobsToDelete; - - ShardSnapshotMetaDeleteResult(IndexId indexId, int shardId, ShardGeneration newGeneration, Collection blobsToDelete) { - this.indexId = indexId; - this.shardId = shardId; - this.newGeneration = newGeneration; - this.blobsToDelete = blobsToDelete; - } - } + private record ShardSnapshotMetaDeleteResult( + IndexId indexId, + int shardId, + ShardGeneration newGeneration, + Collection blobsToDelete + ) {} }