Package io.grpc.serviceconfig
Class MethodConfig.HedgingPolicy
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
io.grpc.serviceconfig.MethodConfig.HedgingPolicy
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,MethodConfig.HedgingPolicyOrBuilder,Serializable
- Enclosing class:
- MethodConfig
public static final class MethodConfig.HedgingPolicy
extends com.google.protobuf.GeneratedMessageV3
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- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe hedging policy for outgoing RPCs.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic MethodConfig.HedgingPolicystatic final com.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.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.com.google.protobuf.Parser<MethodConfig.HedgingPolicy>intinthashCode()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 booleannewBuilder(MethodConfig.HedgingPolicy prototype) protected MethodConfig.HedgingPolicy.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static MethodConfig.HedgingPolicyparseDelimitedFrom(InputStream input) static MethodConfig.HedgingPolicyparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MethodConfig.HedgingPolicyparseFrom(byte[] data) static MethodConfig.HedgingPolicyparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MethodConfig.HedgingPolicyparseFrom(com.google.protobuf.ByteString data) static MethodConfig.HedgingPolicyparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MethodConfig.HedgingPolicyparseFrom(com.google.protobuf.CodedInputStream input) static MethodConfig.HedgingPolicyparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MethodConfig.HedgingPolicyparseFrom(InputStream input) static MethodConfig.HedgingPolicyparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MethodConfig.HedgingPolicyparseFrom(ByteBuffer data) static MethodConfig.HedgingPolicyparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<MethodConfig.HedgingPolicy>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
MAX_ATTEMPTS_FIELD_NUMBER
public static final int MAX_ATTEMPTS_FIELD_NUMBER- See Also:
-
HEDGING_DELAY_FIELD_NUMBER
public static final int HEDGING_DELAY_FIELD_NUMBER- See Also:
-
NON_FATAL_STATUS_CODES_FIELD_NUMBER
public static final int NON_FATAL_STATUS_CODES_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
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
-
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.
-
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.
-
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.
-
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.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static MethodConfig.HedgingPolicy parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static MethodConfig.HedgingPolicy parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected MethodConfig.HedgingPolicy.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-