worker_versioning

package
v1.26.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildIdSearchAttributePrefixPinned = "pinned"

	BuildIdSearchAttributeDelimiter = ":"
	BuildIdSearchAttributeEscape    = "|"
	// UnversionedSearchAttribute is the sentinel value used to mark all unversioned workflows
	UnversionedSearchAttribute = buildIdSearchAttributePrefixUnversioned
)

Variables

This section is empty.

Functions

func AssignedBuildIdSearchAttribute added in v1.24.0

func AssignedBuildIdSearchAttribute(buildId string) string

AssignedBuildIdSearchAttribute returns the search attribute value for the currently assigned build ID

func BuildIdIfUsingVersioning added in v1.24.0

func BuildIdIfUsingVersioning(stamp *commonpb.WorkerVersionStamp) string

BuildIdIfUsingVersioning returns the given WorkerVersionStamp if it is using versioning, otherwise returns nil.

func DeploymentFromCapabilities added in v1.26.2

func DeploymentFromCapabilities(capabilities *commonpb.WorkerVersionCapabilities) *deploymentpb.Deployment

DeploymentFromCapabilities returns the deployment if it is using versioning V3, otherwise nil.

func DeploymentToString added in v1.26.2

func DeploymentToString(deployment *deploymentpb.Deployment) string

DeploymentToString is intended to be used for logs and metrics only. Theoretically, it can map different deployments to the string. DO NOT USE IN SERVER LOGIC.

func FindBuildId

func FindBuildId(versioningData *persistencespb.VersioningData, buildId string) (setIndex, indexInSet int)

FindBuildId finds a build ID in the version data's sets, returning (set index, index within that set). Returns -1, -1 if not found.

func FindCurrentDeployment added in v1.26.2

func FindCurrentDeployment(deployments *persistencespb.DeploymentData) *deploymentpb.Deployment

func IsUnversionedOrAssignedBuildIdSearchAttribute added in v1.24.0

func IsUnversionedOrAssignedBuildIdSearchAttribute(buildId string) bool

IsUnversionedOrAssignedBuildIdSearchAttribute returns the value is "unversioned" or "assigned:<bld>"

func MakeBuildIdDirective added in v1.24.0

func MakeBuildIdDirective(buildId string) *taskqueuespb.TaskVersionDirective

func MakeDirectiveForWorkflowTask added in v1.22.0

func MakeDirectiveForWorkflowTask(
	inheritedBuildId string,
	assignedBuildId string,
	stamp *commonpb.WorkerVersionStamp,
	hasCompletedWorkflowTask bool,
	behavior enumspb.VersioningBehavior,
	deployment *deploymentpb.Deployment,
) *taskqueuespb.TaskVersionDirective

MakeDirectiveForWorkflowTask returns a versioning directive based on the following parameters: - inheritedBuildId: build ID inherited from a past/previous wf execution (for Child WF or CaN) - assignedBuildId: the build ID to which the WF is currently assigned (i.e. mutable state's AssginedBuildId) - stamp: the latest versioning stamp of the execution (only needed for old versioning) - hasCompletedWorkflowTask: if the wf has completed any WFT - behavior: workflow's effective behavior - deployment: workflow's effective deployment

func MakeUseAssignmentRulesDirective added in v1.24.0

func MakeUseAssignmentRulesDirective() *taskqueuespb.TaskVersionDirective

func PinnedBuildIdSearchAttribute added in v1.26.2

func PinnedBuildIdSearchAttribute(deployment *deploymentpb.Deployment) string

PinnedBuildIdSearchAttribute returns the search attribute value for the currently assigned pinned build ID in the form 'pinned:<deployment_series_name>:<deployment_build_id>'. Each workflow execution will have at most one member of the BuildIds KeywordList in this format. If the workflow becomes unpinned or unversioned, this entry will be removed from that list.

func StampFromBuildId added in v1.26.2

func StampFromBuildId(buildId string) *commonpb.WorkerVersionStamp

func StampFromCapabilities added in v1.24.0

func StampIfUsingVersioning added in v1.22.0

func StampIfUsingVersioning(stamp *commonpb.WorkerVersionStamp) *commonpb.WorkerVersionStamp

StampIfUsingVersioning returns the given WorkerVersionStamp if it is using versioning, otherwise returns nil.

func UnversionedBuildIdSearchAttribute

func UnversionedBuildIdSearchAttribute(buildId string) string

UnversionedBuildIdSearchAttribute returns the search attribute value for an unversioned build ID

func ValidateDeployment added in v1.26.2

func ValidateDeployment(deployment *deploymentpb.Deployment) error

ValidateDeployment returns error if the deployment is nil or it has empty build ID or deployment name.

func ValidateVersioningOverride added in v1.26.2

func ValidateVersioningOverride(override *workflowpb.VersioningOverride) error

func VersionStampToBuildIdSearchAttribute

func VersionStampToBuildIdSearchAttribute(stamp *commonpb.WorkerVersionStamp) string

VersionStampToBuildIdSearchAttribute returns the search attribute value for a version stamp

func VersionedBuildIdSearchAttribute

func VersionedBuildIdSearchAttribute(buildId string) string

VersionedBuildIdSearchAttribute returns the search attribute value for a versioned build ID

func WorkflowsExistForBuildId

func WorkflowsExistForBuildId(ctx context.Context, visibilityManager manager.VisibilityManager, ns *namespace.Namespace, taskQueue, buildId string) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL