Class ControlPlaneClient


  • final class ControlPlaneClient
    extends java.lang.Object
    Common base type for XdsClient implementations, which encapsulates the layer abstraction of the xDS RPC stream.
    • Field Detail

      • syncContext

        private final io.grpc.SynchronizationContext syncContext
      • logId

        private final io.grpc.InternalLogId logId
      • 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
      • xdsClient

        private final XdsClient xdsClient
      • versions

        private final java.util.Map<XdsResourceType<?>,​java.lang.String> versions
      • shutdown

        private boolean shutdown
      • retryBackoffPolicy

        @Nullable
        private io.grpc.internal.BackoffPolicy retryBackoffPolicy
      • rpcRetryTimer

        @Nullable
        private io.grpc.SynchronizationContext.ScheduledHandle rpcRetryTimer
    • Method Detail

      • shutdown

        void shutdown()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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()
        Returns true if 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)