Skip to content
Merged
Show file tree
Hide file tree
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 @@ -157,8 +157,6 @@ class S3Repository extends BlobStoreRepository {

private final String cannedACL;

private final RepositoryMetaData repositoryMetaData;

/**
* Constructs an s3 backed repository
*/
Expand All @@ -169,8 +167,6 @@ class S3Repository extends BlobStoreRepository {
super(metadata, settings, namedXContentRegistry);
this.service = service;

this.repositoryMetaData = metadata;

// Parse and validate the user's S3 Storage Class setting
this.bucket = BUCKET_SETTING.get(metadata.settings());
if (bucket == null) {
Expand Down Expand Up @@ -216,7 +212,7 @@ class S3Repository extends BlobStoreRepository {

@Override
protected S3BlobStore createBlobStore() {
return new S3BlobStore(service, bucket, serverSideEncryption, bufferSize, cannedACL, storageClass, repositoryMetaData);
return new S3BlobStore(service, bucket, serverSideEncryption, bufferSize, cannedACL, storageClass, metadata);
}

// only use for testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp

protected final RepositoryMetaData metadata;

protected final NamedXContentRegistry namedXContentRegistry;

private static final int BUFFER_SIZE = 4096;

private static final String SNAPSHOT_PREFIX = "snap-";
Expand Down Expand Up @@ -213,11 +211,11 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp

private final CounterMetric restoreRateLimitingTimeInNanos = new CounterMetric();

private ChecksumBlobStoreFormat<MetaData> globalMetaDataFormat;
private final ChecksumBlobStoreFormat<MetaData> globalMetaDataFormat;

private ChecksumBlobStoreFormat<IndexMetaData> indexMetaDataFormat;
private final ChecksumBlobStoreFormat<IndexMetaData> indexMetaDataFormat;

private ChecksumBlobStoreFormat<SnapshotInfo> snapshotFormat;
private final ChecksumBlobStoreFormat<SnapshotInfo> snapshotFormat;

private final boolean readOnly;

Expand All @@ -240,17 +238,21 @@ protected BlobStoreRepository(RepositoryMetaData metadata, Settings settings,
NamedXContentRegistry namedXContentRegistry) {
this.settings = settings;
this.metadata = metadata;
this.namedXContentRegistry = namedXContentRegistry;
this.compress = COMPRESS_SETTING.get(metadata.settings());
snapshotRateLimiter = getRateLimiter(metadata.settings(), "max_snapshot_bytes_per_sec", new ByteSizeValue(40, ByteSizeUnit.MB));
restoreRateLimiter = getRateLimiter(metadata.settings(), "max_restore_bytes_per_sec", new ByteSizeValue(40, ByteSizeUnit.MB));
readOnly = metadata.settings().getAsBoolean("readonly", false);


indexShardSnapshotFormat = new ChecksumBlobStoreFormat<>(SNAPSHOT_CODEC, SNAPSHOT_NAME_FORMAT,
BlobStoreIndexShardSnapshot::fromXContent, namedXContentRegistry, compress);
indexShardSnapshotsFormat = new ChecksumBlobStoreFormat<>(SNAPSHOT_INDEX_CODEC, SNAPSHOT_INDEX_NAME_FORMAT,
BlobStoreIndexShardSnapshots::fromXContent, namedXContentRegistry, compress);
globalMetaDataFormat = new ChecksumBlobStoreFormat<>(METADATA_CODEC, METADATA_NAME_FORMAT,
MetaData::fromXContent, namedXContentRegistry, compress);
indexMetaDataFormat = new ChecksumBlobStoreFormat<>(INDEX_METADATA_CODEC, METADATA_NAME_FORMAT,
IndexMetaData::fromXContent, namedXContentRegistry, compress);
snapshotFormat = new ChecksumBlobStoreFormat<>(SNAPSHOT_CODEC, SNAPSHOT_NAME_FORMAT,
SnapshotInfo::fromXContentInternal, namedXContentRegistry, compress);
}

@Override
Expand All @@ -259,12 +261,6 @@ protected void doStart() {
if (chunkSize != null && chunkSize.getBytes() <= 0) {
throw new IllegalArgumentException("the chunk size cannot be negative: [" + chunkSize + "]");
}
globalMetaDataFormat = new ChecksumBlobStoreFormat<>(METADATA_CODEC, METADATA_NAME_FORMAT,
MetaData::fromXContent, namedXContentRegistry, compress);
indexMetaDataFormat = new ChecksumBlobStoreFormat<>(INDEX_METADATA_CODEC, METADATA_NAME_FORMAT,
IndexMetaData::fromXContent, namedXContentRegistry, compress);
snapshotFormat = new ChecksumBlobStoreFormat<>(SNAPSHOT_CODEC, SNAPSHOT_NAME_FORMAT,
SnapshotInfo::fromXContentInternal, namedXContentRegistry, compress);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class FsRepository extends BlobStoreRepository {
new ByteSizeValue(Long.MAX_VALUE), new ByteSizeValue(5), new ByteSizeValue(Long.MAX_VALUE), Property.NodeScope);
private final Environment environment;

private ByteSizeValue chunkSize;
private final ByteSizeValue chunkSize;

private final BlobPath basePath;

Expand Down