public static final class InstantiatingGrpcChannelProvider.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
InstantiatingGrpcChannelProvider |
build() |
com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> |
getChannelConfigurator() |
java.lang.String |
getEndpoint() |
org.threeten.bp.Duration |
getKeepAliveTime()
The time without read activity before sending a keepalive ping.
|
org.threeten.bp.Duration |
getKeepAliveTimeout()
The time without read activity after sending a keepalive ping.
|
java.lang.Boolean |
getKeepAliveWithoutCalls()
Whether keepalive will be performed when there are no outstanding RPCs.
|
java.lang.Integer |
getMaxInboundMessageSize()
The maximum message size allowed to be received on the channel.
|
java.lang.Integer |
getMaxInboundMetadataSize()
The maximum metadata size allowed to be received on the channel.
|
int |
getPoolSize()
Number of underlying grpc channels to open.
|
InstantiatingGrpcChannelProvider.Builder |
setAttemptDirectPath(boolean attemptDirectPath)
Whether attempt DirectPath.
|
InstantiatingGrpcChannelProvider.Builder |
setChannelConfigurator(com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> channelConfigurator)
Add a callback that can intercept channel creation.
|
InstantiatingGrpcChannelProvider.Builder |
setChannelPrimer(ChannelPrimer channelPrimer)
By setting a channelPrimer, the ChannelPool created by the provider will be refreshing
ChannelPool.
|
InstantiatingGrpcChannelProvider.Builder |
setChannelsPerCpu(double multiplier)
Sets the number of channels relative to the available CPUs.
|
InstantiatingGrpcChannelProvider.Builder |
setChannelsPerCpu(double multiplier,
int maxChannels) |
InstantiatingGrpcChannelProvider.Builder |
setCredentials(com.google.auth.Credentials credentials) |
InstantiatingGrpcChannelProvider.Builder |
setEndpoint(java.lang.String endpoint)
Sets the endpoint used to reach the service, eg "localhost:8080".
|
InstantiatingGrpcChannelProvider.Builder |
setExecutor(java.util.concurrent.Executor executor)
Sets the Executor for this TransportChannelProvider.
|
InstantiatingGrpcChannelProvider.Builder |
setExecutorProvider(ExecutorProvider executorProvider)
Deprecated.
Please use
setExecutor(Executor) . |
InstantiatingGrpcChannelProvider.Builder |
setHeaderProvider(HeaderProvider headerProvider)
Sets the HeaderProvider for this TransportChannelProvider.
|
InstantiatingGrpcChannelProvider.Builder |
setInterceptorProvider(GrpcInterceptorProvider interceptorProvider)
Sets the GrpcInterceptorProvider for this TransportChannelProvider.
|
InstantiatingGrpcChannelProvider.Builder |
setKeepAliveTime(org.threeten.bp.Duration duration)
The time without read activity before sending a keepalive ping.
|
InstantiatingGrpcChannelProvider.Builder |
setKeepAliveTimeout(org.threeten.bp.Duration duration)
The time without read activity after sending a keepalive ping.
|
InstantiatingGrpcChannelProvider.Builder |
setKeepAliveWithoutCalls(java.lang.Boolean keepalive)
Whether keepalive will be performed when there are no outstanding RPCs.
|
InstantiatingGrpcChannelProvider.Builder |
setMaxInboundMessageSize(java.lang.Integer max)
The maximum message size allowed to be received on the channel.
|
InstantiatingGrpcChannelProvider.Builder |
setMaxInboundMetadataSize(java.lang.Integer max)
The maximum metadata size allowed to be received on the channel.
|
InstantiatingGrpcChannelProvider.Builder |
setPoolSize(int poolSize)
Number of underlying grpc channels to open.
|
public InstantiatingGrpcChannelProvider.Builder setExecutor(java.util.concurrent.Executor executor)
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.
@Deprecated public InstantiatingGrpcChannelProvider.Builder setExecutorProvider(ExecutorProvider executorProvider)
setExecutor(Executor)
.public InstantiatingGrpcChannelProvider.Builder setHeaderProvider(HeaderProvider headerProvider)
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.
public InstantiatingGrpcChannelProvider.Builder setEndpoint(java.lang.String endpoint)
public InstantiatingGrpcChannelProvider.Builder setInterceptorProvider(GrpcInterceptorProvider interceptorProvider)
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.
public java.lang.String getEndpoint()
public InstantiatingGrpcChannelProvider.Builder setMaxInboundMessageSize(java.lang.Integer max)
public java.lang.Integer getMaxInboundMessageSize()
@BetaApi(value="The surface for maximum metadata size is not stable yet and may change in the future.") public InstantiatingGrpcChannelProvider.Builder setMaxInboundMetadataSize(java.lang.Integer max)
@BetaApi(value="The surface for maximum metadata size is not stable yet and may change in the future.") public java.lang.Integer getMaxInboundMetadataSize()
public InstantiatingGrpcChannelProvider.Builder setKeepAliveTime(org.threeten.bp.Duration duration)
public org.threeten.bp.Duration getKeepAliveTime()
public InstantiatingGrpcChannelProvider.Builder setKeepAliveTimeout(org.threeten.bp.Duration duration)
public org.threeten.bp.Duration getKeepAliveTimeout()
public InstantiatingGrpcChannelProvider.Builder setKeepAliveWithoutCalls(java.lang.Boolean keepalive)
public java.lang.Boolean getKeepAliveWithoutCalls()
public int getPoolSize()
public InstantiatingGrpcChannelProvider.Builder setPoolSize(int poolSize)
public InstantiatingGrpcChannelProvider.Builder setChannelsPerCpu(double multiplier)
public InstantiatingGrpcChannelProvider.Builder setChannelsPerCpu(double multiplier, int maxChannels)
public InstantiatingGrpcChannelProvider.Builder setCredentials(com.google.auth.Credentials credentials)
@InternalApi(value="For internal use by google-cloud-java clients only") public InstantiatingGrpcChannelProvider.Builder setChannelPrimer(ChannelPrimer channelPrimer)
This is public only for technical reasons, for advanced usage.
channelPrimer
- invoked when the channels are refreshed@InternalApi(value="For internal use by google-cloud-java clients only") public InstantiatingGrpcChannelProvider.Builder setAttemptDirectPath(boolean attemptDirectPath)
public InstantiatingGrpcChannelProvider build()
@BetaApi(value="Surface for advanced channel configuration is not yet stable") public InstantiatingGrpcChannelProvider.Builder setChannelConfigurator(@Nullable com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> channelConfigurator)
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.
@Nullable public com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> getChannelConfigurator()