Package io.grpc.internal
Class ScParser
- java.lang.Object
-
- io.grpc.NameResolver.ServiceConfigParser
-
- io.grpc.internal.ScParser
-
public final class ScParser extends NameResolver.ServiceConfigParser
The library built-in implementation of service config parser.
-
-
Field Summary
Fields Modifier and Type Field Description private AutoConfiguredLoadBalancerFactory
autoLoadBalancerFactory
private int
maxHedgedAttemptsLimit
private int
maxRetryAttemptsLimit
private boolean
retryEnabled
-
Constructor Summary
Constructors Constructor Description ScParser(boolean retryEnabled, int maxRetryAttemptsLimit, int maxHedgedAttemptsLimit, AutoConfiguredLoadBalancerFactory autoLoadBalancerFactory)
Creates a parse with global retry settings and an auto configured lb factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NameResolver.ConfigOrError
parseServiceConfig(java.util.Map<java.lang.String,?> rawServiceConfig)
Parses and validates the service configuration chosen by the name resolver.
-
-
-
Field Detail
-
retryEnabled
private final boolean retryEnabled
-
maxRetryAttemptsLimit
private final int maxRetryAttemptsLimit
-
maxHedgedAttemptsLimit
private final int maxHedgedAttemptsLimit
-
autoLoadBalancerFactory
private final AutoConfiguredLoadBalancerFactory autoLoadBalancerFactory
-
-
Constructor Detail
-
ScParser
public ScParser(boolean retryEnabled, int maxRetryAttemptsLimit, int maxHedgedAttemptsLimit, AutoConfiguredLoadBalancerFactory autoLoadBalancerFactory)
Creates a parse with global retry settings and an auto configured lb factory.
-
-
Method Detail
-
parseServiceConfig
public NameResolver.ConfigOrError parseServiceConfig(java.util.Map<java.lang.String,?> rawServiceConfig)
Description copied from class:NameResolver.ServiceConfigParser
Parses and validates the service configuration chosen by the name resolver. This will return aNameResolver.ConfigOrError
which contains either the successfully parsed config, or theStatus
representing the failure to parse. Implementations are expected to not throw exceptions but return a Status representing the failure. The value inside theNameResolver.ConfigOrError
should implementequals()
andhashCode()
.- Specified by:
parseServiceConfig
in classNameResolver.ServiceConfigParser
- Parameters:
rawServiceConfig
- TheMap
representation of the service config- Returns:
- a tuple of the fully parsed and validated channel configuration, else the Status.
-
-