Class BuildIdAssignmentRule.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, BuildIdAssignmentRuleOrBuilder, java.lang.Cloneable
    Enclosing class:
    BuildIdAssignmentRule

    public static final class BuildIdAssignmentRule.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<BuildIdAssignmentRule.Builder>
    implements BuildIdAssignmentRuleOrBuilder
     These rules assign a Build ID to Unassigned Workflow Executions and
     Activities.
     Specifically, assignment rules are applied to the following Executions or
     Activities when they are scheduled in a Task Queue:
        - Generally, any new Workflow Execution, except:
          - When A Child Workflow or a Continue-As-New Execution inherits the
            Build ID from its parent/previous execution by setting the
            `inherit_build_id` flag.
          - Workflow Executions started Eagerly are assigned to the Build ID of
            the Starter.
        - An Activity that is scheduled on a Task Queue different from the one
          their Workflow runs on, unless the `use_workflow_build_id` flag is set.
     In absence of (applicable) redirect rules (`CompatibleBuildIdRedirectRule`s)
     the task will be dispatched to Workers of the Build ID determined by the
     assignment rules. Otherwise, the final Build ID will be determined by the
     redirect rules.
     When using Worker Versioning, in the steady state, for a given Task Queue,
     there should typically be exactly one assignment rule to send all Unassigned
     tasks to the latest Build ID. Existence of at least one such "unconditional"
     rule at all times is enforce 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 sent to unversioned
     workers, if available. Otherwise, they remain Unassigned, and will be
     retried for assignment, or dispatch to unversioned workers, at a later time
     depending on the availability of workers.
     
    Protobuf type temporal.api.taskqueue.v1.BuildIdAssignmentRule
    • 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<BuildIdAssignmentRule.Builder>
      • clear

        public 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

        public BuildIdAssignmentRule.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,
                                                      java.lang.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,
                                                              java.lang.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,
                                                              java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<BuildIdAssignmentRule.Builder>
      • 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 java.io.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:
        java.io.IOException
      • setTargetBuildId

        public BuildIdAssignmentRule.Builder setTargetBuildId​(java.lang.String value)
        string target_build_id = 1;
        Parameters:
        value - The targetBuildId to set.
        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;
      • 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>