Package io.temporal.api.common.v1
Class Priority.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
- io.temporal.api.common.v1.Priority.Builder
-
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,PriorityOrBuilder,java.lang.Cloneable
- Enclosing class:
- Priority
public static final class Priority.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder> implements PriorityOrBuilder
Priority contains metadata that controls relative ordering of task processing when tasks are backed up in a queue. Initially, Priority will be used in matching (workflow and activity) task queues. Later it may be used in history task queues and in rate limiting decisions. Priority is attached to workflows and activities. By default, activities inherit Priority from the workflow that created them, but may override fields when an activity is started or modified. Despite being named "Priority", this message also contains fields that control "fairness" mechanisms. For all fields, the field not present or equal to zero/empty string means to inherit the value from the calling workflow, or if there is no calling workflow, then use the default value. For all fields other than fairness_key, the zero value isn't meaningful so there's no confusion between inherit/default and a meaningful value. For fairness_key, the empty string will be interpreted as "inherit". This means that if a workflow has a non-empty fairness key, you can't override the fairness key of its activity to the empty string. The overall semantics of Priority are: 1. First, consider "priority": higher priority (lower number) goes first. 2. Then, consider fairness: try to dispatch tasks for different fairness keys in proportion to their weight. Applications may use any subset of mechanisms that are useful to them and leave the other fields to use default values. Not all queues in the system may support the "full" semantics of all priority fields. (Currently only support in matching task queues is planned.)Protobuf typetemporal.api.common.v1.Priority
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Priority.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)Prioritybuild()PrioritybuildPartial()Priority.Builderclear()Priority.BuilderclearFairnessKey()Fairness key is a short string that's used as a key for a fairness balancing mechanism.Priority.BuilderclearFairnessWeight()Fairness weight for a task can come from multiple sources for flexibility.Priority.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)Priority.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)Priority.BuilderclearPriorityKey()Priority key is a positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner).Priority.Builderclone()PrioritygetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()java.lang.StringgetFairnessKey()Fairness key is a short string that's used as a key for a fairness balancing mechanism.com.google.protobuf.ByteStringgetFairnessKeyBytes()Fairness key is a short string that's used as a key for a fairness balancing mechanism.floatgetFairnessWeight()Fairness weight for a task can come from multiple sources for flexibility.intgetPriorityKey()Priority key is a positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner).protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()Priority.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)Priority.BuildermergeFrom(com.google.protobuf.Message other)Priority.BuildermergeFrom(Priority other)Priority.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)Priority.BuildersetFairnessKey(java.lang.String value)Fairness key is a short string that's used as a key for a fairness balancing mechanism.Priority.BuildersetFairnessKeyBytes(com.google.protobuf.ByteString value)Fairness key is a short string that's used as a key for a fairness balancing mechanism.Priority.BuildersetFairnessWeight(float value)Fairness weight for a task can come from multiple sources for flexibility.Priority.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)Priority.BuildersetPriorityKey(int value)Priority key is a positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner).Priority.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)Priority.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
clear
public Priority.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
getDefaultInstanceForType
public Priority getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public Priority build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public Priority buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public Priority.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
setField
public Priority.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
clearField
public Priority.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
clearOneof
public Priority.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
setRepeatedField
public Priority.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
addRepeatedField
public Priority.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
mergeFrom
public Priority.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Priority.Builder>
-
mergeFrom
public Priority.Builder mergeFrom(Priority other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
mergeFrom
public Priority.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Priority.Builder>- Throws:
java.io.IOException
-
getPriorityKey
public int getPriorityKey()
Priority key is a positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner). In general, tasks in a queue should be processed in close to priority order, although small deviations are possible. The maximum priority value (minimum priority) is determined by server configuration, and defaults to 5. If priority is not present (or zero), then the effective priority will be the default priority, which is is calculated by (min+max)/2. With the default max of 5, and min of 1, that comes out to 3.
int32 priority_key = 1;- Specified by:
getPriorityKeyin interfacePriorityOrBuilder- Returns:
- The priorityKey.
-
setPriorityKey
public Priority.Builder setPriorityKey(int value)
Priority key is a positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner). In general, tasks in a queue should be processed in close to priority order, although small deviations are possible. The maximum priority value (minimum priority) is determined by server configuration, and defaults to 5. If priority is not present (or zero), then the effective priority will be the default priority, which is is calculated by (min+max)/2. With the default max of 5, and min of 1, that comes out to 3.
int32 priority_key = 1;- Parameters:
value- The priorityKey to set.- Returns:
- This builder for chaining.
-
clearPriorityKey
public Priority.Builder clearPriorityKey()
Priority key is a positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner). In general, tasks in a queue should be processed in close to priority order, although small deviations are possible. The maximum priority value (minimum priority) is determined by server configuration, and defaults to 5. If priority is not present (or zero), then the effective priority will be the default priority, which is is calculated by (min+max)/2. With the default max of 5, and min of 1, that comes out to 3.
int32 priority_key = 1;- Returns:
- This builder for chaining.
-
getFairnessKey
public java.lang.String getFairnessKey()
Fairness key is a short string that's used as a key for a fairness balancing mechanism. It may correspond to a tenant id, or to a fixed string like "high" or "low". The default is the empty string. The fairness mechanism attempts to dispatch tasks for a given key in proportion to its weight. For example, using a thousand distinct tenant ids, each with a weight of 1.0 (the default) will result in each tenant getting a roughly equal share of task dispatch throughput. (Note: this does not imply equal share of worker capacity! Fairness decisions are made based on queue statistics, not current worker load.) As another example, using keys "high" and "low" with weight 9.0 and 1.0 respectively will prefer dispatching "high" tasks over "low" tasks at a 9:1 ratio, while allowing either key to use all worker capacity if the other is not present. All fairness mechanisms, including rate limits, are best-effort and probabilistic. The results may not match what a "perfect" algorithm with infinite resources would produce. The more unique keys are used, the less accurate the results will be. Fairness keys are limited to 64 bytes.
string fairness_key = 2;- Specified by:
getFairnessKeyin interfacePriorityOrBuilder- Returns:
- The fairnessKey.
-
getFairnessKeyBytes
public com.google.protobuf.ByteString getFairnessKeyBytes()
Fairness key is a short string that's used as a key for a fairness balancing mechanism. It may correspond to a tenant id, or to a fixed string like "high" or "low". The default is the empty string. The fairness mechanism attempts to dispatch tasks for a given key in proportion to its weight. For example, using a thousand distinct tenant ids, each with a weight of 1.0 (the default) will result in each tenant getting a roughly equal share of task dispatch throughput. (Note: this does not imply equal share of worker capacity! Fairness decisions are made based on queue statistics, not current worker load.) As another example, using keys "high" and "low" with weight 9.0 and 1.0 respectively will prefer dispatching "high" tasks over "low" tasks at a 9:1 ratio, while allowing either key to use all worker capacity if the other is not present. All fairness mechanisms, including rate limits, are best-effort and probabilistic. The results may not match what a "perfect" algorithm with infinite resources would produce. The more unique keys are used, the less accurate the results will be. Fairness keys are limited to 64 bytes.
string fairness_key = 2;- Specified by:
getFairnessKeyBytesin interfacePriorityOrBuilder- Returns:
- The bytes for fairnessKey.
-
setFairnessKey
public Priority.Builder setFairnessKey(java.lang.String value)
Fairness key is a short string that's used as a key for a fairness balancing mechanism. It may correspond to a tenant id, or to a fixed string like "high" or "low". The default is the empty string. The fairness mechanism attempts to dispatch tasks for a given key in proportion to its weight. For example, using a thousand distinct tenant ids, each with a weight of 1.0 (the default) will result in each tenant getting a roughly equal share of task dispatch throughput. (Note: this does not imply equal share of worker capacity! Fairness decisions are made based on queue statistics, not current worker load.) As another example, using keys "high" and "low" with weight 9.0 and 1.0 respectively will prefer dispatching "high" tasks over "low" tasks at a 9:1 ratio, while allowing either key to use all worker capacity if the other is not present. All fairness mechanisms, including rate limits, are best-effort and probabilistic. The results may not match what a "perfect" algorithm with infinite resources would produce. The more unique keys are used, the less accurate the results will be. Fairness keys are limited to 64 bytes.
string fairness_key = 2;- Parameters:
value- The fairnessKey to set.- Returns:
- This builder for chaining.
-
clearFairnessKey
public Priority.Builder clearFairnessKey()
Fairness key is a short string that's used as a key for a fairness balancing mechanism. It may correspond to a tenant id, or to a fixed string like "high" or "low". The default is the empty string. The fairness mechanism attempts to dispatch tasks for a given key in proportion to its weight. For example, using a thousand distinct tenant ids, each with a weight of 1.0 (the default) will result in each tenant getting a roughly equal share of task dispatch throughput. (Note: this does not imply equal share of worker capacity! Fairness decisions are made based on queue statistics, not current worker load.) As another example, using keys "high" and "low" with weight 9.0 and 1.0 respectively will prefer dispatching "high" tasks over "low" tasks at a 9:1 ratio, while allowing either key to use all worker capacity if the other is not present. All fairness mechanisms, including rate limits, are best-effort and probabilistic. The results may not match what a "perfect" algorithm with infinite resources would produce. The more unique keys are used, the less accurate the results will be. Fairness keys are limited to 64 bytes.
string fairness_key = 2;- Returns:
- This builder for chaining.
-
setFairnessKeyBytes
public Priority.Builder setFairnessKeyBytes(com.google.protobuf.ByteString value)
Fairness key is a short string that's used as a key for a fairness balancing mechanism. It may correspond to a tenant id, or to a fixed string like "high" or "low". The default is the empty string. The fairness mechanism attempts to dispatch tasks for a given key in proportion to its weight. For example, using a thousand distinct tenant ids, each with a weight of 1.0 (the default) will result in each tenant getting a roughly equal share of task dispatch throughput. (Note: this does not imply equal share of worker capacity! Fairness decisions are made based on queue statistics, not current worker load.) As another example, using keys "high" and "low" with weight 9.0 and 1.0 respectively will prefer dispatching "high" tasks over "low" tasks at a 9:1 ratio, while allowing either key to use all worker capacity if the other is not present. All fairness mechanisms, including rate limits, are best-effort and probabilistic. The results may not match what a "perfect" algorithm with infinite resources would produce. The more unique keys are used, the less accurate the results will be. Fairness keys are limited to 64 bytes.
string fairness_key = 2;- Parameters:
value- The bytes for fairnessKey to set.- Returns:
- This builder for chaining.
-
getFairnessWeight
public float getFairnessWeight()
Fairness weight for a task can come from multiple sources for flexibility. From highest to lowest precedence: 1. Weights for a small set of keys can be overridden in task queue configuration with an API. 2. It can be attached to the workflow/activity in this field. 3. The default weight of 1.0 will be used. Weight values are clamped to the range [0.001, 1000].float fairness_weight = 3;- Specified by:
getFairnessWeightin interfacePriorityOrBuilder- Returns:
- The fairnessWeight.
-
setFairnessWeight
public Priority.Builder setFairnessWeight(float value)
Fairness weight for a task can come from multiple sources for flexibility. From highest to lowest precedence: 1. Weights for a small set of keys can be overridden in task queue configuration with an API. 2. It can be attached to the workflow/activity in this field. 3. The default weight of 1.0 will be used. Weight values are clamped to the range [0.001, 1000].float fairness_weight = 3;- Parameters:
value- The fairnessWeight to set.- Returns:
- This builder for chaining.
-
clearFairnessWeight
public Priority.Builder clearFairnessWeight()
Fairness weight for a task can come from multiple sources for flexibility. From highest to lowest precedence: 1. Weights for a small set of keys can be overridden in task queue configuration with an API. 2. It can be attached to the workflow/activity in this field. 3. The default weight of 1.0 will be used. Weight values are clamped to the range [0.001, 1000].float fairness_weight = 3;- Returns:
- This builder for chaining.
-
setUnknownFields
public final Priority.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
mergeUnknownFields
public final Priority.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Priority.Builder>
-
-