Package io.grpc.xds
Class XdsServerWrapper.DiscoveryState
- java.lang.Object
-
- io.grpc.xds.XdsServerWrapper.DiscoveryState
-
- All Implemented Interfaces:
XdsClient.ResourceWatcher<XdsListenerResource.LdsUpdate>
- Enclosing class:
- XdsServerWrapper
private final class XdsServerWrapper.DiscoveryState extends java.lang.Object implements XdsClient.ResourceWatcher<XdsListenerResource.LdsUpdate>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classXdsServerWrapper.DiscoveryState.RouteDiscoveryState
-
Field Summary
Fields Modifier and Type Field Description private EnvoyServerProtoData.FilterChaindefaultFilterChainprivate java.util.List<EnvoyServerProtoData.FilterChain>filterChainsprivate io.grpc.ServerInterceptornoopInterceptorprivate java.util.Set<java.lang.String>pendingRdsprivate java.lang.StringresourceNameprivate java.util.Map<java.lang.String,XdsServerWrapper.DiscoveryState.RouteDiscoveryState>routeDiscoveryStatesprivate java.util.Map<EnvoyServerProtoData.FilterChain,java.util.concurrent.atomic.AtomicReference<XdsServerWrapper.ServerRoutingConfig>>savedRdsRoutingConfigRefprivate booleanstopped
-
Constructor Summary
Constructors Modifier Constructor Description privateDiscoveryState(java.lang.String resourceName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcleanUpRouteDiscoveryStates()private io.grpc.ServerInterceptorcombineInterceptors(java.util.List<io.grpc.ServerInterceptor> interceptors)private com.google.common.collect.ImmutableMap<VirtualHost.Route,io.grpc.ServerInterceptor>generatePerRouteInterceptors(java.util.List<Filter.NamedFilterConfig> namedFilterConfigs, java.util.List<VirtualHost> virtualHosts)private java.util.concurrent.atomic.AtomicReference<XdsServerWrapper.ServerRoutingConfig>generateRoutingConfig(EnvoyServerProtoData.FilterChain filterChain)private java.util.List<SslContextProviderSupplier>getSuppliersInUse()private voidhandleConfigNotFound(io.grpc.StatusException exception)voidonChanged(XdsListenerResource.LdsUpdate update)voidonError(io.grpc.Status error)Called when the resource discovery RPC encounters some transient error.voidonResourceDoesNotExist(java.lang.String resourceName)Called when the requested resource is not available.private voidreleaseSuppliersInFlight()private voidshutdown()private voidupdateSelector()
-
-
-
Field Detail
-
resourceName
private final java.lang.String resourceName
-
routeDiscoveryStates
private final java.util.Map<java.lang.String,XdsServerWrapper.DiscoveryState.RouteDiscoveryState> routeDiscoveryStates
-
pendingRds
private final java.util.Set<java.lang.String> pendingRds
-
filterChains
private java.util.List<EnvoyServerProtoData.FilterChain> filterChains
-
defaultFilterChain
@Nullable private EnvoyServerProtoData.FilterChain defaultFilterChain
-
stopped
private boolean stopped
-
savedRdsRoutingConfigRef
private final java.util.Map<EnvoyServerProtoData.FilterChain,java.util.concurrent.atomic.AtomicReference<XdsServerWrapper.ServerRoutingConfig>> savedRdsRoutingConfigRef
-
noopInterceptor
private final io.grpc.ServerInterceptor noopInterceptor
-
-
Method Detail
-
onChanged
public void onChanged(XdsListenerResource.LdsUpdate update)
- Specified by:
onChangedin interfaceXdsClient.ResourceWatcher<XdsListenerResource.LdsUpdate>
-
onResourceDoesNotExist
public void onResourceDoesNotExist(java.lang.String resourceName)
Description copied from interface:XdsClient.ResourceWatcherCalled when the requested resource is not available.- Specified by:
onResourceDoesNotExistin interfaceXdsClient.ResourceWatcher<XdsListenerResource.LdsUpdate>- Parameters:
resourceName- name of the resource requested in discovery request.
-
onError
public void onError(io.grpc.Status error)
Description copied from interface:XdsClient.ResourceWatcherCalled when the resource discovery RPC encounters some transient error.Note that we expect that the implementer to: - Comply with the guarantee to not generate certain statuses by the library: https://grpc.github.io/grpc/core/md_doc_statuscodes.html. If the code needs to be propagated to the channel, override it with
Status.Code.UNAVAILABLE. - KeepStatusdescription in one form or another, as it contains valuable debugging information.- Specified by:
onErrorin interfaceXdsClient.ResourceWatcher<XdsListenerResource.LdsUpdate>
-
shutdown
private void shutdown()
-
updateSelector
private void updateSelector()
-
generateRoutingConfig
private java.util.concurrent.atomic.AtomicReference<XdsServerWrapper.ServerRoutingConfig> generateRoutingConfig(EnvoyServerProtoData.FilterChain filterChain)
-
generatePerRouteInterceptors
private com.google.common.collect.ImmutableMap<VirtualHost.Route,io.grpc.ServerInterceptor> generatePerRouteInterceptors(java.util.List<Filter.NamedFilterConfig> namedFilterConfigs, java.util.List<VirtualHost> virtualHosts)
-
combineInterceptors
private io.grpc.ServerInterceptor combineInterceptors(java.util.List<io.grpc.ServerInterceptor> interceptors)
-
handleConfigNotFound
private void handleConfigNotFound(io.grpc.StatusException exception)
-
cleanUpRouteDiscoveryStates
private void cleanUpRouteDiscoveryStates()
-
getSuppliersInUse
private java.util.List<SslContextProviderSupplier> getSuppliersInUse()
-
releaseSuppliersInFlight
private void releaseSuppliersInFlight()
-
-