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 class
XdsServerWrapper.DiscoveryState.RouteDiscoveryState
-
Field Summary
Fields Modifier and Type Field Description private EnvoyServerProtoData.FilterChain
defaultFilterChain
private java.util.List<EnvoyServerProtoData.FilterChain>
filterChains
private io.grpc.ServerInterceptor
noopInterceptor
private java.util.Set<java.lang.String>
pendingRds
private java.lang.String
resourceName
private java.util.Map<java.lang.String,XdsServerWrapper.DiscoveryState.RouteDiscoveryState>
routeDiscoveryStates
private java.util.Map<EnvoyServerProtoData.FilterChain,java.util.concurrent.atomic.AtomicReference<XdsServerWrapper.ServerRoutingConfig>>
savedRdsRoutingConfigRef
private boolean
stopped
-
Constructor Summary
Constructors Modifier Constructor Description private
DiscoveryState(java.lang.String resourceName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
cleanUpRouteDiscoveryStates()
private io.grpc.ServerInterceptor
combineInterceptors(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 void
handleConfigNotFound(io.grpc.StatusException exception)
void
onChanged(XdsListenerResource.LdsUpdate update)
void
onError(io.grpc.Status error)
Called when the resource discovery RPC encounters some transient error.void
onResourceDoesNotExist(java.lang.String resourceName)
Called when the requested resource is not available.private void
releaseSuppliersInFlight()
private void
shutdown()
private void
updateSelector()
-
-
-
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:
onChanged
in interfaceXdsClient.ResourceWatcher<XdsListenerResource.LdsUpdate>
-
onResourceDoesNotExist
public void onResourceDoesNotExist(java.lang.String resourceName)
Description copied from interface:XdsClient.ResourceWatcher
Called when the requested resource is not available.- Specified by:
onResourceDoesNotExist
in 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.ResourceWatcher
Called 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
. - KeepStatus
description in one form or another, as it contains valuable debugging information.- Specified by:
onError
in 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()
-
-