partition

package
v1.2.6-prerelease5 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package partition is a generated GoMock package.

Index

Constants

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

Variables

View Source
var ErrInvalidPartitionConfig = errors.New("invalid partition config")

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

View Source
var ErrNoIsolationGroupsAvailable = errors.New("no isolation-groups are available")

ErrNoIsolationGroupsAvailable is returned when there are no available isolation-groups this usually indicates a 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, DomainID string, partitionKey PartitionConfig, availableIsolationGroups []string) (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, DomainID, partitionKey, availableIsolationGroups interface{}) *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, DomainID string, partitionKey PartitionConfig, availableIsolationGroups []string) (string, error)
}

func NewDefaultPartitioner

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

Jump to

Keyboard shortcuts

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