@@ -15,7 +15,7 @@ use crate::client::retries::strategy::standard::TokenBucketProvider;
1515use crate :: client:: retries:: strategy:: StandardRetryStrategy ;
1616use crate :: client:: retries:: RetryPartition ;
1717use aws_smithy_async:: rt:: sleep:: default_async_sleep;
18- use aws_smithy_async:: time:: { SharedTimeSource , SystemTimeSource , TimeSource } ;
18+ use aws_smithy_async:: time:: SystemTimeSource ;
1919use aws_smithy_runtime_api:: box_error:: BoxError ;
2020use aws_smithy_runtime_api:: client:: behavior_version:: BehaviorVersion ;
2121use aws_smithy_runtime_api:: client:: http:: SharedHttpClient ;
@@ -126,7 +126,6 @@ pub fn default_time_source_plugin() -> Option<SharedRuntimePlugin> {
126126}
127127
128128/// Runtime plugin that sets the default retry strategy, config (disabled), and partition.
129- #[ deprecated = "Use default_retry_config_plugin_v2 to get a TokenBucket that respects the user provided TimeSource." ]
130129pub fn default_retry_config_plugin (
131130 default_partition_name : impl Into < Cow < ' static , str > > ,
132131) -> Option < SharedRuntimePlugin > {
@@ -138,43 +137,7 @@ pub fn default_retry_config_plugin(
138137 . with_config_validator ( SharedConfigValidator :: base_client_config_fn (
139138 validate_retry_config,
140139 ) )
141- . with_interceptor ( TokenBucketProvider :: new (
142- retry_partition. clone ( ) ,
143- SharedTimeSource :: default ( ) , // Replicates previous behavior
144- ) )
145- } )
146- . with_config ( layer ( "default_retry_config" , |layer| {
147- layer. store_put ( RetryConfig :: disabled ( ) ) ;
148- layer. store_put ( retry_partition) ;
149- } ) )
150- . into_shared ( ) ,
151- )
152- }
153-
154- /// Runtime plugin that sets the default retry strategy, config (disabled), and partition.
155- pub fn default_retry_config_plugin_v2 (
156- default_plugin_params : & DefaultPluginParams ,
157- ) -> Option < SharedRuntimePlugin > {
158- let retry_partition = RetryPartition :: new (
159- default_plugin_params
160- . retry_partition_name ( )
161- . clone ( )
162- . expect ( "retry_partition_name is required" ) ,
163- ) ;
164- Some (
165- default_plugin ( "default_retry_config_plugin" , |components| {
166- components
167- . with_retry_strategy ( Some ( StandardRetryStrategy :: new ( ) ) )
168- . with_config_validator ( SharedConfigValidator :: base_client_config_fn (
169- validate_retry_config,
170- ) )
171- . with_interceptor ( TokenBucketProvider :: new (
172- retry_partition. clone ( ) ,
173- default_plugin_params
174- . time_source
175- . clone ( )
176- . unwrap_or_default ( ) ,
177- ) )
140+ . with_interceptor ( TokenBucketProvider :: new ( retry_partition. clone ( ) ) )
178141 } )
179142 . with_config ( layer ( "default_retry_config" , |layer| {
180143 layer. store_put ( RetryConfig :: disabled ( ) ) ;
@@ -325,7 +288,6 @@ fn validate_stalled_stream_protection_config(
325288pub struct DefaultPluginParams {
326289 retry_partition_name : Option < Cow < ' static , str > > ,
327290 behavior_version : Option < BehaviorVersion > ,
328- time_source : Option < SharedTimeSource > ,
329291}
330292
331293impl DefaultPluginParams {
@@ -340,32 +302,11 @@ impl DefaultPluginParams {
340302 self
341303 }
342304
343- /// Gets the retry partition name.
344- pub fn retry_partition_name ( & self ) -> & Option < Cow < ' static , str > > {
345- & self . retry_partition_name
346- }
347-
348305 /// Sets the behavior major version.
349306 pub fn with_behavior_version ( mut self , version : BehaviorVersion ) -> Self {
350307 self . behavior_version = Some ( version) ;
351308 self
352309 }
353-
354- /// Gets the behavior major version.
355- pub fn behavior_version ( & self ) -> & Option < BehaviorVersion > {
356- & self . behavior_version
357- }
358-
359- /// Sets the time_source.
360- pub fn with_time_source ( mut self , time_source : impl TimeSource + ' static ) -> Self {
361- self . time_source = Some ( SharedTimeSource :: new ( time_source) ) ;
362- self
363- }
364-
365- /// Gets the time_source.
366- pub fn time_source ( & self ) -> & Option < SharedTimeSource > {
367- & self . time_source
368- }
369310}
370311
371312/// All default plugins.
@@ -379,7 +320,11 @@ pub fn default_plugins(
379320 [
380321 default_http_client_plugin_v2 ( behavior_version) ,
381322 default_identity_cache_plugin ( ) ,
382- default_retry_config_plugin_v2 ( & params) ,
323+ default_retry_config_plugin (
324+ params
325+ . retry_partition_name
326+ . expect ( "retry_partition_name is required" ) ,
327+ ) ,
383328 default_sleep_impl_plugin ( ) ,
384329 default_time_source_plugin ( ) ,
385330 default_timeout_config_plugin ( ) ,
0 commit comments