activecluster

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package activecluster is a generated GoMock package.

Package activecluster is a generated GoMock package.

Package activecluster is a generated GoMock package.

Index

Constants

View Source
const (
	LookupNewWorkflowOpName       = "LookupNewWorkflow"
	LookupWorkflowOpName          = "LookupWorkflow"
	LookupClusterOpName           = "LookupCluster"
	DomainIDToDomainFnErrorReason = "domain_id_to_name_fn_error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeType

type ChangeType string
const (
	ChangeTypeEntityMap ChangeType = "ChangeTypeEntityMap"
)

type ClusterNotFoundError added in v1.3.4

type ClusterNotFoundError struct {
	ClusterName string
}

func (*ClusterNotFoundError) Error added in v1.3.4

func (e *ClusterNotFoundError) Error() string

type ClusterNotFoundForRegionError added in v1.3.1

type ClusterNotFoundForRegionError struct {
	ClusterName string
	Region      string
}

func (*ClusterNotFoundForRegionError) Error added in v1.3.1

type DomainIDToDomainFn

type DomainIDToDomainFn func(id string) (*cache.DomainCacheEntry, error)

type ExecutionManagerProvider added in v1.3.2

type ExecutionManagerProvider interface {
	GetExecutionManager(shardID int) (persistence.ExecutionManager, error)
}

type ExternalEntity added in v1.3.1

type ExternalEntity struct {
	Source          string
	Key             string
	Region          string
	FailoverVersion int64
}

type ExternalEntityProvider added in v1.3.1

type ExternalEntityProvider interface {
	SupportedType() string
	ChangeEvents() <-chan ChangeType
	GetExternalEntity(ctx context.Context, entityKey string) (*ExternalEntity, error)
}

type LookupResult

type LookupResult struct {
	Region          string
	ClusterName     string
	FailoverVersion int64
}

type Manager

type Manager interface {
	common.Daemon

	// LookupNewWorkflow returns active cluster, region and failover version of given new workflow.
	//  1. If domain is local:
	//     	Returns info from domain entry.
	//  2. If domain is active-passive global:
	//     	Returns info from domain entry.
	//  3. If domain is active-active global:
	//     	3.1. if workflow is region sticky, returns current cluster and its 	failover version.
	//     	3.2. if workflow has external entity, returns region, cluster name and failover version of corresponding row in EntityActiveRegion lookup table.
	LookupNewWorkflow(ctx context.Context, domainID string, policy *types.ActiveClusterSelectionPolicy) (*LookupResult, error)

	// LookupWorkflow returns active cluster, region and failover version of given existing workflow.
	// Returns the info from domain entry for local and active-passive domains
	//
	// Active-active domain logic:
	//  1. Get ActivenessMetadata record of the workflow
	//     1.a. If it's found, continue with step 2
	//     1.b. If it's not found and the domain is migrated from active-passive to active-active return domain's ActiveClusterName and FailoverVersion.
	//     1.c. If it's not found and the domain is not migrated from active-passive to active-active, the workflow must have been retired. Return cluster name and failover version of current region.
	//  2. Given ActivenessMetadata, return region and failover version
	//     2.a. If workflow is region sticky (origin=regionA), find active cluster in that region in domain's active cluster config and return its name and failover version.
	//     2.b. If workflow has external entity, locate the entity from EntityActiveRegion table and return that region and it's failover version.
	LookupWorkflow(ctx context.Context, domainID, wfID, rID string) (*LookupResult, error)

	// RegisterChangeCallback registers a callback that will be called for change events such as entity map changes.
	RegisterChangeCallback(shardID int, callback func(ChangeType))

	// UnregisterChangeCallback unregisters a callback that will be called for change events.
	UnregisterChangeCallback(shardID int)

	// SupportedExternalEntityType returns true if the external entity type is supported.
	SupportedExternalEntityType(entityType string) bool

	// CurrentRegion returns the current region.
	CurrentRegion() string
}

Manager is the interface for active cluster manager. It is used to lookup region, active cluster, cluster name and failover version etc. This was introduced to support active-active domains. It encapsulates the logic to lookup the active cluster for all kinds of domains. Most other components should use this interface instead of cluster metadata directly. It is also used to notify components when there's an external entity change. History engine subscribes to these updates similar to domain change notifications.

func NewManager

func NewManager(
	domainIDToDomainFn DomainIDToDomainFn,
	clusterMetadata cluster.Metadata,
	metricsCl metrics.Client,
	logger log.Logger,
	externalEntityProviders []ExternalEntityProvider,
	executionManagerProvider ExecutionManagerProvider,
	numShards int,
	opts ...ManagerOption,
) (Manager, error)

type ManagerOption added in v1.3.1

type ManagerOption func(*managerImpl)

func WithTimeSource added in v1.3.1

func WithTimeSource(timeSource clock.TimeSource) ManagerOption

type MockExecutionManagerProvider added in v1.3.2

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

MockExecutionManagerProvider is a mock of ExecutionManagerProvider interface.

func NewMockExecutionManagerProvider added in v1.3.2

func NewMockExecutionManagerProvider(ctrl *gomock.Controller) *MockExecutionManagerProvider

NewMockExecutionManagerProvider creates a new mock instance.

func (*MockExecutionManagerProvider) EXPECT added in v1.3.2

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

func (*MockExecutionManagerProvider) GetExecutionManager added in v1.3.2

func (m *MockExecutionManagerProvider) GetExecutionManager(shardID int) (persistence.ExecutionManager, error)

GetExecutionManager mocks base method.

type MockExecutionManagerProviderMockRecorder added in v1.3.2

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

MockExecutionManagerProviderMockRecorder is the mock recorder for MockExecutionManagerProvider.

func (*MockExecutionManagerProviderMockRecorder) GetExecutionManager added in v1.3.2

func (mr *MockExecutionManagerProviderMockRecorder) GetExecutionManager(shardID any) *gomock.Call

GetExecutionManager indicates an expected call of GetExecutionManager.

type MockExternalEntityProvider added in v1.3.1

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

MockExternalEntityProvider is a mock of ExternalEntityProvider interface.

func NewMockExternalEntityProvider added in v1.3.1

func NewMockExternalEntityProvider(ctrl *gomock.Controller) *MockExternalEntityProvider

NewMockExternalEntityProvider creates a new mock instance.

func (*MockExternalEntityProvider) ChangeEvents added in v1.3.1

func (m *MockExternalEntityProvider) ChangeEvents() <-chan ChangeType

ChangeEvents mocks base method.

func (*MockExternalEntityProvider) EXPECT added in v1.3.1

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

func (*MockExternalEntityProvider) GetExternalEntity added in v1.3.1

func (m *MockExternalEntityProvider) GetExternalEntity(ctx context.Context, entityKey string) (*ExternalEntity, error)

GetExternalEntity mocks base method.

func (*MockExternalEntityProvider) SupportedType added in v1.3.2

func (m *MockExternalEntityProvider) SupportedType() string

SupportedType mocks base method.

type MockExternalEntityProviderMockRecorder added in v1.3.1

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

MockExternalEntityProviderMockRecorder is the mock recorder for MockExternalEntityProvider.

func (*MockExternalEntityProviderMockRecorder) ChangeEvents added in v1.3.1

ChangeEvents indicates an expected call of ChangeEvents.

func (*MockExternalEntityProviderMockRecorder) GetExternalEntity added in v1.3.1

func (mr *MockExternalEntityProviderMockRecorder) GetExternalEntity(ctx, entityKey any) *gomock.Call

GetExternalEntity indicates an expected call of GetExternalEntity.

func (*MockExternalEntityProviderMockRecorder) SupportedType added in v1.3.2

func (mr *MockExternalEntityProviderMockRecorder) SupportedType() *gomock.Call

SupportedType indicates an expected call of SupportedType.

type MockManager

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

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) CurrentRegion added in v1.3.2

