T - The concrete type of this builder.public abstract class AbstractManagedChannelImplBuilder<T extends AbstractManagedChannelImplBuilder<T>>
extends io.grpc.ManagedChannelBuilder<T>
| Modifier and Type | Field and Description |
|---|---|
protected TransportTracer.Factory |
transportTracerFactory |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractManagedChannelImplBuilder(SocketAddress directServerAddress,
String authority) |
protected |
AbstractManagedChannelImplBuilder(String target) |
| Modifier and Type | Method and Description |
|---|---|
io.grpc.ManagedChannel |
build() |
protected abstract ClientTransportFactory |
buildTransportFactory()
Subclasses should override this method to provide the
ClientTransportFactory
appropriate for this channel. |
protected String |
checkAuthority(String authority)
Verifies the authority is valid.
|
T |
compressorRegistry(io.grpc.CompressorRegistry registry) |
T |
decompressorRegistry(io.grpc.DecompressorRegistry registry) |
T |
defaultLoadBalancingPolicy(String policy) |
T |
defaultServiceConfig(Map<String,?> serviceConfig) |
T |
directExecutor() |
T |
disableRetry() |
T |
disableServiceConfigLookUp() |
T |
enableFullStreamDecompression() |
T |
enableRetry() |
T |
executor(Executor executor) |
static io.grpc.ManagedChannelBuilder<?> |
forAddress(String name,
int port) |
static io.grpc.ManagedChannelBuilder<?> |
forTarget(String target) |
protected int |
getDefaultPort()
Subclasses can override this method to provide a default port to
NameResolver for use
in cases where the target string doesn't include a port. |
T |
idleTimeout(long value,
TimeUnit unit) |
T |
intercept(io.grpc.ClientInterceptor... interceptors) |
T |
intercept(List<io.grpc.ClientInterceptor> interceptors) |
T |
maxHedgedAttempts(int maxHedgedAttempts) |
protected int |
maxInboundMessageSize() |
T |
maxInboundMessageSize(int max)
Sets the maximum message size allowed for a single gRPC frame.
|
T |
maxRetryAttempts(int maxRetryAttempts) |
T |
maxTraceEvents(int maxTraceEvents) |
T |
nameResolverFactory(io.grpc.NameResolver.Factory resolverFactory) |
T |
overrideAuthority(String authority) |
protected T |
overrideCensusStatsModule(CensusStatsModule censusStats)
Override the default stats implementation.
|
T |
perRpcBufferLimit(long bytes) |
T |
proxyDetector(io.grpc.ProxyDetector proxyDetector) |
T |
retryBufferSize(long bytes) |
T |
setBinaryLog(io.grpc.BinaryLog binlog) |
protected void |
setStatsEnabled(boolean value)
Disable or enable stats features.
|
protected void |
setStatsRecordFinishedRpcs(boolean value)
Disable or enable stats recording for RPC completions.
|
protected void |
setStatsRecordRealTimeMetrics(boolean value)
Disable or enable real-time metrics recording.
|
protected void |
setStatsRecordStartedRpcs(boolean value)
Disable or enable stats recording for RPC upstarts.
|
protected void |
setTracingEnabled(boolean value)
Disable or enable tracing features.
|
T |
userAgent(String userAgent) |
protected TransportTracer.Factory transportTracerFactory
protected AbstractManagedChannelImplBuilder(String target)
protected AbstractManagedChannelImplBuilder(SocketAddress directServerAddress, String authority)
public static io.grpc.ManagedChannelBuilder<?> forAddress(String name, int port)
public static io.grpc.ManagedChannelBuilder<?> forTarget(String target)
public T maxInboundMessageSize(int max)
maxInboundMessageSize in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>protected final int maxInboundMessageSize()
public final T directExecutor()
directExecutor in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T executor(Executor executor)
executor in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T intercept(List<io.grpc.ClientInterceptor> interceptors)
intercept in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T intercept(io.grpc.ClientInterceptor... interceptors)
intercept in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T nameResolverFactory(io.grpc.NameResolver.Factory resolverFactory)
nameResolverFactory in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T defaultLoadBalancingPolicy(String policy)
defaultLoadBalancingPolicy in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T enableFullStreamDecompression()
enableFullStreamDecompression in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T decompressorRegistry(io.grpc.DecompressorRegistry registry)
decompressorRegistry in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T compressorRegistry(io.grpc.CompressorRegistry registry)
compressorRegistry in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T userAgent(@Nullable String userAgent)
userAgent in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T overrideAuthority(String authority)
overrideAuthority in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T idleTimeout(long value, TimeUnit unit)
idleTimeout in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T maxRetryAttempts(int maxRetryAttempts)
maxRetryAttempts in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T maxHedgedAttempts(int maxHedgedAttempts)
maxHedgedAttempts in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T retryBufferSize(long bytes)
retryBufferSize in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T perRpcBufferLimit(long bytes)
perRpcBufferLimit in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T disableRetry()
disableRetry in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T enableRetry()
enableRetry in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public final T setBinaryLog(io.grpc.BinaryLog binlog)
setBinaryLog in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public T maxTraceEvents(int maxTraceEvents)
maxTraceEvents in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>protected final T overrideCensusStatsModule(CensusStatsModule censusStats)
public T proxyDetector(@Nullable io.grpc.ProxyDetector proxyDetector)
proxyDetector in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public T defaultServiceConfig(@Nullable Map<String,?> serviceConfig)
defaultServiceConfig in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>public T disableServiceConfigLookUp()
disableServiceConfigLookUp in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>protected void setStatsEnabled(boolean value)
For the current release, calling setStatsEnabled(true) may have a side effect that
disables retry.
protected void setStatsRecordStartedRpcs(boolean value)
setStatsEnabled(boolean) is set to true. Enabled by default.protected void setStatsRecordFinishedRpcs(boolean value)
setStatsEnabled(boolean) is set to true. Enabled by default.protected void setStatsRecordRealTimeMetrics(boolean value)
setStatsEnabled(boolean) is
set to true. Disabled by default.protected void setTracingEnabled(boolean value)
For the current release, calling setTracingEnabled(true) may have a side effect that
disables retry.
protected String checkAuthority(String authority)
public io.grpc.ManagedChannel build()
build in class io.grpc.ManagedChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>>protected abstract ClientTransportFactory buildTransportFactory()
ClientTransportFactory
appropriate for this channel. This method is meant for Transport implementors and should not
be used by normal users.protected int getDefaultPort()
NameResolver for use
in cases where the target string doesn't include a port. The default implementation returns
GrpcUtil.DEFAULT_PORT_SSL.