Package com.google.cloud.tpu.v2.spring
Class TpuSpringAutoConfiguration
java.lang.Object
com.google.cloud.tpu.v2.spring.TpuSpringAutoConfiguration
@Generated("by google-cloud-spring-generator")
@BetaApi("Autogenerated Spring autoconfiguration is not yet stable")
@AutoConfiguration
@AutoConfigureAfter(GcpContextAutoConfiguration.class)
@ConditionalOnClass(com.google.cloud.tpu.v2.TpuClient.class)
@ConditionalOnProperty(value="com.google.cloud.tpu.v2.tpu.enabled",
matchIfMissing=true)
@EnableConfigurationProperties(TpuSpringProperties.class)
public class TpuSpringAutoConfiguration
extends Object
Auto-configuration for
TpuClient
.
Provides auto-configuration for Spring Boot
The default instance has everything set to sensible defaults:
- The default transport provider is used.
- Credentials are acquired automatically through Application Default Credentials.
- Retries are configured for idempotent methods but not for non-idempotent methods.
-
Constructor Summary
ModifierConstructorDescriptionprotected
TpuSpringAutoConfiguration
(TpuSpringProperties clientProperties, com.google.api.gax.core.CredentialsProvider credentialsProvider) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.gax.rpc.TransportChannelProvider
Provides a default transport channel provider bean, corresponding to the client library's default transport channel provider.com.google.cloud.tpu.v2.TpuClient
tpuClient
(com.google.cloud.tpu.v2.TpuSettings tpuSettings) Provides a TpuClient bean configured with TpuSettings.com.google.cloud.tpu.v2.TpuSettings
tpuSettings
(com.google.api.gax.rpc.TransportChannelProvider defaultTransportChannelProvider) Provides a TpuSettings bean configured to use a DefaultCredentialsProvider and the client library's default transport channel provider (defaultTpuTransportChannelProvider()).
-
Constructor Details
-
TpuSpringAutoConfiguration
protected TpuSpringAutoConfiguration(TpuSpringProperties clientProperties, com.google.api.gax.core.CredentialsProvider credentialsProvider) throws IOException - Throws:
IOException
-
-
Method Details
-
defaultTpuTransportChannelProvider
@Bean @ConditionalOnMissingBean(name="defaultTpuTransportChannelProvider") public com.google.api.gax.rpc.TransportChannelProvider defaultTpuTransportChannelProvider()Provides a default transport channel provider bean, corresponding to the client library's default transport channel provider. If the library supports both GRPC and REST transport, and the useRest property is configured, the HTTP/JSON transport provider will be used instead of GRPC.- Returns:
- a default transport channel provider.
-
tpuSettings
@Bean @ConditionalOnMissingBean public com.google.cloud.tpu.v2.TpuSettings tpuSettings(@Qualifier("defaultTpuTransportChannelProvider") com.google.api.gax.rpc.TransportChannelProvider defaultTransportChannelProvider) throws IOException Provides a TpuSettings bean configured to use a DefaultCredentialsProvider and the client library's default transport channel provider (defaultTpuTransportChannelProvider()). It also configures the quota project ID and executor thread count, if provided through properties.Retry settings are also configured from service-level and method-level properties specified in TpuSpringProperties. Method-level properties will take precedence over service-level properties if available, and client library defaults will be used if neither are specified.
- Parameters:
defaultTransportChannelProvider
- TransportChannelProvider to use in the settings.- Returns:
- a
TpuSettings
bean configured withTransportChannelProvider
bean. - Throws:
IOException
-
tpuClient
@Bean @ConditionalOnMissingBean public com.google.cloud.tpu.v2.TpuClient tpuClient(com.google.cloud.tpu.v2.TpuSettings tpuSettings) throws IOException Provides a TpuClient bean configured with TpuSettings.- Parameters:
tpuSettings
- settings to configure an instance of client bean.- Returns:
- a
TpuClient
bean configured withTpuSettings
- Throws:
IOException
-