func (m *MockManager) CurrentRegion() string

CurrentRegion mocks base method.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

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

func (*MockManager) LookupNewWorkflow added in v1.3.3

func (m *MockManager) LookupNewWorkflow(ctx context.Context, domainID string, policy *types.ActiveClusterSelectionPolicy) (*LookupResult, error)

LookupNewWorkflow mocks base method.

func (*MockManager) LookupWorkflow

func (m *MockManager) LookupWorkflow(ctx context.Context, domainID, wfID, rID string) (*LookupResult, error)

LookupWorkflow mocks base method.

func (*MockManager) RegisterChangeCallback

func (m *MockManager) RegisterChangeCallback(shardID int, callback func(ChangeType))

RegisterChangeCallback mocks base method.

func (*MockManager) Start

func (m *MockManager) Start()

Start mocks base method.

func (*MockManager) Stop

func (m *MockManager) Stop()

Stop mocks base method.

func (*MockManager) SupportedExternalEntityType added in v1.3.2

func (m *MockManager) SupportedExternalEntityType(entityType string) bool

SupportedExternalEntityType mocks base method.

func (*MockManager) UnregisterChangeCallback

func (m *MockManager) UnregisterChangeCallback(shardID int)

UnregisterChangeCallback mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) CurrentRegion added in v1.3.2

func (mr *MockManagerMockRecorder) CurrentRegion() *gomock.Call

CurrentRegion indicates an expected call of CurrentRegion.

func (*MockManagerMockRecorder) LookupNewWorkflow added in v1.3.3

func (mr *MockManagerMockRecorder) LookupNewWorkflow(ctx, domainID, policy any) *gomock.Call

LookupNewWorkflow indicates an expected call of LookupNewWorkflow.

func (*MockManagerMockRecorder) LookupWorkflow

func (mr *MockManagerMockRecorder) LookupWorkflow(ctx, domainID, wfID, rID any) *gomock.Call

LookupWorkflow indicates an expected call of LookupWorkflow.

func (*MockManagerMockRecorder) RegisterChangeCallback

func (mr *MockManagerMockRecorder) RegisterChangeCallback(shardID, callback any) *gomock.Call

RegisterChangeCallback indicates an expected call of RegisterChangeCallback.

func (*MockManagerMockRecorder) Start

func (mr *MockManagerMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

func (*MockManagerMockRecorder) Stop

func (mr *MockManagerMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

func (*MockManagerMockRecorder) SupportedExternalEntityType added in v1.3.2

func (mr *MockManagerMockRecorder) SupportedExternalEntityType(entityType any) *gomock.Call

SupportedExternalEntityType indicates an expected call of SupportedExternalEntityType.

func (*MockManagerMockRecorder) UnregisterChangeCallback

func (mr *MockManagerMockRecorder) UnregisterChangeCallback(shardID any) *gomock.Call

UnregisterChangeCallback indicates an expected call of UnregisterChangeCallback.

type RegionNotFoundForDomainError added in v1.3.1

type RegionNotFoundForDomainError struct {
	Region   string
	DomainID string
}

func (*RegionNotFoundForDomainError) Error added in v1.3.1

Jump to

Keyboard shortcuts

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