Skip to content

Commit ac8f8f2

Browse files
committed
fix #2816 azure repository was missing constructor taking its settings used by GetRepositoryResponse json converter (#2942)
1 parent b4f98ca commit ac8f8f2

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

src/Nest/Modules/SnapshotAndRestore/Repositories/AzureRepository.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ public interface IAzureRepository : IRepository<IAzureRepositorySettings> { }
77

88
public class AzureRepository : IAzureRepository
99
{
10+
public AzureRepository() { }
11+
12+
public AzureRepository(IAzureRepositorySettings settings)
13+
{
14+
Settings = settings;
15+
}
1016
public IAzureRepositorySettings Settings { get; set; }
1117
public string Type { get; } = "azure";
1218
}
@@ -41,7 +47,7 @@ public class AzureRepositorySettings : IAzureRepositorySettings
4147
public string ChunkSize { get; set; }
4248
}
4349

44-
public class AzureRepositorySettingsDescriptor
50+
public class AzureRepositorySettingsDescriptor
4551
: DescriptorBase<AzureRepositorySettingsDescriptor, IAzureRepositorySettings>, IAzureRepositorySettings
4652
{
4753
string IAzureRepositorySettings.BasePath { get; set; }
@@ -63,7 +69,7 @@ public class AzureRepositorySettingsDescriptor
6369
public AzureRepositorySettingsDescriptor BasePath(string basePath) => Assign(a => a.BasePath = basePath);
6470

6571
/// <summary>
66-
/// When set to true metadata files are stored in compressed format. This setting doesn't
72+
/// When set to true metadata files are stored in compressed format. This setting doesn't
6773
/// affect index files that are already compressed by default. Defaults to false.
6874
/// </summary>
6975
/// <param name="compress"></param>

src/Nest/Modules/SnapshotAndRestore/Repositories/FileSystemRepository.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public FileSystemRepositorySettings(string location)
5858
public string SnapshotBytesPerSecondMaximum { get; set; }
5959
}
6060

61-
public class FileSystemRepositorySettingsDescriptor
61+
public class FileSystemRepositorySettingsDescriptor
6262
: DescriptorBase<FileSystemRepositorySettingsDescriptor, IFileSystemRepositorySettings>, IFileSystemRepositorySettings
6363
{
6464
string IFileSystemRepositorySettings.Location { get; set; }
@@ -87,8 +87,8 @@ public class FileSystemRepositorySettingsDescriptor
8787
public FileSystemRepositorySettingsDescriptor ConcurrentStreams(int concurrentStreams) => Assign(a => a.ConcurrentStreams = concurrentStreams);
8888

8989
/// <summary>
90-
/// Big files can be broken down into chunks during snapshotting if needed.
91-
/// The chunk size can be specified in bytes or by using size value notation, i.e. 1g, 10m, 5k.
90+
/// Big files can be broken down into chunks during snapshotting if needed.
91+
/// The chunk size can be specified in bytes or by using size value notation, i.e. 1g, 10m, 5k.
9292
/// Defaults to null (unlimited chunk size).
9393
/// </summary>
9494
/// <param name="chunkSize"></param>
@@ -102,14 +102,14 @@ public FileSystemRepositorySettingsDescriptor RestoreBytesPerSecondMaximum(strin
102102
Assign(a => a.RestoreBytesPerSecondMaximum = maximumBytesPerSecond);
103103

104104
/// <summary>
105-
/// Throttles per node snapshot rate. Defaults to 20mb per second.
105+
/// Throttles per node snapshot rate. Defaults to 20mb per second.
106106
/// </summary>
107107
/// <param name="maximumBytesPerSecond"></param>
108108
public FileSystemRepositorySettingsDescriptor SnapshotBytesPerSecondMaximum(string maximumBytesPerSecond) =>
109109
Assign(a => a.SnapshotBytesPerSecondMaximum = maximumBytesPerSecond);
110110
}
111111

112-
public class FileSystemRepositoryDescriptor
112+
public class FileSystemRepositoryDescriptor
113113
: DescriptorBase<FileSystemRepositoryDescriptor, IFileSystemRepository>, IFileSystemRepository
114114
{
115115
IFileSystemRepositorySettings IRepository<IFileSystemRepositorySettings>.Settings { get; set; }

src/Nest/Modules/SnapshotAndRestore/Repositories/ReadOnlyUrlRepository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public ReadOnlyUrlRepositorySettingsDescriptor ConcurrentStreams(int concurrentS
5858
Assign(a => a.ConcurrentStreams = concurrentStreams);
5959
}
6060

61-
public class ReadOnlyUrlRepositoryDescriptor
61+
public class ReadOnlyUrlRepositoryDescriptor
6262
: DescriptorBase<ReadOnlyUrlRepositoryDescriptor, IReadOnlyUrlRepository>, IReadOnlyUrlRepository
6363
{
6464
string ISnapshotRepository.Type { get { return "url"; } }
@@ -67,4 +67,4 @@ public class ReadOnlyUrlRepositoryDescriptor
6767
public ReadOnlyUrlRepositoryDescriptor Settings(string location, Func<ReadOnlyUrlRepositorySettingsDescriptor, IReadOnlyUrlRepositorySettings> settingsSelector = null) =>
6868
Assign(a => a.Settings = settingsSelector.InvokeOrDefault(new ReadOnlyUrlRepositorySettingsDescriptor().Location(location)));
6969
}
70-
}
70+
}

0 commit comments

Comments
 (0)