Skip to content

Commit

Permalink
Update PR after internaly sync up about the approach
Browse files Browse the repository at this point in the history
  • Loading branch information
sugmanue committed Oct 3, 2023
1 parent 084e6b3 commit d2b7722
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ protected static MethodSpec updateSdkClientConfigurationMethod(TypeName serviceC
.addStatement("return serviceConfigBuilder.buildSdkClientConfiguration()")
.addCode("$<};\n");
builder.addStatement("$T plugins = request.overrideConfiguration()\n"
+ ".map(c -> c.registeredPlugins()).orElse(Collections.emptyList())",
+ ".map(c -> c.plugins()).orElse(Collections.emptyList())",
ParameterizedTypeName.get(List.class, SdkPlugin.class));
builder.addStatement("return $T.invokePlugins(clientConfiguration, plugins, configurationUpdater)",
SdkClientConfigurationUtil.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ protected SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request
consumer.accept(serviceConfigBuilder);
return serviceConfigBuilder.buildSdkClientConfiguration();
};
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.registeredPlugins()).orElse(Collections.emptyList());
List<SdkPlugin> plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
return SdkClientConfigurationUtil.invokePlugins(clientConfiguration, plugins, configurationUpdater);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public <InputT extends SdkRequest, OutputT extends SdkResponse, ReturnT> Complet

@Override
protected <InputT extends SdkRequest, OutputT extends SdkResponse> ExecutionContext
invokeInterceptorsAndCreateExecutionContext(ClientExecutionParams<InputT, OutputT> executionParams,
SdkClientConfiguration clientConfiguration) {
invokeInterceptorsAndCreateExecutionContext(ClientExecutionParams<InputT, OutputT> executionParams) {
SdkClientConfiguration clientConfiguration = resolveRequestConfiguration(executionParams);
return AwsExecutionContextBuilder.invokeInterceptorsAndCreateExecutionContext(executionParams, clientConfiguration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public <InputT extends SdkRequest, OutputT extends SdkResponse, ReturnT> ReturnT

@Override
protected <InputT extends SdkRequest, OutputT extends SdkResponse> ExecutionContext
invokeInterceptorsAndCreateExecutionContext(ClientExecutionParams<InputT, OutputT> executionParams,
SdkClientConfiguration clientConfiguration) {
invokeInterceptorsAndCreateExecutionContext(ClientExecutionParams<InputT, OutputT> executionParams) {
SdkClientConfiguration clientConfiguration = resolveRequestConfiguration(executionParams);
return AwsExecutionContextBuilder.invokeInterceptorsAndCreateExecutionContext(executionParams, clientConfiguration);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public List<MetricPublisher> metricPublishers() {
/**
* Return the plugins that will be used to update the configuration used by the request.
*/
public List<SdkPlugin> registeredPlugins() {
public List<SdkPlugin> plugins() {
return plugins;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,6 @@ private static InterceptorContext runModifyHttpRequestAndHttpContentInterceptors
invokeInterceptorsAndCreateExecutionContext(
ClientExecutionParams<InputT, OutputT> params) {
SdkClientConfiguration clientConfiguration = resolveRequestConfiguration(params);
return invokeInterceptorsAndCreateExecutionContext(params, clientConfiguration);
}

// This method is only called from tests, since the subclasses in aws-core override it.
protected <InputT extends SdkRequest, OutputT extends SdkResponse> ExecutionContext
invokeInterceptorsAndCreateExecutionContext(
ClientExecutionParams<InputT, OutputT> params,
SdkClientConfiguration clientConfiguration) {
SdkRequest originalRequest = params.getInput();

ExecutionAttributes executionAttributes = params.executionAttributes();
Expand Down

0 comments on commit d2b7722

Please sign in to comment.