@@ -162,8 +162,6 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp
162162
163163 protected final RepositoryMetaData metadata ;
164164
165- protected final NamedXContentRegistry namedXContentRegistry ;
166-
167165 private static final int BUFFER_SIZE = 4096 ;
168166
169167 private static final String SNAPSHOT_PREFIX = "snap-" ;
@@ -213,11 +211,11 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp
213211
214212 private final CounterMetric restoreRateLimitingTimeInNanos = new CounterMetric ();
215213
216- private ChecksumBlobStoreFormat <MetaData > globalMetaDataFormat ;
214+ private final ChecksumBlobStoreFormat <MetaData > globalMetaDataFormat ;
217215
218- private ChecksumBlobStoreFormat <IndexMetaData > indexMetaDataFormat ;
216+ private final ChecksumBlobStoreFormat <IndexMetaData > indexMetaDataFormat ;
219217
220- private ChecksumBlobStoreFormat <SnapshotInfo > snapshotFormat ;
218+ private final ChecksumBlobStoreFormat <SnapshotInfo > snapshotFormat ;
221219
222220 private final boolean readOnly ;
223221
@@ -240,17 +238,21 @@ protected BlobStoreRepository(RepositoryMetaData metadata, Settings settings,
240238 NamedXContentRegistry namedXContentRegistry ) {
241239 this .settings = settings ;
242240 this .metadata = metadata ;
243- this .namedXContentRegistry = namedXContentRegistry ;
244241 this .compress = COMPRESS_SETTING .get (metadata .settings ());
245242 snapshotRateLimiter = getRateLimiter (metadata .settings (), "max_snapshot_bytes_per_sec" , new ByteSizeValue (40 , ByteSizeUnit .MB ));
246243 restoreRateLimiter = getRateLimiter (metadata .settings (), "max_restore_bytes_per_sec" , new ByteSizeValue (40 , ByteSizeUnit .MB ));
247244 readOnly = metadata .settings ().getAsBoolean ("readonly" , false );
248245
249-
250246 indexShardSnapshotFormat = new ChecksumBlobStoreFormat <>(SNAPSHOT_CODEC , SNAPSHOT_NAME_FORMAT ,
251247 BlobStoreIndexShardSnapshot ::fromXContent , namedXContentRegistry , compress );
252248 indexShardSnapshotsFormat = new ChecksumBlobStoreFormat <>(SNAPSHOT_INDEX_CODEC , SNAPSHOT_INDEX_NAME_FORMAT ,
253249 BlobStoreIndexShardSnapshots ::fromXContent , namedXContentRegistry , compress );
250+ globalMetaDataFormat = new ChecksumBlobStoreFormat <>(METADATA_CODEC , METADATA_NAME_FORMAT ,
251+ MetaData ::fromXContent , namedXContentRegistry , compress );
252+ indexMetaDataFormat = new ChecksumBlobStoreFormat <>(INDEX_METADATA_CODEC , METADATA_NAME_FORMAT ,
253+ IndexMetaData ::fromXContent , namedXContentRegistry , compress );
254+ snapshotFormat = new ChecksumBlobStoreFormat <>(SNAPSHOT_CODEC , SNAPSHOT_NAME_FORMAT ,
255+ SnapshotInfo ::fromXContentInternal , namedXContentRegistry , compress );
254256 }
255257
256258 @ Override
@@ -259,12 +261,6 @@ protected void doStart() {
259261 if (chunkSize != null && chunkSize .getBytes () <= 0 ) {
260262 throw new IllegalArgumentException ("the chunk size cannot be negative: [" + chunkSize + "]" );
261263 }
262- globalMetaDataFormat = new ChecksumBlobStoreFormat <>(METADATA_CODEC , METADATA_NAME_FORMAT ,
263- MetaData ::fromXContent , namedXContentRegistry , compress );
264- indexMetaDataFormat = new ChecksumBlobStoreFormat <>(INDEX_METADATA_CODEC , METADATA_NAME_FORMAT ,
265- IndexMetaData ::fromXContent , namedXContentRegistry , compress );
266- snapshotFormat = new ChecksumBlobStoreFormat <>(SNAPSHOT_CODEC , SNAPSHOT_NAME_FORMAT ,
267- SnapshotInfo ::fromXContentInternal , namedXContentRegistry , compress );
268264 }
269265
270266 @ Override
0 commit comments