Class ScParser
java.lang.Object
io.grpc.NameResolver.ServiceConfigParser
io.grpc.internal.ScParser
The library built-in implementation of service config parser.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AutoConfiguredLoadBalancerFactoryprivate final intprivate final intprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionScParser(boolean retryEnabled, int maxRetryAttemptsLimit, int maxHedgedAttemptsLimit, AutoConfiguredLoadBalancerFactory autoLoadBalancerFactory) Creates a parse with global retry settings and an auto configured lb factory. -
Method Summary
Modifier and TypeMethodDescriptionparseServiceConfig(Map<String, ?> rawServiceConfig) Parses and validates the service configuration chosen by the name resolver.
-
Field Details
-
retryEnabled
private final boolean retryEnabled -
maxRetryAttemptsLimit
private final int maxRetryAttemptsLimit -
maxHedgedAttemptsLimit
private final int maxHedgedAttemptsLimit -
autoLoadBalancerFactory
-
-
Constructor Details
-
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 Details
-
parseServiceConfig
Description copied from class:NameResolver.ServiceConfigParserParses and validates the service configuration chosen by the name resolver. This will return aNameResolver.ConfigOrErrorwhich contains either the successfully parsed config, or theStatusrepresenting the failure to parse. Implementations are expected to not throw exceptions but return a Status representing the failure. The value inside theNameResolver.ConfigOrErrorshould implementequals()andhashCode().- Specified by:
parseServiceConfigin classNameResolver.ServiceConfigParser- Parameters:
rawServiceConfig- TheMaprepresentation of the service config- Returns:
- a tuple of the fully parsed and validated channel configuration, else the Status.
-