Class BuildIdAssignmentRule.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuildIdAssignmentRule.Builder>
com.google.protobuf.GeneratedMessageV3.Builder<BuildIdAssignmentRule.Builder>
io.temporal.api.taskqueue.v1.BuildIdAssignmentRule.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, BuildIdAssignmentRuleOrBuilder, Cloneable
Enclosing class:
BuildIdAssignmentRule

public static final class BuildIdAssignmentRule.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<BuildIdAssignmentRule.Builder> implements BuildIdAssignmentRuleOrBuilder
 Assignment rules are applied to *new* Workflow and Activity executions at
 schedule time to assign them to a Build ID.

 Assignment rules will not be used in the following cases:
    - Child Workflows or Continue-As-New Executions who inherit their
      parent/previous Workflow's assigned Build ID (by setting the
      `inherit_build_id` flag - default behavior in SDKs when the same Task Queue
      is used.)
    - An Activity that inherits the assigned Build ID of its Workflow (by
      setting the `use_workflow_build_id` flag - default behavior in SDKs
      when the same Task Queue is used.)

 In absence of (applicable) redirect rules (`CompatibleBuildIdRedirectRule`s)
 the task will be dispatched to Workers of the Build ID determined by the
 assignment rules (or inherited). Otherwise, the final Build ID will be
 determined by the redirect rules.

 Once a Workflow completes its first Workflow Task in a particular Build ID it
 stays in that Build ID regardless of changes to assignment rules. Redirect
 rules can be used to move the workflow to another compatible Build ID.

 When using Worker Versioning on a Task Queue, in the steady state,
 there should typically be a single assignment rule to send all new executions
 to the latest Build ID. Existence of at least one such "unconditional"
 rule at all times is enforces by the system, unless the `force` flag is used
 by the user when replacing/deleting these rules (for exceptional cases).

 During a deployment, one or more additional rules can be added to assign a
 subset of the tasks to a new Build ID based on a "ramp percentage".

 When there are multiple assignment rules for a Task Queue, the rules are
 evaluated in order, starting from index 0. The first applicable rule will be
 applied and the rest will be ignored.

 In the event that no assignment rule is applicable on a task (or the Task
 Queue is simply not versioned), the tasks will be dispatched to an
 unversioned Worker.
 
Protobuf type temporal.api.taskqueue.v1.BuildIdAssignmentRule
  • 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<BuildIdAssignmentRule.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<BuildIdAssignmentRule.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<BuildIdAssignmentRule.Builder>
    • getDefaultInstanceForType

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

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

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

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

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

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

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

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

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

      public BuildIdAssignmentRule.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<BuildIdAssignmentRule.Builder>
      Throws:
      IOException
    • getRampCase

      public BuildIdAssignmentRule.RampCase getRampCase()
      Specified by:
      getRampCase in interface BuildIdAssignmentRuleOrBuilder
    • clearRamp

      public BuildIdAssignmentRule.Builder clearRamp()
    • getTargetBuildId

      public String getTargetBuildId()
      string target_build_id = 1;
      Specified by:
      getTargetBuildId in interface BuildIdAssignmentRuleOrBuilder
      Returns:
      The targetBuildId.
    • getTargetBuildIdBytes

      public com.google.protobuf.ByteString getTargetBuildIdBytes()
      string target_build_id = 1;
      Specified by:
      getTargetBuildIdBytes in interface BuildIdAssignmentRuleOrBuilder
      Returns:
      The bytes for targetBuildId.
    • setTargetBuildId

      public BuildIdAssignmentRule.Builder setTargetBuildId(String value)
      string target_build_id = 1;
      Parameters:
      value - The targetBuildId to set.
      Returns:
      This builder for chaining.
    • clearTargetBuildId

      public BuildIdAssignmentRule.Builder clearTargetBuildId()
      string target_build_id = 1;
      Returns:
      This builder for chaining.
    • setTargetBuildIdBytes

      public BuildIdAssignmentRule.Builder setTargetBuildIdBytes(com.google.protobuf.ByteString value)
      string target_build_id = 1;
      Parameters:
      value - The bytes for targetBuildId to set.
      Returns:
      This builder for chaining.
    • hasPercentageRamp

      public boolean hasPercentageRamp()
       This ramp is useful for gradual Blue/Green deployments (and similar)
       where you want to send a certain portion of the traffic to the target
       Build ID.
       
      .temporal.api.taskqueue.v1.RampByPercentage percentage_ramp = 3;
      Specified by:
      hasPercentageRamp in interface BuildIdAssignmentRuleOrBuilder
      Returns:
      Whether the percentageRamp field is set.
    • getPercentageRamp

      public RampByPercentage getPercentageRamp()
       This ramp is useful for gradual Blue/Green deployments (and similar)
       where you want to send a certain portion of the traffic to the target
       Build ID.
       
      .temporal.api.taskqueue.v1.RampByPercentage percentage_ramp = 3;
      Specified by:
      getPercentageRamp in interface BuildIdAssignmentRuleOrBuilder
      Returns:
      The percentageRamp.
    • setPercentageRamp

      public BuildIdAssignmentRule.Builder setPercentageRamp(RampByPercentage value)
       This ramp is useful for gradual Blue/Green deployments (and similar)
       where you want to send a certain portion of the traffic to the target
       Build ID.
       
      .temporal.api.taskqueue.v1.RampByPercentage percentage_ramp = 3;
    • setPercentageRamp

      public BuildIdAssignmentRule.Builder setPercentageRamp(RampByPercentage.Builder builderForValue)
       This ramp is useful for gradual Blue/Green deployments (and similar)
       where you want to send a certain portion of the traffic to the target
       Build ID.
       
      .temporal.api.taskqueue.v1.RampByPercentage percentage_ramp = 3;
    • mergePercentageRamp

      public BuildIdAssignmentRule.Builder mergePercentageRamp(RampByPercentage value)
       This ramp is useful for gradual Blue/Green deployments (and similar)
       where you want to send a certain portion of the traffic to the target
       Build ID.
       
      .temporal.api.taskqueue.v1.RampByPercentage percentage_ramp = 3;
    • clearPercentageRamp

      public BuildIdAssignmentRule.Builder clearPercentageRamp()
       This ramp is useful for gradual Blue/Green deployments (and similar)
       where you want to send a certain portion of the traffic to the target
       Build ID.
       
      .temporal.api.taskqueue.v1.RampByPercentage percentage_ramp = 3;
    • getPercentageRampBuilder

      public RampByPercentage.Builder getPercentageRampBuilder()
       This ramp is useful for gradual Blue/Green deployments (and similar)
       where you want to send a certain portion of the traffic to the target
       Build ID.
       
      .temporal.api.taskqueue.v1.RampByPercentage percentage_ramp = 3;
    • getPercentageRampOrBuilder

      public RampByPercentageOrBuilder getPercentageRampOrBuilder()
       This ramp is useful for gradual Blue/Green deployments (and similar)
       where you want to send a certain portion of the traffic to the target
       Build ID.
       
      .temporal.api.taskqueue.v1.RampByPercentage percentage_ramp = 3;
      Specified by:
      getPercentageRampOrBuilder in interface BuildIdAssignmentRuleOrBuilder
    • setUnknownFields

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

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