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:
  • 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

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance in class com.google.protobuf.GeneratedMessageV3
    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.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:
      getMaxAttempts in interface MethodConfig.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:
      hasHedgingDelay in interface MethodConfig.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:
      getHedgingDelay in interface MethodConfig.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:
      getHedgingDelayOrBuilder in interface MethodConfig.HedgingPolicyOrBuilder
    • getNonFatalStatusCodesList

      public List<com.google.rpc.Code> 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:
      getNonFatalStatusCodesList in interface MethodConfig.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:
      getNonFatalStatusCodesCount in interface MethodConfig.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:
      getNonFatalStatusCodes in interface MethodConfig.HedgingPolicyOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The nonFatalStatusCodes at the given index.
    • getNonFatalStatusCodesValueList

      public List<Integer> 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:
      getNonFatalStatusCodesValueList in interface MethodConfig.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:
      getNonFatalStatusCodesValue in interface MethodConfig.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:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.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

      public static MethodConfig.HedgingPolicy parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static MethodConfig.HedgingPolicy parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static MethodConfig.HedgingPolicy parseDelimitedFrom(InputStream input) throws IOException
      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

      public MethodConfig.HedgingPolicy.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static MethodConfig.HedgingPolicy.Builder newBuilder()
    • newBuilder

      public static MethodConfig.HedgingPolicy.Builder newBuilder(MethodConfig.HedgingPolicy prototype)
    • toBuilder

      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected MethodConfig.HedgingPolicy.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static MethodConfig.HedgingPolicy getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<MethodConfig.HedgingPolicy> parser()
    • getParserForType

      public com.google.protobuf.Parser<MethodConfig.HedgingPolicy> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

      public MethodConfig.HedgingPolicy getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder