Class Priority.Builder

  • Enclosing class:
    Priority

    public static final class Priority.Builder
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Priority build()  
      Priority.Builder setFairnessKey​(java.lang.String fairnessKey)
      FairnessKey is a short string that's used as a key for a fairness balancing mechanism.
      Priority.Builder setFairnessWeight​(float fairnessWeight)
      FairnessWeight for a task can come from multiple sources for flexibility.
      Priority.Builder setPriorityKey​(int priorityKey)
      A priority key is a positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setPriorityKey

        public Priority.Builder setPriorityKey​(int priorityKey)
        A 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.

        The default value when unset or 0 is calculated by (min+max)/2. With the default max of 5, and min of 1, that comes out to 3.

      • setFairnessKey

        public Priority.Builder setFairnessKey​(java.lang.String fairnessKey)
        FairnessKey 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.

        Fairness keys are limited to 64 bytes.

      • setFairnessWeight

        public Priority.Builder setFairnessWeight​(float fairnessWeight)
        FairnessWeight for a task can come from multiple sources for flexibility. From highest to lowest precedence:
        • Weights for a small set of keys can be overridden in task queue configuration with an API.
        • It can be attached to the workflow/activity in this field.
        • The default weight of 1.0 will be used.

        Weight values are clamped to the range [0.001, 1000].