|
21 | 21 |
|
22 | 22 | import com.microsoft.azure.storage.LocationMode; |
23 | 23 | import com.microsoft.azure.storage.RetryPolicy; |
24 | | -import org.elasticsearch.cloud.azure.storage.AzureStorageService.Storage; |
25 | | -import org.elasticsearch.common.collect.Tuple; |
26 | 24 | import org.elasticsearch.common.Strings; |
27 | 25 | import org.elasticsearch.common.collect.MapBuilder; |
| 26 | +import org.elasticsearch.common.collect.Tuple; |
28 | 27 | import org.elasticsearch.common.settings.SecureSetting; |
29 | 28 | import org.elasticsearch.common.settings.SecureString; |
30 | 29 | import org.elasticsearch.common.settings.Setting; |
|
33 | 32 | import org.elasticsearch.common.settings.Settings; |
34 | 33 | import org.elasticsearch.common.settings.SettingsException; |
35 | 34 | import org.elasticsearch.common.unit.TimeValue; |
| 35 | + |
36 | 36 | import java.net.InetAddress; |
37 | 37 | import java.net.InetSocketAddress; |
38 | 38 | import java.net.Proxy; |
39 | 39 | import java.net.UnknownHostException; |
40 | 40 | import java.util.ArrayList; |
41 | 41 | import java.util.Collections; |
42 | 42 | import java.util.HashMap; |
43 | | -import java.util.Locale; |
44 | 43 | import java.util.List; |
| 44 | +import java.util.Locale; |
45 | 45 | import java.util.Map; |
46 | 46 |
|
47 | | -import static org.elasticsearch.cloud.azure.storage.AzureStorageService.Storage.STORAGE_ACCOUNTS; |
48 | | - |
49 | 47 | public final class AzureStorageSettings { |
50 | 48 |
|
51 | 49 | // prefix for azure client settings |
@@ -88,6 +86,22 @@ public final class AzureStorageSettings { |
88 | 86 | PROXY_HOST_SETTING); |
89 | 87 |
|
90 | 88 |
|
| 89 | + public interface Storage { |
| 90 | + @Deprecated |
| 91 | + String PREFIX = "cloud.azure.storage."; |
| 92 | + |
| 93 | + @Deprecated |
| 94 | + Setting<Settings> STORAGE_ACCOUNTS = Setting.groupSetting(Storage.PREFIX, Setting.Property.NodeScope); |
| 95 | + |
| 96 | + /** |
| 97 | + * Azure timeout (defaults to -1 minute) |
| 98 | + * @deprecated We don't want to support global timeout settings anymore |
| 99 | + */ |
| 100 | + @Deprecated |
| 101 | + Setting<TimeValue> TIMEOUT_SETTING = |
| 102 | + Setting.timeSetting("cloud.azure.storage.timeout", TimeValue.timeValueMinutes(-1), Property.NodeScope, Property.Deprecated); |
| 103 | + } |
| 104 | + |
91 | 105 | @Deprecated |
92 | 106 | public static final AffixSetting<TimeValue> DEPRECATED_TIMEOUT_SETTING = Setting.affixKeySetting(Storage.PREFIX, "timeout", |
93 | 107 | (key) -> Setting.timeSetting(key, Storage.TIMEOUT_SETTING, Property.NodeScope, Property.Deprecated)); |
@@ -274,7 +288,7 @@ public static Map<String, AzureStorageSettings> load(Settings settings) { |
274 | 288 | } |
275 | 289 | return storageSettings; |
276 | 290 | } |
277 | | - |
| 291 | + |
278 | 292 | static Map<String, AzureStorageSettings> loadRegular(Settings settings) { |
279 | 293 | // Get the list of existing named configurations |
280 | 294 | final Map<String, AzureStorageSettings> storageSettings = new HashMap<>(); |
@@ -309,7 +323,7 @@ static AzureStorageSettings getClientSettings(Settings settings, String clientNa |
309 | 323 | @Deprecated |
310 | 324 | private static List<AzureStorageSettings> createStorageSettingsDeprecated(Settings settings) { |
311 | 325 | // ignore global timeout which has the same prefix but does not belong to any group |
312 | | - Settings groups = STORAGE_ACCOUNTS.get(settings.filter((k) -> k.equals(Storage.TIMEOUT_SETTING.getKey()) == false)); |
| 326 | + Settings groups = Storage.STORAGE_ACCOUNTS.get(settings.filter((k) -> k.equals(Storage.TIMEOUT_SETTING.getKey()) == false)); |
313 | 327 | List<AzureStorageSettings> storageSettings = new ArrayList<>(); |
314 | 328 | for (String groupName : groups.getAsGroups().keySet()) { |
315 | 329 | storageSettings.add( |
|
0 commit comments