Class RateLimits.Builder

  • All Implemented Interfaces:
    RateLimitsOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    RateLimits

    public static final class RateLimits.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<RateLimits.Builder>
    implements RateLimitsOrBuilder
     Rate limits.
    
     This message determines the maximum rate that tasks can be dispatched by a
     queue, regardless of whether the dispatch is a first task attempt or a retry.
    
     Note: The debugging command,
     [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask], will run a task even if
     the queue has reached its [RateLimits][google.cloud.tasks.v2.RateLimits].
     
    Protobuf type google.cloud.tasks.v2.RateLimits
    • Method Detail

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

        public RateLimits.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<RateLimits.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<RateLimits.Builder>
      • getDefaultInstanceForType

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

        public RateLimits build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

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

        public RateLimits.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<RateLimits.Builder>
      • setField

        public RateLimits.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<RateLimits.Builder>
      • clearField

        public RateLimits.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<RateLimits.Builder>
      • clearOneof

        public RateLimits.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<RateLimits.Builder>
      • setRepeatedField

        public RateLimits.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<RateLimits.Builder>
      • addRepeatedField

        public RateLimits.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<RateLimits.Builder>
      • mergeFrom

        public RateLimits.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<RateLimits.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimits.Builder>
      • mergeFrom

        public RateLimits.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<RateLimits.Builder>
        Throws:
        IOException
      • getMaxDispatchesPerSecond

        public double getMaxDispatchesPerSecond()
         The maximum rate at which tasks are dispatched from this queue.
        
         If unspecified when the queue is created, Cloud Tasks will pick the
         default.
        
         * The maximum allowed value is 500.
        
        
         This field has the same meaning as
         [rate in
         queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
         
        double max_dispatches_per_second = 1;
        Specified by:
        getMaxDispatchesPerSecond in interface RateLimitsOrBuilder
        Returns:
        The maxDispatchesPerSecond.
      • setMaxDispatchesPerSecond

        public RateLimits.Builder setMaxDispatchesPerSecond​(double value)
         The maximum rate at which tasks are dispatched from this queue.
        
         If unspecified when the queue is created, Cloud Tasks will pick the
         default.
        
         * The maximum allowed value is 500.
        
        
         This field has the same meaning as
         [rate in
         queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
         
        double max_dispatches_per_second = 1;
        Parameters:
        value - The maxDispatchesPerSecond to set.
        Returns:
        This builder for chaining.
      • clearMaxDispatchesPerSecond

        public RateLimits.Builder clearMaxDispatchesPerSecond()
         The maximum rate at which tasks are dispatched from this queue.
        
         If unspecified when the queue is created, Cloud Tasks will pick the
         default.
        
         * The maximum allowed value is 500.
        
        
         This field has the same meaning as
         [rate in
         queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
         
        double max_dispatches_per_second = 1;
        Returns:
        This builder for chaining.
      • getMaxBurstSize

        public int getMaxBurstSize()
         Output only. The max burst size.
        
         Max burst size limits how fast tasks in queue are processed when
         many tasks are in the queue and the rate is high. This field
         allows the queue to have a high rate so processing starts shortly
         after a task is enqueued, but still limits resource usage when
         many tasks are enqueued in a short period of time.
        
         The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
         algorithm is used to control the rate of task dispatches. Each
         queue has a token bucket that holds tokens, up to the maximum
         specified by `max_burst_size`. Each time a task is dispatched, a
         token is removed from the bucket. Tasks will be dispatched until
         the queue's bucket runs out of tokens. The bucket will be
         continuously refilled with new tokens based on
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
        
         Cloud Tasks will pick the value of `max_burst_size` based on the
         value of
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
        
         For queues that were created or updated using
         `queue.yaml/xml`, `max_burst_size` is equal to
         [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
         Since `max_burst_size` is output only, if
         [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a
         queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on
         the value of
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second],
         regardless of whether
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]
         is updated.
         
        int32 max_burst_size = 2;
        Specified by:
        getMaxBurstSize in interface RateLimitsOrBuilder
        Returns:
        The maxBurstSize.
      • setMaxBurstSize

        public RateLimits.Builder setMaxBurstSize​(int value)
         Output only. The max burst size.
        
         Max burst size limits how fast tasks in queue are processed when
         many tasks are in the queue and the rate is high. This field
         allows the queue to have a high rate so processing starts shortly
         after a task is enqueued, but still limits resource usage when
         many tasks are enqueued in a short period of time.
        
         The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
         algorithm is used to control the rate of task dispatches. Each
         queue has a token bucket that holds tokens, up to the maximum
         specified by `max_burst_size`. Each time a task is dispatched, a
         token is removed from the bucket. Tasks will be dispatched until
         the queue's bucket runs out of tokens. The bucket will be
         continuously refilled with new tokens based on
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
        
         Cloud Tasks will pick the value of `max_burst_size` based on the
         value of
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
        
         For queues that were created or updated using
         `queue.yaml/xml`, `max_burst_size` is equal to
         [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
         Since `max_burst_size` is output only, if
         [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a
         queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on
         the value of
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second],
         regardless of whether
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]
         is updated.
         
        int32 max_burst_size = 2;
        Parameters:
        value - The maxBurstSize to set.
        Returns:
        This builder for chaining.
      • clearMaxBurstSize

        public RateLimits.Builder clearMaxBurstSize()
         Output only. The max burst size.
        
         Max burst size limits how fast tasks in queue are processed when
         many tasks are in the queue and the rate is high. This field
         allows the queue to have a high rate so processing starts shortly
         after a task is enqueued, but still limits resource usage when
         many tasks are enqueued in a short period of time.
        
         The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
         algorithm is used to control the rate of task dispatches. Each
         queue has a token bucket that holds tokens, up to the maximum
         specified by `max_burst_size`. Each time a task is dispatched, a
         token is removed from the bucket. Tasks will be dispatched until
         the queue's bucket runs out of tokens. The bucket will be
         continuously refilled with new tokens based on
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
        
         Cloud Tasks will pick the value of `max_burst_size` based on the
         value of
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
        
         For queues that were created or updated using
         `queue.yaml/xml`, `max_burst_size` is equal to
         [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
         Since `max_burst_size` is output only, if
         [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a
         queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on
         the value of
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second],
         regardless of whether
         [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]
         is updated.
         
        int32 max_burst_size = 2;
        Returns:
        This builder for chaining.
      • getMaxConcurrentDispatches

        public int getMaxConcurrentDispatches()
         The maximum number of concurrent tasks that Cloud Tasks allows
         to be dispatched for this queue. After this threshold has been
         reached, Cloud Tasks stops dispatching tasks until the number of
         concurrent requests decreases.
        
         If unspecified when the queue is created, Cloud Tasks will pick the
         default.
        
        
         The maximum allowed value is 5,000.
        
        
         This field has the same meaning as
         [max_concurrent_requests in
         queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
         
        int32 max_concurrent_dispatches = 3;
        Specified by:
        getMaxConcurrentDispatches in interface RateLimitsOrBuilder
        Returns:
        The maxConcurrentDispatches.
      • setMaxConcurrentDispatches

        public RateLimits.Builder setMaxConcurrentDispatches​(int value)
         The maximum number of concurrent tasks that Cloud Tasks allows
         to be dispatched for this queue. After this threshold has been
         reached, Cloud Tasks stops dispatching tasks until the number of
         concurrent requests decreases.
        
         If unspecified when the queue is created, Cloud Tasks will pick the
         default.
        
        
         The maximum allowed value is 5,000.
        
        
         This field has the same meaning as
         [max_concurrent_requests in
         queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
         
        int32 max_concurrent_dispatches = 3;
        Parameters:
        value - The maxConcurrentDispatches to set.
        Returns:
        This builder for chaining.
      • clearMaxConcurrentDispatches

        public RateLimits.Builder clearMaxConcurrentDispatches()
         The maximum number of concurrent tasks that Cloud Tasks allows
         to be dispatched for this queue. After this threshold has been
         reached, Cloud Tasks stops dispatching tasks until the number of
         concurrent requests decreases.
        
         If unspecified when the queue is created, Cloud Tasks will pick the
         default.
        
        
         The maximum allowed value is 5,000.
        
        
         This field has the same meaning as
         [max_concurrent_requests in
         queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
         
        int32 max_concurrent_dispatches = 3;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final RateLimits.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<RateLimits.Builder>
      • mergeUnknownFields

        public final RateLimits.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<RateLimits.Builder>