@@ -122,28 +122,28 @@ final class S3ClientSettings {
122122 static final Setting .AffixSetting <TimeValue > READ_TIMEOUT_SETTING = Setting .affixKeySetting (
123123 PREFIX ,
124124 "read_timeout" ,
125- key -> Setting .timeSetting (key , TimeValue . timeValueMillis ( ClientConfiguration . DEFAULT_SOCKET_TIMEOUT ) , Property .NodeScope )
125+ key -> Setting .timeSetting (key , Defaults . READ_TIMEOUT , Property .NodeScope )
126126 );
127127
128128 /** The maximum number of concurrent connections to use. */
129129 static final Setting .AffixSetting <Integer > MAX_CONNECTIONS_SETTING = Setting .affixKeySetting (
130130 PREFIX ,
131131 "max_connections" ,
132- key -> Setting .intSetting (key , ClientConfiguration . DEFAULT_MAX_CONNECTIONS , 1 , Property .NodeScope )
132+ key -> Setting .intSetting (key , Defaults . MAX_CONNECTIONS , 1 , Property .NodeScope )
133133 );
134134
135135 /** The number of retries to use when an s3 request fails. */
136136 static final Setting .AffixSetting <Integer > MAX_RETRIES_SETTING = Setting .affixKeySetting (
137137 PREFIX ,
138138 "max_retries" ,
139- key -> Setting .intSetting (key , ClientConfiguration . DEFAULT_RETRY_POLICY . getMaxErrorRetry () , 0 , Property .NodeScope )
139+ key -> Setting .intSetting (key , Defaults . RETRY_COUNT , 0 , Property .NodeScope )
140140 );
141141
142142 /** Whether retries should be throttled (ie use backoff). */
143143 static final Setting .AffixSetting <Boolean > USE_THROTTLE_RETRIES_SETTING = Setting .affixKeySetting (
144144 PREFIX ,
145145 "use_throttle_retries" ,
146- key -> Setting .boolSetting (key , ClientConfiguration . DEFAULT_THROTTLE_RETRIES , Property .NodeScope )
146+ key -> Setting .boolSetting (key , Defaults . THROTTLE_RETRIES , Property .NodeScope )
147147 );
148148
149149 /** Whether the s3 client should use path style access. */
@@ -336,7 +336,7 @@ S3ClientSettings refine(Settings repositorySettings) {
336336
337337 /**
338338 * Load all client settings from the given settings.
339- *
339+ * <p>
340340 * Note this will always at least return a client named "default".
341341 */
342342 static Map <String , S3ClientSettings > load (Settings settings ) {
@@ -502,4 +502,11 @@ private static <T> T getRepoSettingOrDefault(Setting.AffixSetting<T> setting, Se
502502 }
503503 return defaultValue ;
504504 }
505+
506+ static final class Defaults {
507+ static final TimeValue READ_TIMEOUT = TimeValue .timeValueMillis (ClientConfiguration .DEFAULT_SOCKET_TIMEOUT );
508+ static final int MAX_CONNECTIONS = ClientConfiguration .DEFAULT_MAX_CONNECTIONS ;
509+ static final int RETRY_COUNT = ClientConfiguration .DEFAULT_RETRY_POLICY .getMaxErrorRetry ();
510+ static final boolean THROTTLE_RETRIES = ClientConfiguration .DEFAULT_THROTTLE_RETRIES ;
511+ }
505512}
0 commit comments