Package io.grpc.xds.client
Class ControlPlaneClient
- java.lang.Object
-
- io.grpc.xds.client.ControlPlaneClient
-
final class ControlPlaneClient extends java.lang.ObjectCommon base type for XdsClient implementations, which encapsulates the layer abstraction of the xDS RPC stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classControlPlaneClient.AdsStreamclassControlPlaneClient.RpcRetryTask
-
Field Summary
Fields Modifier and Type Field Description private ControlPlaneClient.AdsStreamadsStreamprivate io.grpc.internal.BackoffPolicy.ProviderbackoffPolicyProviderprivate EnvoyProtoData.NodebootstrapNodeprivate XdsLoggerloggerprivate io.grpc.InternalLogIdlogIdprivate MessagePrettyPrintermessagePrinterprivate XdsClient.ResourceStoreresourceStoreprivate io.grpc.internal.BackoffPolicyretryBackoffPolicyprivate io.grpc.SynchronizationContext.ScheduledHandlerpcRetryTimerprivate Bootstrapper.ServerInfoserverInfoprivate booleanshutdownprivate com.google.common.base.Stopwatchstopwatchprivate io.grpc.SynchronizationContextsyncContextprivate java.util.concurrent.ScheduledExecutorServicetimeServiceprivate java.util.Map<XdsResourceType<?>,java.lang.String>versionsprivate XdsClientxdsClientprivate XdsClient.XdsResponseHandlerxdsResponseHandlerprivate XdsTransportFactory.XdsTransportxdsTransport
-
Constructor Summary
Constructors Constructor Description ControlPlaneClient(XdsTransportFactory.XdsTransport xdsTransport, Bootstrapper.ServerInfo serverInfo, EnvoyProtoData.Node bootstrapNode, XdsClient.XdsResponseHandler xdsResponseHandler, XdsClient.ResourceStore resourceStore, java.util.concurrent.ScheduledExecutorService timeService, io.grpc.SynchronizationContext syncContext, io.grpc.internal.BackoffPolicy.Provider backoffPolicyProvider, com.google.common.base.Supplier<com.google.common.base.Stopwatch> stopwatchSupplier, XdsClient xdsClient, MessagePrettyPrinter messagePrinter)An entity that manages ADS RPCs over a single channel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidackResponse(XdsResourceType<?> type, java.lang.String versionInfo, java.lang.String nonce)Accepts the update for the given resource type by updating the latest resource version and sends an ACK request to the management server.(package private) voidadjustResourceSubscription(XdsResourceType<?> resourceType)Updates the resource subscription for the given resource type.(package private) XdsResourceType<?>fromTypeUrl(java.lang.String typeUrl)(package private) booleanisInBackoff()Returnstrueif the resource discovery is currently in backoff.(package private) booleanisReady()(package private) voidnackResponse(XdsResourceType<?> type, java.lang.String nonce, java.lang.String errorDetail)Rejects the update for the given resource type and sends an NACK request (request with last accepted version) to the management server.(package private) voidreadyHandler()Starts a timer for each requested resource that hasn't been responded to and has been waiting for the channel to get ready.(package private) voidshutdown()private voidstartRpcStream()Establishes the RPC connection by creating a new RPC stream on the given channel for xDS protocol communication.java.lang.StringtoString()
-
-
-
Field Detail
-
syncContext
private final io.grpc.SynchronizationContext syncContext
-
logId
private final io.grpc.InternalLogId logId
-
logger
private final XdsLogger logger
-
serverInfo
private final Bootstrapper.ServerInfo serverInfo
-
xdsTransport
private final XdsTransportFactory.XdsTransport xdsTransport
-
xdsResponseHandler
private final XdsClient.XdsResponseHandler xdsResponseHandler
-
resourceStore
private final XdsClient.ResourceStore resourceStore
-
timeService
private final java.util.concurrent.ScheduledExecutorService timeService
-
backoffPolicyProvider
private final io.grpc.internal.BackoffPolicy.Provider backoffPolicyProvider
-
stopwatch
private final com.google.common.base.Stopwatch stopwatch
-
bootstrapNode
private final EnvoyProtoData.Node bootstrapNode
-
xdsClient
private final XdsClient xdsClient
-
versions
private final java.util.Map<XdsResourceType<?>,java.lang.String> versions
-
shutdown
private boolean shutdown
-
adsStream
@Nullable private ControlPlaneClient.AdsStream adsStream
-
retryBackoffPolicy
@Nullable private io.grpc.internal.BackoffPolicy retryBackoffPolicy
-
rpcRetryTimer
@Nullable private io.grpc.SynchronizationContext.ScheduledHandle rpcRetryTimer
-
messagePrinter
private MessagePrettyPrinter messagePrinter
-
-
Constructor Detail
-
ControlPlaneClient
ControlPlaneClient(XdsTransportFactory.XdsTransport xdsTransport, Bootstrapper.ServerInfo serverInfo, EnvoyProtoData.Node bootstrapNode, XdsClient.XdsResponseHandler xdsResponseHandler, XdsClient.ResourceStore resourceStore, java.util.concurrent.ScheduledExecutorService timeService, io.grpc.SynchronizationContext syncContext, io.grpc.internal.BackoffPolicy.Provider backoffPolicyProvider, com.google.common.base.Supplier<com.google.common.base.Stopwatch> stopwatchSupplier, XdsClient xdsClient, MessagePrettyPrinter messagePrinter)
An entity that manages ADS RPCs over a single channel.
-
-
Method Detail
-
shutdown
void shutdown()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
adjustResourceSubscription
void adjustResourceSubscription(XdsResourceType<?> resourceType)
Updates the resource subscription for the given resource type.
-
ackResponse
void ackResponse(XdsResourceType<?> type, java.lang.String versionInfo, java.lang.String nonce)
Accepts the update for the given resource type by updating the latest resource version and sends an ACK request to the management server.
-
nackResponse
void nackResponse(XdsResourceType<?> type, java.lang.String nonce, java.lang.String errorDetail)
Rejects the update for the given resource type and sends an NACK request (request with last accepted version) to the management server.
-
isInBackoff
boolean isInBackoff()
Returnstrueif the resource discovery is currently in backoff.
-
isReady
boolean isReady()
-
readyHandler
void readyHandler()
Starts a timer for each requested resource that hasn't been responded to and has been waiting for the channel to get ready.
-
startRpcStream
private void startRpcStream()
Establishes the RPC connection by creating a new RPC stream on the given channel for xDS protocol communication.
-
fromTypeUrl
@Nullable XdsResourceType<?> fromTypeUrl(java.lang.String typeUrl)
-
-