| Modifier and Type | Method and Description |
|---|---|
ClientBuilder |
authHeader(String key,
String value) |
Map<io.grpc.Metadata.Key<?>,Object> |
authHeaders() |
ClientBuilder |
authHeaders(Map<io.grpc.Metadata.Key<?>,Object> authHeaders) |
List<io.grpc.ClientInterceptor> |
authInterceptors() |
ClientBuilder |
authInterceptors(io.grpc.ClientInterceptor interceptor,
io.grpc.ClientInterceptor... interceptors) |
ClientBuilder |
authInterceptors(List<io.grpc.ClientInterceptor> interceptors) |
String |
authority() |
ClientBuilder |
authority(String authority) |
Client |
build()
build a new Client.
|
Duration |
connectTimeout() |
ClientBuilder |
connectTimeout(Duration connectTimeout) |
ClientBuilder |
copy() |
boolean |
discovery() |
ClientBuilder |
discovery(boolean discovery) |
Collection<URI> |
endpoints()
gets the endpoints for the builder.
|
ClientBuilder |
endpoints(Collection<URI> endpoints)
configure etcd server endpoints.
|
ClientBuilder |
endpoints(String... endpoints)
configure etcd server endpoints.
|
ClientBuilder |
endpoints(URI... endpoints)
configure etcd server endpoints.
|
ExecutorService |
executorService() |
ClientBuilder |
executorService(ExecutorService executorService)
config executor service.
|
ClientBuilder |
header(String key,
String value) |
Map<io.grpc.Metadata.Key<?>,Object> |
headers() |
ClientBuilder |
headers(Map<io.grpc.Metadata.Key<?>,Object> headers) |
ClientBuilder |
interceptor(io.grpc.ClientInterceptor interceptor,
io.grpc.ClientInterceptor... interceptors) |
List<io.grpc.ClientInterceptor> |
interceptors() |
ClientBuilder |
interceptors(List<io.grpc.ClientInterceptor> interceptors) |
Duration |
keepaliveTime() |
ClientBuilder |
keepaliveTime(Duration keepaliveTime)
The interval for gRPC keepalives.
|
Duration |
keepaliveTimeout() |
ClientBuilder |
keepaliveTimeout(Duration keepaliveTimeout)
The timeout for gRPC keepalives
|
Boolean |
keepaliveWithoutCalls() |
ClientBuilder |
keepaliveWithoutCalls(Boolean keepaliveWithoutCalls)
Keepalive option for gRPC
|
String |
loadBalancerPolicy()
get the load balancer policy for etcd client.
|
ClientBuilder |
loadBalancerPolicy(String loadBalancerPolicy)
config load balancer policy.
|
Integer |
maxInboundMessageSize() |
ClientBuilder |
maxInboundMessageSize(Integer maxInboundMessageSize) |
ByteSequence |
namespace() |
ClientBuilder |
namespace(ByteSequence namespace)
config the namespace of keys used in
KV, Txn, Lock and Watch. |
ByteSequence |
password() |
ClientBuilder |
password(ByteSequence password)
config etcd auth password.
|
ChronoUnit |
retryChronoUnit() |
ClientBuilder |
retryChronoUnit(ChronoUnit retryChronoUnit) |
long |
retryDelay() |
ClientBuilder |
retryDelay(long retryDelay) |
long |
retryMaxDelay() |
ClientBuilder |
retryMaxDelay(long retryMaxDelay) |
Duration |
retryMaxDuration() |
ClientBuilder |
retryMaxDuration(Duration retryMaxDuration) |
io.netty.handler.ssl.SslContext |
sslContext() |
ClientBuilder |
sslContext(Consumer<io.netty.handler.ssl.SslContextBuilder> consumer)
Configure SSL/TLS context create through
GrpcSslContexts.forClient() to use. |
ClientBuilder |
sslContext(io.netty.handler.ssl.SslContext sslContext)
SSL/TLS context to use instead of the system default.
|
ByteSequence |
user() |
ClientBuilder |
user(ByteSequence user)
config etcd auth user.
|
boolean |
waitForReady() |
ClientBuilder |
waitForReady(boolean waitForReady) |
public Collection<URI> endpoints()
public ClientBuilder endpoints(Collection<URI> endpoints)
endpoints - etcd server endpoints, at least oneNullPointerException - if endpoints is null or one of endpoint is nullIllegalArgumentException - if some endpoint is invalidpublic ClientBuilder endpoints(URI... endpoints)
endpoints - etcd server endpoints, at least oneNullPointerException - if endpoints is null or one of endpoint is nullIllegalArgumentException - if some endpoint is invalidpublic ClientBuilder endpoints(String... endpoints)
endpoints - etcd server endpoints, at least oneNullPointerException - if endpoints is null or one of endpoint is nullIllegalArgumentException - if some endpoint is invalidpublic ByteSequence user()
public ClientBuilder user(ByteSequence user)
user - etcd auth userNullPointerException - if user is nullpublic ByteSequence password()
public ClientBuilder password(ByteSequence password)
password - etcd auth passwordNullPointerException - if password is nullpublic ByteSequence namespace()
public ClientBuilder namespace(ByteSequence namespace)
KV, Txn, Lock and Watch.
"/" will be treated as no namespace.namespace - the namespace of each key usedNullPointerException - if namespace is nullpublic ExecutorService executorService()
public ClientBuilder executorService(ExecutorService executorService)
executorService - executor serviceNullPointerException - if executorService is nullpublic ClientBuilder loadBalancerPolicy(String loadBalancerPolicy)
loadBalancerPolicy - etcd load balancer policyNullPointerException - if loadBalancerPolicy is nullpublic String loadBalancerPolicy()
public io.netty.handler.ssl.SslContext sslContext()
public ClientBuilder sslContext(io.netty.handler.ssl.SslContext sslContext)
GrpcSslContexts, but options could have been overridden.sslContext - the ssl contextpublic ClientBuilder sslContext(Consumer<io.netty.handler.ssl.SslContextBuilder> consumer) throws SSLException
GrpcSslContexts.forClient() to use.consumer - the SslContextBuilder consumerSSLException - if the SslContextBuilder failspublic String authority()
public ClientBuilder authority(String authority)
authority - the authority used to authenticate connections to servers.public Integer maxInboundMessageSize()
public ClientBuilder maxInboundMessageSize(Integer maxInboundMessageSize)
maxInboundMessageSize - Sets the maximum message size allowed for a single gRPC frame.public Map<io.grpc.Metadata.Key<?>,Object> headers()
public ClientBuilder headers(Map<io.grpc.Metadata.Key<?>,Object> headers)
headers - Sets headers to be added to http request headers.public ClientBuilder header(String key, String value)
key - Sets an header key to be added to http request headers.value - Sets an header value to be added to http request headers.public Map<io.grpc.Metadata.Key<?>,Object> authHeaders()
public ClientBuilder authHeaders(Map<io.grpc.Metadata.Key<?>,Object> authHeaders)
authHeaders - Sets headers to be added to auth request headers.public ClientBuilder authHeader(String key, String value)
key - Sets an header key to be added to auth request headers.value - Sets an header value to be added to auth request headers.public List<io.grpc.ClientInterceptor> interceptors()
public ClientBuilder interceptors(List<io.grpc.ClientInterceptor> interceptors)
interceptors - Set the interceptors.public ClientBuilder interceptor(io.grpc.ClientInterceptor interceptor, io.grpc.ClientInterceptor... interceptors)
interceptor - an interceptors to addinterceptors - additional interceptorspublic List<io.grpc.ClientInterceptor> authInterceptors()
public ClientBuilder authInterceptors(List<io.grpc.ClientInterceptor> interceptors)
interceptors - Set the interceptors to add to the auth chainpublic ClientBuilder authInterceptors(io.grpc.ClientInterceptor interceptor, io.grpc.ClientInterceptor... interceptors)
interceptor - an interceptors to add to the auth chaininterceptors - additional interceptors to add to the auth chainpublic long retryDelay()
public ClientBuilder retryDelay(long retryDelay)
retryDelay - The delay between retries.public long retryMaxDelay()
public ClientBuilder retryMaxDelay(long retryMaxDelay)
retryMaxDelay - The max backing off delay between retries.public Duration keepaliveTime()
public ClientBuilder keepaliveTime(Duration keepaliveTime)
keepaliveTime - time between keepalivespublic Duration keepaliveTimeout()
public ClientBuilder keepaliveTimeout(Duration keepaliveTimeout)
keepaliveTimeout - the gRPC keep alive timeout.public Boolean keepaliveWithoutCalls()
public ClientBuilder keepaliveWithoutCalls(Boolean keepaliveWithoutCalls)
keepaliveWithoutCalls - the gRPC keep alive without calls.public ChronoUnit retryChronoUnit()
public ClientBuilder retryChronoUnit(ChronoUnit retryChronoUnit)
retryChronoUnit - the retries period unit.public Duration retryMaxDuration()
public Duration connectTimeout()
public ClientBuilder retryMaxDuration(Duration retryMaxDuration)
retryMaxDuration - the retries max duration.public ClientBuilder connectTimeout(Duration connectTimeout)
connectTimeout - Sets the connection timeout.
Clients connecting to fault tolerant etcd clusters (eg, clusters with >= 3 etcd server
peers/endpoints)
should consider a value that will allow switching timely from a crashed/partitioned peer to
a consensus peer.public boolean discovery()
public ClientBuilder discovery(boolean discovery)
discovery - if the endpoint represent a discovery address using dns+srv.public boolean waitForReady()
public ClientBuilder waitForReady(boolean waitForReady)
waitForReady - if this client should use gRPC's wait for ready semantics. Enabled by default.public Client build()
EtcdException - if client experiences build error.public ClientBuilder copy()
Copyright © 2021. All rights reserved.