Class ThrottleBucket.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<ThrottleBucket,ThrottleBucket.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<ThrottleBucket,ThrottleBucket.Builder>
com.hedera.hashgraph.sdk.proto.ThrottleBucket.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, ThrottleBucketOrBuilder, Cloneable
Enclosing class:
ThrottleBucket

public static final class ThrottleBucket.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<ThrottleBucket,ThrottleBucket.Builder> implements ThrottleBucketOrBuilder
 *
 A "bucket" of performance allocated across one or more throttle groups.<br/>
 This entry combines one or more throttle groups into a single unit to
 calculate limitations and congestion. Each "bucket" "fills" as operations
 are completed, then "drains" over a period of time defined for each bucket.
 This fill-and-drain characteristic enables the network to process sudden
 bursts of heavy traffic while still observing throttle limits over longer
 timeframes.

 The value of `burstPeriodMs` is combined with the `milliOpsPerSec`
 values for the individual throttle groups to determine the total
 bucket "capacity". This combination MUST be less than the maximum
 value of a signed long integer (`9223372036854775807`), when scaled to
 a nanosecond measurement resolution.

 > Note
 >> There is some question regarding the mechanism of calculating the
 >> combination of `burstPeriodMs` and `milliOpsPerSec`. The calculation
 >> Is implemented in difficult-to-find code, and very likely does not
 >> match the approach described here.
 
Protobuf type proto.ThrottleBucket
  • Method Details

    • getName

      public String getName()
       *
       A name for this bucket.<br/>
       This is used for log entries.
       <p>
       This value SHOULD NOT exceed 20 characters.
       
      string name = 1;
      Specified by:
      getName in interface ThrottleBucketOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       *
       A name for this bucket.<br/>
       This is used for log entries.
       <p>
       This value SHOULD NOT exceed 20 characters.
       
      string name = 1;
      Specified by:
      getNameBytes in interface ThrottleBucketOrBuilder
      Returns:
      The bytes for name.
    • setName

      public ThrottleBucket.Builder setName(String value)
       *
       A name for this bucket.<br/>
       This is used for log entries.
       <p>
       This value SHOULD NOT exceed 20 characters.
       
      string name = 1;
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public ThrottleBucket.Builder clearName()
       *
       A name for this bucket.<br/>
       This is used for log entries.
       <p>
       This value SHOULD NOT exceed 20 characters.
       
      string name = 1;
      Returns:
      This builder for chaining.
    • setNameBytes

      public ThrottleBucket.Builder setNameBytes(com.google.protobuf.ByteString value)
       *
       A name for this bucket.<br/>
       This is used for log entries.
       <p>
       This value SHOULD NOT exceed 20 characters.
       
      string name = 1;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getBurstPeriodMs

      public long getBurstPeriodMs()
       *
       A burst duration limit, in milliseconds.<br/>
       This value determines the total "capacity" of the bucket. The rate
       at which the bucket "drains" is set by the throttles, and this duration
       sets how long that rate must be sustained to empty a "full" bucket.
       That combination (calculated as the product of this value and the least
       common multiple of the `milliOpsPerSec` values for all throttle groups)
       determines the maximum amount of operations this bucket can "hold".
       <p>
       The calculated capacity of this bucket MUST NOT exceed `9,223,372,036,854`.
       
      uint64 burstPeriodMs = 2;
      Specified by:
      getBurstPeriodMs in interface ThrottleBucketOrBuilder
      Returns:
      The burstPeriodMs.
    • setBurstPeriodMs

      public ThrottleBucket.Builder setBurstPeriodMs(long value)
       *
       A burst duration limit, in milliseconds.<br/>
       This value determines the total "capacity" of the bucket. The rate
       at which the bucket "drains" is set by the throttles, and this duration
       sets how long that rate must be sustained to empty a "full" bucket.
       That combination (calculated as the product of this value and the least
       common multiple of the `milliOpsPerSec` values for all throttle groups)
       determines the maximum amount of operations this bucket can "hold".
       <p>
       The calculated capacity of this bucket MUST NOT exceed `9,223,372,036,854`.
       
      uint64 burstPeriodMs = 2;
      Parameters:
      value - The burstPeriodMs to set.
      Returns:
      This builder for chaining.
    • clearBurstPeriodMs

      public ThrottleBucket.Builder clearBurstPeriodMs()
       *
       A burst duration limit, in milliseconds.<br/>
       This value determines the total "capacity" of the bucket. The rate
       at which the bucket "drains" is set by the throttles, and this duration
       sets how long that rate must be sustained to empty a "full" bucket.
       That combination (calculated as the product of this value and the least
       common multiple of the `milliOpsPerSec` values for all throttle groups)
       determines the maximum amount of operations this bucket can "hold".
       <p>
       The calculated capacity of this bucket MUST NOT exceed `9,223,372,036,854`.
       
      uint64 burstPeriodMs = 2;
      Returns:
      This builder for chaining.
    • getThrottleGroupsList

      public List<ThrottleGroup> getThrottleGroupsList()
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
      Specified by:
      getThrottleGroupsList in interface ThrottleBucketOrBuilder
    • getThrottleGroupsCount

      public int getThrottleGroupsCount()
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
      Specified by:
      getThrottleGroupsCount in interface ThrottleBucketOrBuilder
    • getThrottleGroups

      public ThrottleGroup getThrottleGroups(int index)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
      Specified by:
      getThrottleGroups in interface ThrottleBucketOrBuilder
    • setThrottleGroups

      public ThrottleBucket.Builder setThrottleGroups(int index, ThrottleGroup value)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • setThrottleGroups

      public ThrottleBucket.Builder setThrottleGroups(int index, ThrottleGroup.Builder builderForValue)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • addThrottleGroups

      public ThrottleBucket.Builder addThrottleGroups(ThrottleGroup value)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • addThrottleGroups

      public ThrottleBucket.Builder addThrottleGroups(int index, ThrottleGroup value)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • addThrottleGroups

      public ThrottleBucket.Builder addThrottleGroups(ThrottleGroup.Builder builderForValue)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • addThrottleGroups

      public ThrottleBucket.Builder addThrottleGroups(int index, ThrottleGroup.Builder builderForValue)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • addAllThrottleGroups

      public ThrottleBucket.Builder addAllThrottleGroups(Iterable<? extends ThrottleGroup> values)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • clearThrottleGroups

      public ThrottleBucket.Builder clearThrottleGroups()
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • removeThrottleGroups

      public ThrottleBucket.Builder removeThrottleGroups(int index)
       *
       A list of throttle groups.<br/>
       These throttle groups combined define the effective throttle
       rate for the bucket.
       <p>
       This list MUST contain at least one entry.
       
      repeated .proto.ThrottleGroup throttleGroups = 3;
    • getHighVolume

      public boolean getHighVolume()
       *
       If set to true, this bucket is used for high-volume throttles.
       
      bool high_volume = 4;
      Specified by:
      getHighVolume in interface ThrottleBucketOrBuilder
      Returns:
      The highVolume.
    • setHighVolume

      public ThrottleBucket.Builder setHighVolume(boolean value)
       *
       If set to true, this bucket is used for high-volume throttles.
       
      bool high_volume = 4;
      Parameters:
      value - The highVolume to set.
      Returns:
      This builder for chaining.
    • clearHighVolume

      public ThrottleBucket.Builder clearHighVolume()
       *
       If set to true, this bucket is used for high-volume throttles.
       
      bool high_volume = 4;
      Returns:
      This builder for chaining.