partition

package
v1.2.15-prerelease12 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package partition is a generated GoMock package.

Index

Constants

View Source
const (
	IsolationGroupKey         = "isolation-group"
	OriginalIsolationGroupKey = "original-isolation-group"
	WorkflowIDKey             = "wf-id"
)

Variables

View Source
var (
	IsolationLeakCauseError           = metrics.IsolationLeakCause("error")
	IsolationLeakCauseGroupUnknown    = metrics.IsolationLeakCause("group_unknown")
	IsolationLeakCauseGroupDrained    = metrics.IsolationLeakCause("group_drained")
	IsolationLeakCauseNoRecentPollers = metrics.IsolationLeakCause("no_recent_pollers")
	IsolationLeakCauseExpired         = metrics.IsolationLeakCause("expired")
)
View Source
var ErrInvalidPartitionConfig = errors.New("invalid partition config")

ErrInvalidPartitionConfig is returned when the required partitioning configuration is missing due to misconfiguration

Functions

func ConfigFromContext

func ConfigFromContext(ctx context.Context) map[string]string

ConfigFromContext retrieves infomation about the partition config of the context which is used for tasklist isolation

func ContextWithConfig

func ContextWithConfig(ctx context.Context, partitionConfig map[string]string) context.Context

ContextWithConfig stores the partition config of tasklist isolation into the given context

func ContextWithIsolationGroup

func ContextWithIsolationGroup(ctx context.Context, isolationGroup string) context.Context

ContextWithIsolationGroup stores the isolation group into the given context

func IsolationGroupFromContext

func IsolationGroupFromContext(ctx context.Context) string

IsolationGroupFromContext retrieves the isolation group from the given context, which is used to identify which isolation group the poller is from

Types

type MockPartitioner

type MockPartitioner struct {
	// contains filtered or unexported fields
}

MockPartitioner is a mock of Partitioner interface.

func NewMockPartitioner

func NewMockPartitioner(ctrl *gomock.Controller) *MockPartitioner

NewMockPartitioner creates a new mock instance.

func (*MockPartitioner) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPartitioner) GetIsolationGroupByDomainID

func (m *MockPartitioner) GetIsolationGroupByDomainID(ctx context.Context, scope metrics.Scope, pollerinfo PollerInfo, partitionKey PartitionConfig) (string, error)

GetIsolationGroupByDomainID mocks base method.

type MockPartitionerMockRecorder

type MockPartitionerMockRecorder struct {
	// contains filtered or unexported fields
}

MockPartitionerMockRecorder is the mock recorder for MockPartitioner.

func (*MockPartitionerMockRecorder) GetIsolationGroupByDomainID

func (mr *MockPartitionerMockRecorder) GetIsolationGroupByDomainID(ctx, scope, pollerinfo, partitionKey any) *gomock.Call

GetIsolationGroupByDomainID indicates an expected call of GetIsolationGroupByDomainID.

type PartitionConfig

type PartitionConfig map[string]string

A PartitionConfig is the values passed in by a workflow on start for their partitioning

type Partitioner

type Partitioner interface {
	// GetIsolationGroupByDomainID gets where the task workflow should be executing. Largely used by Matching
	// when determining which isolationGroup to place the tasks in.
	// Implementations ought to return (nil, nil) for when the feature is not enabled.
	GetIsolationGroupByDomainID(ctx context.Context, scope metrics.Scope, pollerinfo PollerInfo, partitionKey PartitionConfig) (string, error)
}

func NewDefaultPartitioner

func NewDefaultPartitioner(
	logger log.Logger,
	isolationGroupState isolationgroup.State,
) Partitioner

type PollerInfo

type PollerInfo struct {
	DomainID     string
	TasklistName string
	// The isolation groups that are known to have pollers in them and are able to receive tasks
	// for this domain and tasklist.
	AvailableIsolationGroups []string
}

PollerInfo captures relevant information from the poller side

Jump to

Keyboard shortcuts

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