Package io.grpc.serviceconfig
Class MethodConfig.HedgingPolicy.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
io.grpc.serviceconfig.MethodConfig.HedgingPolicy.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,MethodConfig.HedgingPolicyOrBuilder,Cloneable
- Enclosing class:
- MethodConfig.HedgingPolicy
public static final class MethodConfig.HedgingPolicy.Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
implements MethodConfig.HedgingPolicyOrBuilder
The hedging policy for outgoing RPCs. Hedged RPCs may execute more than once on the server, so only idempotent methods should specify a hedging policy.Protobuf type
grpc.service_config.MethodConfig.HedgingPolicy-
Method Summary
Modifier and TypeMethodDescriptionaddAllNonFatalStatusCodes(Iterable<? extends com.google.rpc.Code> values) The set of status codes which indicate other hedged RPCs may still succeed.The set of status codes which indicate other hedged RPCs may still succeed.addNonFatalStatusCodes(com.google.rpc.Code value) The set of status codes which indicate other hedged RPCs may still succeed.addNonFatalStatusCodesValue(int value) The set of status codes which indicate other hedged RPCs may still succeed.addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()clearField(com.google.protobuf.Descriptors.FieldDescriptor field) The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay.The hedging policy will send up to max_requests RPCs.The set of status codes which indicate other hedged RPCs may still succeed.clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) clone()static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.Descriptorcom.google.protobuf.DurationThe first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay.com.google.protobuf.Duration.BuilderThe first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay.com.google.protobuf.DurationOrBuilderThe first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay.intThe hedging policy will send up to max_requests RPCs.com.google.rpc.CodegetNonFatalStatusCodes(int index) The set of status codes which indicate other hedged RPCs may still succeed.intThe set of status codes which indicate other hedged RPCs may still succeed.List<com.google.rpc.Code>The set of status codes which indicate other hedged RPCs may still succeed.intgetNonFatalStatusCodesValue(int index) The set of status codes which indicate other hedged RPCs may still succeed.The set of status codes which indicate other hedged RPCs may still succeed.booleanThe first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeHedgingDelay(com.google.protobuf.Duration value) The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay.mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) setHedgingDelay(com.google.protobuf.Duration value) The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay.setHedgingDelay(com.google.protobuf.Duration.Builder builderForValue) The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay.setMaxAttempts(int value) The hedging policy will send up to max_requests RPCs.setNonFatalStatusCodes(int index, com.google.rpc.Code value) The set of status codes which indicate other hedged RPCs may still succeed.setNonFatalStatusCodesValue(int index, int value) The set of status codes which indicate other hedged RPCs may still succeed.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
setField
public MethodConfig.HedgingPolicy.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
clearField
public MethodConfig.HedgingPolicy.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) - Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
clearOneof
public MethodConfig.HedgingPolicy.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) - Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
setRepeatedField
public MethodConfig.HedgingPolicy.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
addRepeatedField
public MethodConfig.HedgingPolicy.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<MethodConfig.HedgingPolicy.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
mergeFrom
public MethodConfig.HedgingPolicy.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<MethodConfig.HedgingPolicy.Builder>- Throws:
IOException
-
getMaxAttempts
public int getMaxAttempts()The hedging policy will send up to max_requests RPCs. This number represents the total number of all attempts, including the original attempt. This field is required and must be greater than 1. Any value greater than 5 will be treated as if it were 5.
uint32 max_attempts = 1;- Specified by:
getMaxAttemptsin interfaceMethodConfig.HedgingPolicyOrBuilder- Returns:
- The maxAttempts.
-
setMaxAttempts
The hedging policy will send up to max_requests RPCs. This number represents the total number of all attempts, including the original attempt. This field is required and must be greater than 1. Any value greater than 5 will be treated as if it were 5.
uint32 max_attempts = 1;- Parameters:
value- The maxAttempts to set.- Returns:
- This builder for chaining.
-
clearMaxAttempts
The hedging policy will send up to max_requests RPCs. This number represents the total number of all attempts, including the original attempt. This field is required and must be greater than 1. Any value greater than 5 will be treated as if it were 5.
uint32 max_attempts = 1;- Returns:
- This builder for chaining.
-
hasHedgingDelay
public boolean hasHedgingDelay()The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay. Set this to 0 to immediately send all max_requests RPCs.
.google.protobuf.Duration hedging_delay = 2;- Specified by:
hasHedgingDelayin interfaceMethodConfig.HedgingPolicyOrBuilder- Returns:
- Whether the hedgingDelay field is set.
-
getHedgingDelay
public com.google.protobuf.Duration getHedgingDelay()The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay. Set this to 0 to immediately send all max_requests RPCs.
.google.protobuf.Duration hedging_delay = 2;- Specified by:
getHedgingDelayin interfaceMethodConfig.HedgingPolicyOrBuilder- Returns:
- The hedgingDelay.
-
setHedgingDelay
The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay. Set this to 0 to immediately send all max_requests RPCs.
.google.protobuf.Duration hedging_delay = 2; -
setHedgingDelay
public MethodConfig.HedgingPolicy.Builder setHedgingDelay(com.google.protobuf.Duration.Builder builderForValue) The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay. Set this to 0 to immediately send all max_requests RPCs.
.google.protobuf.Duration hedging_delay = 2; -
mergeHedgingDelay
The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay. Set this to 0 to immediately send all max_requests RPCs.
.google.protobuf.Duration hedging_delay = 2; -
clearHedgingDelay
The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay. Set this to 0 to immediately send all max_requests RPCs.
.google.protobuf.Duration hedging_delay = 2; -
getHedgingDelayBuilder
public com.google.protobuf.Duration.Builder getHedgingDelayBuilder()The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay. Set this to 0 to immediately send all max_requests RPCs.
.google.protobuf.Duration hedging_delay = 2; -
getHedgingDelayOrBuilder
public com.google.protobuf.DurationOrBuilder getHedgingDelayOrBuilder()The first RPC will be sent immediately, but the max_requests-1 subsequent hedged RPCs will be sent at intervals of every hedging_delay. Set this to 0 to immediately send all max_requests RPCs.
.google.protobuf.Duration hedging_delay = 2;- Specified by:
getHedgingDelayOrBuilderin interfaceMethodConfig.HedgingPolicyOrBuilder
-
getNonFatalStatusCodesList
The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Specified by:
getNonFatalStatusCodesListin interfaceMethodConfig.HedgingPolicyOrBuilder- Returns:
- A list containing the nonFatalStatusCodes.
-
getNonFatalStatusCodesCount
public int getNonFatalStatusCodesCount()The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Specified by:
getNonFatalStatusCodesCountin interfaceMethodConfig.HedgingPolicyOrBuilder- Returns:
- The count of nonFatalStatusCodes.
-
getNonFatalStatusCodes
public com.google.rpc.Code getNonFatalStatusCodes(int index) The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Specified by:
getNonFatalStatusCodesin interfaceMethodConfig.HedgingPolicyOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The nonFatalStatusCodes at the given index.
-
setNonFatalStatusCodes
public MethodConfig.HedgingPolicy.Builder setNonFatalStatusCodes(int index, com.google.rpc.Code value) The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Parameters:
index- The index to set the value at.value- The nonFatalStatusCodes to set.- Returns:
- This builder for chaining.
-
addNonFatalStatusCodes
The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Parameters:
value- The nonFatalStatusCodes to add.- Returns:
- This builder for chaining.
-
addAllNonFatalStatusCodes
public MethodConfig.HedgingPolicy.Builder addAllNonFatalStatusCodes(Iterable<? extends com.google.rpc.Code> values) The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Parameters:
values- The nonFatalStatusCodes to add.- Returns:
- This builder for chaining.
-
clearNonFatalStatusCodes
The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Returns:
- This builder for chaining.
-
getNonFatalStatusCodesValueList
The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Specified by:
getNonFatalStatusCodesValueListin interfaceMethodConfig.HedgingPolicyOrBuilder- Returns:
- A list containing the enum numeric values on the wire for nonFatalStatusCodes.
-
getNonFatalStatusCodesValue
public int getNonFatalStatusCodesValue(int index) The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Specified by:
getNonFatalStatusCodesValuein interfaceMethodConfig.HedgingPolicyOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The enum numeric value on the wire of nonFatalStatusCodes at the given index.
-
setNonFatalStatusCodesValue
The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Parameters:
index- The index to set the value at.value- The enum numeric value on the wire for nonFatalStatusCodes to set.- Returns:
- This builder for chaining.
-
addNonFatalStatusCodesValue
The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Parameters:
value- The enum numeric value on the wire for nonFatalStatusCodes to add.- Returns:
- This builder for chaining.
-
addAllNonFatalStatusCodesValue
The set of status codes which indicate other hedged RPCs may still succeed. If a non-fatal status code is returned by the server, hedged RPCs will continue. Otherwise, outstanding requests will be canceled and the error returned to the client application layer. This field is optional.
repeated .google.rpc.Code non_fatal_status_codes = 3;- Parameters:
values- The enum numeric values on the wire for nonFatalStatusCodes to add.- Returns:
- This builder for chaining.
-
setUnknownFields
public final MethodConfig.HedgingPolicy.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-
mergeUnknownFields
public final MethodConfig.HedgingPolicy.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
-