Class InstantiatingGrpcChannelProvider.Builder (2.52.0)

public static final class InstantiatingGrpcChannelProvider.Builder

Inheritance

java.lang.Object > InstantiatingGrpcChannelProvider.Builder

Methods

build()

public InstantiatingGrpcChannelProvider build()
Returns
Type Description
InstantiatingGrpcChannelProvider

getChannelConfigurator()

public ApiFunction<ManagedChannelBuilder,ManagedChannelBuilder> getChannelConfigurator()
Returns
Type Description
ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder>

getEndpoint()

public String getEndpoint()
Returns
Type Description
String

getKeepAliveTime()

public Duration getKeepAliveTime()

This method is obsolete. Use #getKeepAliveTimeDuration() instead.

Returns
Type Description
org.threeten.bp.Duration

getKeepAliveTimeDuration()

public Duration getKeepAliveTimeDuration()

The time without read activity before sending a keepalive ping.

Returns
Type Description
Duration

getKeepAliveTimeout()

public Duration getKeepAliveTimeout()

This method is obsolete. Use #getKeepAliveTimeoutDuration() instead

Returns
Type Description
org.threeten.bp.Duration

getKeepAliveTimeoutDuration()

public Duration getKeepAliveTimeoutDuration()

The time without read activity after sending a keepalive ping.

Returns
Type Description
Duration

getKeepAliveWithoutCalls()

public Boolean getKeepAliveWithoutCalls()

Whether keepalive will be performed when there are no outstanding RPCs.

Returns
Type Description
Boolean

getMaxInboundMessageSize()

public Integer getMaxInboundMessageSize()

The maximum message size allowed to be received on the channel.

Returns
Type Description
Integer

getMaxInboundMetadataSize()

public Integer getMaxInboundMetadataSize()

The maximum metadata size allowed to be received on the channel.

Returns
Type Description
Integer

getPoolSize() (deprecated)

public int getPoolSize()
Returns
Type Description
int

setAllowNonDefaultServiceAccount(boolean allowNonDefaultServiceAccount)

public InstantiatingGrpcChannelProvider.Builder setAllowNonDefaultServiceAccount(boolean allowNonDefaultServiceAccount)

Whether allow non-default service account for DirectPath.

Parameter
Name Description
allowNonDefaultServiceAccount boolean
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setAttemptDirectPath(boolean attemptDirectPath)

public InstantiatingGrpcChannelProvider.Builder setAttemptDirectPath(boolean attemptDirectPath)

Whether attempt DirectPath.

Parameter
Name Description
attemptDirectPath boolean
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setAttemptDirectPathXds()

public InstantiatingGrpcChannelProvider.Builder setAttemptDirectPathXds()

Use DirectPath xDS. Only valid if DirectPath is attempted.

Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setChannelConfigurator(ApiFunction<ManagedChannelBuilder,ManagedChannelBuilder> channelConfigurator)

public InstantiatingGrpcChannelProvider.Builder setChannelConfigurator(ApiFunction<ManagedChannelBuilder,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.

Parameter
Name Description
channelConfigurator ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder>
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setChannelPoolSettings(ChannelPoolSettings settings)

public InstantiatingGrpcChannelProvider.Builder setChannelPoolSettings(ChannelPoolSettings settings)
Parameter
Name Description
settings ChannelPoolSettings
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setChannelPrimer(ChannelPrimer channelPrimer)

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 refreshed

This is public only for technical reasons, for advanced usage.

Parameter
Name Description
channelPrimer ChannelPrimer

invoked when the channels are refreshed

Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

builder for the provider

setChannelsPerCpu(double multiplier) (deprecated)

public InstantiatingGrpcChannelProvider.Builder setChannelsPerCpu(double multiplier)
Parameter
Name Description
multiplier double
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setChannelsPerCpu(double multiplier, int maxChannels) (deprecated)

public InstantiatingGrpcChannelProvider.Builder setChannelsPerCpu(double multiplier, int maxChannels)
Parameters
Name Description
multiplier double
maxChannels int
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setCredentials(Credentials credentials)

public InstantiatingGrpcChannelProvider.Builder setCredentials(Credentials credentials)
Parameter
Name Description
credentials com.google.auth.Credentials
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setDirectPathServiceConfig(Map<String,?> serviceConfig)

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.

Parameter
Name Description
serviceConfig Map<String,?>
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setEndpoint(String endpoint)

public InstantiatingGrpcChannelProvider.Builder setEndpoint(String endpoint)

Sets the endpoint used to reach the service, eg "localhost:8080".

Parameter
Name Description
endpoint String
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setExecutor(Executor executor)

public InstantiatingGrpcChannelProvider.Builder setExecutor(Executor executor)

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.

Parameter
Name Description
executor Executor
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setExecutorProvider(ExecutorProvider executorProvider) (deprecated)

public InstantiatingGrpcChannelProvider.Builder setExecutorProvider(ExecutorProvider executorProvider)

Deprecated. Please use #setExecutor(Executor).

Parameter
Name Description
executorProvider ExecutorProvider
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setHeaderProvider(HeaderProvider headerProvider)

public InstantiatingGrpcChannelProvider.Builder setHeaderProvider(HeaderProvider headerProvider)

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.

Parameter
Name Description
headerProvider HeaderProvider
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setInterceptorProvider(GrpcInterceptorProvider interceptorProvider)

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.

Parameter
Name Description
interceptorProvider GrpcInterceptorProvider
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setKeepAliveTime(Duration duration)

public InstantiatingGrpcChannelProvider.Builder setKeepAliveTime(Duration duration)

This method is obsolete. Use #setKeepAliveTimeDuration(java.time.Duration) instead.

Parameter
Name Description
duration org.threeten.bp.Duration
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setKeepAliveTimeDuration(Duration duration)

public InstantiatingGrpcChannelProvider.Builder setKeepAliveTimeDuration(Duration duration)

The time without read activity before sending a keepalive ping.

Parameter
Name Description
duration Duration
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setKeepAliveTimeout(Duration duration)

public InstantiatingGrpcChannelProvider.Builder setKeepAliveTimeout(Duration duration)

This method is obsolete. Use #setKeepAliveTimeoutDuration(java.time.Duration) instead.

Parameter
Name Description
duration org.threeten.bp.Duration
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setKeepAliveTimeoutDuration(Duration duration)

public InstantiatingGrpcChannelProvider.Builder setKeepAliveTimeoutDuration(Duration duration)

The time without read activity after sending a keepalive ping.

Parameter
Name Description
duration Duration
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setKeepAliveWithoutCalls(Boolean keepalive)

public InstantiatingGrpcChannelProvider.Builder setKeepAliveWithoutCalls(Boolean keepalive)

Whether keepalive will be performed when there are no outstanding RPCs.

Parameter
Name Description
keepalive Boolean
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setMaxInboundMessageSize(Integer max)

public InstantiatingGrpcChannelProvider.Builder setMaxInboundMessageSize(Integer max)

The maximum message size allowed to be received on the channel.

Parameter
Name Description
max Integer
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setMaxInboundMetadataSize(Integer max)

public InstantiatingGrpcChannelProvider.Builder setMaxInboundMetadataSize(Integer max)

The maximum metadata size allowed to be received on the channel.

Parameter
Name Description
max Integer
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder

setPoolSize(int poolSize) (deprecated)

public InstantiatingGrpcChannelProvider.Builder setPoolSize(int poolSize)
Parameter
Name Description
poolSize int
Returns
Type Description
InstantiatingGrpcChannelProvider.Builder