Class InstantiatingGrpcChannelProvider.Builder
- Enclosing class:
- InstantiatingGrpcChannelProvider
-
Method Summary
Modifier and TypeMethodDescriptionbuild()ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> org.threeten.bp.DurationThis method is obsolete.The time without read activity before sending a keepalive ping.org.threeten.bp.DurationThis method is obsolete.The time without read activity after sending a keepalive ping.Whether keepalive will be performed when there are no outstanding RPCs.The maximum message size allowed to be received on the channel.The maximum metadata size allowed to be received on the channel.intDeprecated.setAllowHardBoundTokenTypes(List<InstantiatingGrpcChannelProvider.HardBoundTokenTypes> allowedValues) setAllowNonDefaultServiceAccount(boolean allowNonDefaultServiceAccount) Whether allow non-default service account for DirectPath.setAttemptDirectPath(boolean attemptDirectPath) Whether attempt DirectPath.Use DirectPath xDS.setChannelConfigurator(ApiFunction<io.grpc.ManagedChannelBuilder, io.grpc.ManagedChannelBuilder> channelConfigurator) Add a callback that can intercept channel creation.setChannelPoolSettings(ChannelPoolSettings settings) setChannelPrimer(ChannelPrimer channelPrimer) By setting a channelPrimer, the ChannelPool created by the provider will be refreshing ChannelPool. channelPrimer will be invoked periodically when the channels are refreshedsetChannelsPerCpu(double multiplier) Deprecated.Please usesetChannelPoolSettings(ChannelPoolSettings)setChannelsPerCpu(double multiplier, int maxChannels) Deprecated.Please usesetChannelPoolSettings(ChannelPoolSettings)setCredentials(com.google.auth.Credentials credentials) setDirectPathServiceConfig(Map<String, ?> serviceConfig) Sets a service config for direct path.setEndpoint(String endpoint) Sets the endpoint used to reach the service, eg "localhost:8080".setExecutor(Executor executor) Sets the Executor for this TransportChannelProvider.setExecutorProvider(ExecutorProvider executorProvider) Deprecated.Please usesetExecutor(Executor).setHeaderProvider(HeaderProvider headerProvider) Sets the HeaderProvider for this TransportChannelProvider.setInterceptorProvider(GrpcInterceptorProvider interceptorProvider) Sets the GrpcInterceptorProvider for this TransportChannelProvider.setKeepAliveTime(org.threeten.bp.Duration duration) This method is obsolete.setKeepAliveTimeDuration(Duration duration) The time without read activity before sending a keepalive ping.setKeepAliveTimeout(org.threeten.bp.Duration duration) This method is obsolete.setKeepAliveTimeoutDuration(Duration duration) The time without read activity after sending a keepalive ping.setKeepAliveWithoutCalls(Boolean keepalive) Whether keepalive will be performed when there are no outstanding RPCs.The maximum message size allowed to be received on the channel.The maximum metadata size allowed to be received on the channel.setPoolSize(int poolSize) Deprecated.Please usesetChannelPoolSettings(ChannelPoolSettings)
-
Method Details
-
setExecutor
Sets the Executor for this TransportChannelProvider.This is optional; if it is not provided, needsExecutor() will return true, meaning that an Executor must be provided when getChannel is called on the constructed TransportChannelProvider instance. Note: GrpcTransportProvider will automatically provide its own Executor in this circumstance when it calls getChannel.
-
setExecutorProvider
@Deprecated public InstantiatingGrpcChannelProvider.Builder setExecutorProvider(ExecutorProvider executorProvider) Deprecated.Please usesetExecutor(Executor). -
setHeaderProvider
Sets the HeaderProvider for this TransportChannelProvider.This is optional; if it is not provided, needsHeaders() will return true, meaning that headers must be provided when getChannel is called on the constructed TransportChannelProvider instance.
-
setEndpoint
Sets the endpoint used to reach the service, eg "localhost:8080". -
setAllowHardBoundTokenTypes
@InternalApi public InstantiatingGrpcChannelProvider.Builder setAllowHardBoundTokenTypes(List<InstantiatingGrpcChannelProvider.HardBoundTokenTypes> allowedValues) -
setInterceptorProvider
public InstantiatingGrpcChannelProvider.Builder setInterceptorProvider(GrpcInterceptorProvider interceptorProvider) Sets the GrpcInterceptorProvider for this TransportChannelProvider.The provider will be called once for each underlying gRPC ManagedChannel that is created. It is recommended to return a new list of new interceptors on each call so that interceptors are not shared among channels, but this is not required.
-
getEndpoint
-
setMaxInboundMessageSize
The maximum message size allowed to be received on the channel. -
getMaxInboundMessageSize
The maximum message size allowed to be received on the channel. -
setMaxInboundMetadataSize
@BetaApi("The surface for maximum metadata size is not stable yet and may change in the future.") public InstantiatingGrpcChannelProvider.Builder setMaxInboundMetadataSize(Integer max) The maximum metadata size allowed to be received on the channel. -
getMaxInboundMetadataSize
@BetaApi("The surface for maximum metadata size is not stable yet and may change in the future.") public Integer getMaxInboundMetadataSize()The maximum metadata size allowed to be received on the channel. -
setKeepAliveTime
@ObsoleteApi("Use setKeepAliveTimeDuration(java.time.Duration) instead") public InstantiatingGrpcChannelProvider.Builder setKeepAliveTime(org.threeten.bp.Duration duration) This method is obsolete. UsesetKeepAliveTimeDuration(java.time.Duration)instead. -
setKeepAliveTimeDuration
The time without read activity before sending a keepalive ping. -
getKeepAliveTime
@ObsoleteApi("Use getKeepAliveTimeDuration() instead") public org.threeten.bp.Duration getKeepAliveTime()This method is obsolete. UsegetKeepAliveTimeDuration()instead. -
getKeepAliveTimeDuration
The time without read activity before sending a keepalive ping. -
setKeepAliveTimeout
@ObsoleteApi("Use setKeepAliveTimeoutDuration(java.time.Duration) instead") public InstantiatingGrpcChannelProvider.Builder setKeepAliveTimeout(org.threeten.bp.Duration duration) This method is obsolete. UsesetKeepAliveTimeoutDuration(java.time.Duration)instead. -
setKeepAliveTimeoutDuration
The time without read activity after sending a keepalive ping. -
getKeepAliveTimeout
@ObsoleteApi("Use getKeepAliveTimeoutDuration() instead") public org.threeten.bp.Duration getKeepAliveTimeout()This method is obsolete. UsegetKeepAliveTimeoutDuration()instead -
getKeepAliveTimeoutDuration
The time without read activity after sending a keepalive ping. -
setKeepAliveWithoutCalls
Whether keepalive will be performed when there are no outstanding RPCs. -
getKeepAliveWithoutCalls
Whether keepalive will be performed when there are no outstanding RPCs. -
getPoolSize
Deprecated.Please usesetChannelPoolSettings(ChannelPoolSettings) -
setPoolSize
Deprecated.Please usesetChannelPoolSettings(ChannelPoolSettings) -
setChannelsPerCpu
Deprecated.Please usesetChannelPoolSettings(ChannelPoolSettings) -
setChannelsPerCpu
@Deprecated public InstantiatingGrpcChannelProvider.Builder setChannelsPerCpu(double multiplier, int maxChannels) Deprecated.Please usesetChannelPoolSettings(ChannelPoolSettings) -
setChannelPoolSettings
@BetaApi("Channel pool sizing api is not yet stable") public InstantiatingGrpcChannelProvider.Builder setChannelPoolSettings(ChannelPoolSettings settings) -
setCredentials
public InstantiatingGrpcChannelProvider.Builder setCredentials(com.google.auth.Credentials credentials) -
setChannelPrimer
@InternalApi("For internal use by google-cloud-java clients only") public InstantiatingGrpcChannelProvider.Builder setChannelPrimer(ChannelPrimer channelPrimer) By setting a channelPrimer, the ChannelPool created by the provider will be refreshing ChannelPool. channelPrimer will be invoked periodically when the channels are refreshedThis is public only for technical reasons, for advanced usage.
- Parameters:
channelPrimer- invoked when the channels are refreshed- Returns:
- builder for the provider
-
setAttemptDirectPath
@InternalApi("For internal use by google-cloud-java clients only") public InstantiatingGrpcChannelProvider.Builder setAttemptDirectPath(boolean attemptDirectPath) Whether attempt DirectPath. -
setAllowNonDefaultServiceAccount
@InternalApi("For internal use by google-cloud-java clients only") public InstantiatingGrpcChannelProvider.Builder setAllowNonDefaultServiceAccount(boolean allowNonDefaultServiceAccount) Whether allow non-default service account for DirectPath. -
setAttemptDirectPathXds
@InternalApi("For internal use by google-cloud-java clients only") public InstantiatingGrpcChannelProvider.Builder setAttemptDirectPathXds()Use DirectPath xDS. Only valid if DirectPath is attempted. -
setDirectPathServiceConfig
@InternalApi("For internal use by google-cloud-java clients only") public InstantiatingGrpcChannelProvider.Builder setDirectPathServiceConfig(Map<String, ?> serviceConfig) Sets a service config for direct path. If direct path is not enabled, the provided service config will be ignored.See the service config proto definition for more details.
-
build
-
setChannelConfigurator
@BetaApi("Surface for advanced channel configuration is not yet stable") public InstantiatingGrpcChannelProvider.Builder setChannelConfigurator(@Nullable ApiFunction<io.grpc.ManagedChannelBuilder, io.grpc.ManagedChannelBuilder> channelConfigurator) Add a callback that can intercept channel creation.This can be used for advanced configuration like setting the netty event loop. The callback will be invoked with a fully configured channel builder, which the callback can augment or replace.
-
getChannelConfigurator
@Nullable public ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> getChannelConfigurator()
-
setChannelPoolSettings(ChannelPoolSettings)