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 Details

    • 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.Builder<MethodConfig.HedgingPolicy.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
    • getDefaultInstanceForType

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

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

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

      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
    • setField

      public MethodConfig.HedgingPolicy.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
    • clearField

      public MethodConfig.HedgingPolicy.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
    • clearOneof

      public MethodConfig.HedgingPolicy.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.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:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
    • addRepeatedField

      public MethodConfig.HedgingPolicy.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
    • mergeFrom

      public MethodConfig.HedgingPolicy.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MethodConfig.HedgingPolicy.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.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:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.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:
      getMaxAttempts in interface MethodConfig.HedgingPolicyOrBuilder
      Returns:
      The maxAttempts.
    • setMaxAttempts

      public MethodConfig.HedgingPolicy.Builder setMaxAttempts(int value)
       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

      public MethodConfig.HedgingPolicy.Builder 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:
      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.
    • setHedgingDelay

      public MethodConfig.HedgingPolicy.Builder 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. 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

      public MethodConfig.HedgingPolicy.Builder 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. Set this
       to 0 to immediately send all max_requests RPCs.
       
      .google.protobuf.Duration hedging_delay = 2;
    • clearHedgingDelay

      public MethodConfig.HedgingPolicy.Builder 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:
      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.
    • 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

      public MethodConfig.HedgingPolicy.Builder addNonFatalStatusCodes(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:
      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

      public MethodConfig.HedgingPolicy.Builder 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

      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.
    • setNonFatalStatusCodesValue

      public MethodConfig.HedgingPolicy.Builder setNonFatalStatusCodesValue(int index, int 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 enum numeric value on the wire for nonFatalStatusCodes to set.
      Returns:
      This builder for chaining.
    • addNonFatalStatusCodesValue

      public MethodConfig.HedgingPolicy.Builder addNonFatalStatusCodesValue(int 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:
      value - The enum numeric value on the wire for nonFatalStatusCodes to add.
      Returns:
      This builder for chaining.
    • addAllNonFatalStatusCodesValue

      public MethodConfig.HedgingPolicy.Builder addAllNonFatalStatusCodesValue(Iterable<Integer> 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 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:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>
    • mergeUnknownFields

      public final MethodConfig.HedgingPolicy.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.HedgingPolicy.Builder>