matching

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 27 Imported by: 10

Documentation

Overview

Package matching is a generated GoMock package.

Package matching is a generated GoMock package.

Package matching is a generated GoMock package.

Package matching is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	AddActivityTask(context.Context, *types.AddActivityTaskRequest, ...yarpc.CallOption) (*types.AddActivityTaskResponse, error)
	AddDecisionTask(context.Context, *types.AddDecisionTaskRequest, ...yarpc.CallOption) (*types.AddDecisionTaskResponse, error)
	CancelOutstandingPoll(context.Context, *types.CancelOutstandingPollRequest, ...yarpc.CallOption) error
	DescribeTaskList(context.Context, *types.MatchingDescribeTaskListRequest, ...yarpc.CallOption) (*types.DescribeTaskListResponse, error)
	ListTaskListPartitions(context.Context, *types.MatchingListTaskListPartitionsRequest, ...yarpc.CallOption) (*types.ListTaskListPartitionsResponse, error)
	GetTaskListsByDomain(context.Context, *types.GetTaskListsByDomainRequest, ...yarpc.CallOption) (*types.GetTaskListsByDomainResponse, error)
	PollForActivityTask(context.Context, *types.MatchingPollForActivityTaskRequest, ...yarpc.CallOption) (*types.MatchingPollForActivityTaskResponse, error)
	PollForDecisionTask(context.Context, *types.MatchingPollForDecisionTaskRequest, ...yarpc.CallOption) (*types.MatchingPollForDecisionTaskResponse, error)
	QueryWorkflow(context.Context, *types.MatchingQueryWorkflowRequest, ...yarpc.CallOption) (*types.QueryWorkflowResponse, error)
	RespondQueryTaskCompleted(context.Context, *types.MatchingRespondQueryTaskCompletedRequest, ...yarpc.CallOption) error
	UpdateTaskListPartitionConfig(context.Context, *types.MatchingUpdateTaskListPartitionConfigRequest, ...yarpc.CallOption) (*types.MatchingUpdateTaskListPartitionConfigResponse, error)
	RefreshTaskListPartitionConfig(context.Context, *types.MatchingRefreshTaskListPartitionConfigRequest, ...yarpc.CallOption) (*types.MatchingRefreshTaskListPartitionConfigResponse, error)
}

Client is the interface exposed by types service client

func NewClient

func NewClient(
	client Client,
	peerResolver PeerResolver,
	lb LoadBalancer,
	provider PartitionConfigProvider,
) Client

NewClient creates a new history service TChannel client

type LoadBalancer added in v0.7.0

type LoadBalancer interface {
	// PickWritePartition returns the task list partition for adding
	// an activity or decision task. The input is the name of the
	// original task list (with no partition info). When forwardedFrom
	// is non-empty, this call is forwardedFrom from a child partition
	// to a parent partition in which case, no load balancing should be
	// performed
	PickWritePartition(
		taskListType int,
		request WriteRequest,
	) string

	// PickReadPartition returns the task list partition to send a poller to.
	// Input is name of the original task list as specified by caller. When
	// forwardedFrom is non-empty, no load balancing should be done.
	PickReadPartition(
		taskListType int,
		request ReadRequest,
		isolationGroup string,
	) string

	// UpdateWeight updates the weight of a task list partition.
	// Input is name of the original task list as specified by caller. When
	// the original task list is a partition, no update should be done.
	UpdateWeight(
		taskListType int,
		request ReadRequest,
		partition string,
		info *types.LoadBalancerHints,
	)
}

LoadBalancer is the interface for implementers of component that distributes add/poll api calls across available task list partitions when possible

func NewIsolationLoadBalancer added in v1.2.15

func NewIsolationLoadBalancer(fallback LoadBalancer, provider PartitionConfigProvider, allIsolationGroups func() []string) LoadBalancer

func NewLoadBalancer added in v0.7.0

func NewLoadBalancer(
	provider PartitionConfigProvider,
) LoadBalancer

NewLoadBalancer returns an instance of matching load balancer that can help distribute api calls across task list partitions

func NewMultiLoadBalancer added in v1.2.14

func NewMultiLoadBalancer(
	defaultLoadBalancer LoadBalancer,
	loadBalancers map[string]LoadBalancer,
	domainIDToName func(string) (string, error),
	dc *dynamicconfig.Collection,
	logger log.Logger,
) LoadBalancer

func NewRoundRobinLoadBalancer added in v1.2.14

func NewRoundRobinLoadBalancer(
	provider PartitionConfigProvider,
) LoadBalancer

func NewWeightedLoadBalancer added in v1.2.14

func NewWeightedLoadBalancer(
	lb LoadBalancer,
	provider PartitionConfigProvider,
	logger log.Logger,
) LoadBalancer

type MockClient added in v0.17.0

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

MockClient is a mock of Client interface.

func NewMockClient added in v0.17.0

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) AddActivityTask added in v0.17.0

AddActivityTask mocks base method.

func (*MockClient) AddDecisionTask added in v0.17.0

AddDecisionTask mocks base method.

func (*MockClient) CancelOutstandingPoll added in v0.17.0

func (m *MockClient) CancelOutstandingPoll(arg0 context.Context, arg1 *types.CancelOutstandingPollRequest, arg2 ...yarpc.CallOption) error

CancelOutstandingPoll mocks base method.

func (*MockClient) DescribeTaskList added in v0.17.0

DescribeTaskList mocks base method.

func (*MockClient) EXPECT added in v0.17.0

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

func (*MockClient) GetTaskListsByDomain added in v0.23.1

GetTaskListsByDomain mocks base method.

func (*MockClient) ListTaskListPartitions added in v0.17.0

ListTaskListPartitions mocks base method.

func (*MockClient) PollForActivityTask added in v0.17.0

PollForActivityTask mocks base method.

func (*MockClient) PollForDecisionTask added in v0.17.0

PollForDecisionTask mocks base method.

func (*MockClient) QueryWorkflow added in v0.17.0

QueryWorkflow mocks base method.

func (*MockClient) RefreshTaskListPartitionConfig added in v1.2.15

RefreshTaskListPartitionConfig mocks base method.

func (*MockClient) RespondQueryTaskCompleted added in v0.17.0

func (m *MockClient) RespondQueryTaskCompleted(arg0 context.Context, arg1 *types.MatchingRespondQueryTaskCompletedRequest, arg2 ...yarpc.CallOption) error

RespondQueryTaskCompleted mocks base method.

func (*MockClient) UpdateTaskListPartitionConfig added in v1.2.15

UpdateTaskListPartitionConfig mocks base method.

type MockClientMockRecorder added in v0.17.0

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) AddActivityTask added in v0.17.0

func (mr *MockClientMockRecorder) AddActivityTask(arg0, arg1 any, arg2 ...any) *gomock.Call

AddActivityTask indicates an expected call of AddActivityTask.

func (*MockClientMockRecorder) AddDecisionTask added in v0.17.0

func (mr *MockClientMockRecorder) AddDecisionTask(arg0, arg1 any, arg2 ...any) *gomock.Call

AddDecisionTask indicates an expected call of AddDecisionTask.

func (*MockClientMockRecorder) CancelOutstandingPoll added in v0.17.0

func (mr *MockClientMockRecorder) CancelOutstandingPoll(arg0, arg1 any, arg2 ...any) *gomock.Call

CancelOutstandingPoll indicates an expected call of CancelOutstandingPoll.

func (*MockClientMockRecorder) DescribeTaskList added in v0.17.0

func (mr *MockClientMockRecorder) DescribeTaskList(arg0, arg1 any, arg2 ...any) *gomock.Call

DescribeTaskList indicates an expected call of DescribeTaskList.

func (*MockClientMockRecorder) GetTaskListsByDomain added in v0.23.1

func (mr *MockClientMockRecorder) GetTaskListsByDomain(arg0, arg1 any, arg2 ...any) *gomock.Call

GetTaskListsByDomain indicates an expected call of GetTaskListsByDomain.

func (*MockClientMockRecorder) ListTaskListPartitions added in v0.17.0

func (mr *MockClientMockRecorder) ListTaskListPartitions(arg0, arg1 any, arg2 ...any) *gomock.Call

ListTaskListPartitions indicates an expected call of ListTaskListPartitions.

func (*MockClientMockRecorder) PollForActivityTask added in v0.17.0

func (mr *MockClientMockRecorder) PollForActivityTask(arg0, arg1 any, arg2 ...any) *gomock.Call

PollForActivityTask indicates an expected call of PollForActivityTask.

func (*MockClientMockRecorder) PollForDecisionTask added in v0.17.0

func (mr *MockClientMockRecorder) PollForDecisionTask(arg0, arg1 any, arg2 ...any) *gomock.Call

PollForDecisionTask indicates an expected call of PollForDecisionTask.

func (*MockClientMockRecorder) QueryWorkflow added in v0.17.0

func (mr *MockClientMockRecorder) QueryWorkflow(arg0, arg1 any, arg2 ...any) *gomock.Call

QueryWorkflow indicates an expected call of QueryWorkflow.

func (*MockClientMockRecorder) RefreshTaskListPartitionConfig added in v1.2.15

func (mr *MockClientMockRecorder) RefreshTaskListPartitionConfig(arg0, arg1 any, arg2 ...any) *gomock.Call

RefreshTaskListPartitionConfig indicates an expected call of RefreshTaskListPartitionConfig.

func (*MockClientMockRecorder) RespondQueryTaskCompleted added in v0.17.0

func (mr *MockClientMockRecorder) RespondQueryTaskCompleted(arg0, arg1 any, arg2 ...any) *gomock.Call

RespondQueryTaskCompleted indicates an expected call of RespondQueryTaskCompleted.

func (*MockClientMockRecorder) UpdateTaskListPartitionConfig added in v1.2.15

func (mr *MockClientMockRecorder) UpdateTaskListPartitionConfig(arg0, arg1 any, arg2 ...any) *gomock.Call

UpdateTaskListPartitionConfig indicates an expected call of UpdateTaskListPartitionConfig.

type MockLoadBalancer added in v1.2.10

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

MockLoadBalancer is a mock of LoadBalancer interface.

func NewMockLoadBalancer added in v1.2.10

func NewMockLoadBalancer(ctrl *gomock.Controller) *MockLoadBalancer

NewMockLoadBalancer creates a new mock instance.

func (*MockLoadBalancer) EXPECT added in v1.2.10

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

func (*MockLoadBalancer) PickReadPartition added in v1.2.10

func (m *MockLoadBalancer) PickReadPartition(taskListType int, request ReadRequest, isolationGroup string) string

PickReadPartition mocks base method.

func (*MockLoadBalancer) PickWritePartition added in v1.2.10

func (m *MockLoadBalancer) PickWritePartition(taskListType int, request WriteRequest) string

PickWritePartition mocks base method.

func (*MockLoadBalancer) UpdateWeight added in v1.2.14

func (m *MockLoadBalancer) UpdateWeight(taskListType int, request ReadRequest, partition string, info *types.LoadBalancerHints)

UpdateWeight mocks base method.

type MockLoadBalancerMockRecorder added in v1.2.10

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

MockLoadBalancerMockRecorder is the mock recorder for MockLoadBalancer.

func (*MockLoadBalancerMockRecorder) PickReadPartition added in v1.2.10

func (mr *MockLoadBalancerMockRecorder) PickReadPartition(taskListType, request, isolationGroup any) *gomock.Call

PickReadPartition indicates an expected call of PickReadPartition.

func (*MockLoadBalancerMockRecorder) PickWritePartition added in v1.2.10

func (mr *MockLoadBalancerMockRecorder) PickWritePartition(taskListType, request any) *gomock.Call

PickWritePartition indicates an expected call of PickWritePartition.

func (*MockLoadBalancerMockRecorder) UpdateWeight added in v1.2.14

func (mr *MockLoadBalancerMockRecorder) UpdateWeight(taskListType, request, partition, info any) *gomock.Call

UpdateWeight indicates an expected call of UpdateWeight.

type MockPartitionConfigProvider added in v1.2.15

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

MockPartitionConfigProvider is a mock of PartitionConfigProvider interface.

func NewMockPartitionConfigProvider added in v1.2.15

func NewMockPartitionConfigProvider(ctrl *gomock.Controller) *MockPartitionConfigProvider

NewMockPartitionConfigProvider creates a new mock instance.

func (*MockPartitionConfigProvider) EXPECT added in v1.2.15

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

func (*MockPartitionConfigProvider) GetNumberOfReadPartitions added in v1.2.15

func (m *MockPartitionConfigProvider) GetNumberOfReadPartitions(domainID string, taskList types.TaskList, taskListType int) int

GetNumberOfReadPartitions mocks base method.

func (*MockPartitionConfigProvider) GetNumberOfWritePartitions added in v1.2.15

func (m *MockPartitionConfigProvider) GetNumberOfWritePartitions(domainID string, taskList types.TaskList, taskListType int) int

GetNumberOfWritePartitions mocks base method.

func (*MockPartitionConfigProvider) UpdatePartitionConfig added in v1.2.15

func (m *MockPartitionConfigProvider) UpdatePartitionConfig(domainID string, taskList types.TaskList, taskListType int, config *types.TaskListPartitionConfig)

UpdatePartitionConfig mocks base method.

type MockPartitionConfigProviderMockRecorder added in v1.2.15

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

MockPartitionConfigProviderMockRecorder is the mock recorder for MockPartitionConfigProvider.

func (*MockPartitionConfigProviderMockRecorder) GetNumberOfReadPartitions added in v1.2.15

func (mr *MockPartitionConfigProviderMockRecorder) GetNumberOfReadPartitions(domainID, taskList, taskListType any) *gomock.Call

GetNumberOfReadPartitions indicates an expected call of GetNumberOfReadPartitions.

func (*MockPartitionConfigProviderMockRecorder) GetNumberOfWritePartitions added in v1.2.15

func (mr *MockPartitionConfigProviderMockRecorder) GetNumberOfWritePartitions(domainID, taskList, taskListType any) *gomock.Call

GetNumberOfWritePartitions indicates an expected call of GetNumberOfWritePartitions.

func (*MockPartitionConfigProviderMockRecorder) UpdatePartitionConfig added in v1.2.15

func (mr *MockPartitionConfigProviderMockRecorder) UpdatePartitionConfig(domainID, taskList, taskListType, config any) *gomock.Call

UpdatePartitionConfig indicates an expected call of UpdatePartitionConfig.

type MockPeerResolver added in v1.2.10

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

MockPeerResolver is a mock of PeerResolver interface.

func NewMockPeerResolver added in v1.2.10

func NewMockPeerResolver(ctrl *gomock.Controller) *MockPeerResolver

NewMockPeerResolver creates a new mock instance.

func (*MockPeerResolver) EXPECT added in v1.2.10

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

func (*MockPeerResolver) FromHostAddress added in v1.2.10

func (m *MockPeerResolver) FromHostAddress(hostAddress string) (string, error)

FromHostAddress mocks base method.

func (*MockPeerResolver) FromTaskList added in v1.2.10

func (m *MockPeerResolver) FromTaskList(taskListName string) (string, error)

FromTaskList mocks base method.

func (*MockPeerResolver) GetAllPeers added in v1.2.10

func (m *MockPeerResolver) GetAllPeers() ([]string, error)

GetAllPeers mocks base method.

type MockPeerResolverMockRecorder added in v1.2.10

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

MockPeerResolverMockRecorder is the mock recorder for MockPeerResolver.

func (*MockPeerResolverMockRecorder) FromHostAddress added in v1.2.10

func (mr *MockPeerResolverMockRecorder) FromHostAddress(hostAddress any) *gomock.Call

FromHostAddress indicates an expected call of FromHostAddress.

func (*MockPeerResolverMockRecorder) FromTaskList added in v1.2.10

func (mr *MockPeerResolverMockRecorder) FromTaskList(taskListName any) *gomock.Call

FromTaskList indicates an expected call of FromTaskList.

func (*MockPeerResolverMockRecorder) GetAllPeers added in v1.2.10

func (mr *MockPeerResolverMockRecorder) GetAllPeers() *gomock.Call

GetAllPeers indicates an expected call of GetAllPeers.

type MockReadRequest added in v1.2.15

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

MockReadRequest is a mock of ReadRequest interface.

func NewMockReadRequest added in v1.2.15

func NewMockReadRequest(ctrl *gomock.Controller) *MockReadRequest

NewMockReadRequest creates a new mock instance.

func (*MockReadRequest) EXPECT added in v1.2.15

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

func (*MockReadRequest) GetDomainUUID added in v1.2.15

func (m *MockReadRequest) GetDomainUUID() string

GetDomainUUID mocks base method.

func (*MockReadRequest) GetForwardedFrom added in v1.2.15

func (m *MockReadRequest) GetForwardedFrom() string

GetForwardedFrom mocks base method.

func (*MockReadRequest) GetTaskList added in v1.2.15

func (m *MockReadRequest) GetTaskList() *types.TaskList

GetTaskList mocks base method.

type MockReadRequestMockRecorder added in v1.2.15

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

MockReadRequestMockRecorder is the mock recorder for MockReadRequest.

func (*MockReadRequestMockRecorder) GetDomainUUID added in v1.2.15

func (mr *MockReadRequestMockRecorder) GetDomainUUID() *gomock.Call

GetDomainUUID indicates an expected call of GetDomainUUID.

func (*MockReadRequestMockRecorder) GetForwardedFrom added in v1.2.15

func (mr *MockReadRequestMockRecorder) GetForwardedFrom() *gomock.Call

GetForwardedFrom indicates an expected call of GetForwardedFrom.

func (*MockReadRequestMockRecorder) GetTaskList added in v1.2.15

func (mr *MockReadRequestMockRecorder) GetTaskList() *gomock.Call

GetTaskList indicates an expected call of GetTaskList.

type MockWriteRequest added in v1.2.15

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

MockWriteRequest is a mock of WriteRequest interface.

func NewMockWriteRequest added in v1.2.15

func NewMockWriteRequest(ctrl *gomock.Controller) *MockWriteRequest

NewMockWriteRequest creates a new mock instance.

func (*MockWriteRequest) EXPECT added in v1.2.15

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

func (*MockWriteRequest) GetDomainUUID added in v1.2.15

func (m *MockWriteRequest) GetDomainUUID() string

GetDomainUUID mocks base method.

func (*MockWriteRequest) GetForwardedFrom added in v1.2.15

func (m *MockWriteRequest) GetForwardedFrom() string

GetForwardedFrom mocks base method.

func (*MockWriteRequest) GetPartitionConfig added in v1.2.15

func (m *MockWriteRequest) GetPartitionConfig() map[string]string

GetPartitionConfig mocks base method.

func (*MockWriteRequest) GetTaskList added in v1.2.15

func (m *MockWriteRequest) GetTaskList() *types.TaskList

GetTaskList mocks base method.

type MockWriteRequestMockRecorder added in v1.2.15

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

MockWriteRequestMockRecorder is the mock recorder for MockWriteRequest.

func (*MockWriteRequestMockRecorder) GetDomainUUID added in v1.2.15

func (mr *MockWriteRequestMockRecorder) GetDomainUUID() *gomock.Call

GetDomainUUID indicates an expected call of GetDomainUUID.

func (*MockWriteRequestMockRecorder) GetForwardedFrom added in v1.2.15

func (mr *MockWriteRequestMockRecorder) GetForwardedFrom() *gomock.Call

GetForwardedFrom indicates an expected call of GetForwardedFrom.

func (*MockWriteRequestMockRecorder) GetPartitionConfig added in v1.2.15

func (mr *MockWriteRequestMockRecorder) GetPartitionConfig() *gomock.Call

GetPartitionConfig indicates an expected call of GetPartitionConfig.

func (*MockWriteRequestMockRecorder) GetTaskList added in v1.2.15

func (mr *MockWriteRequestMockRecorder) GetTaskList() *gomock.Call

GetTaskList indicates an expected call of GetTaskList.

type PartitionConfigProvider added in v1.2.15

type PartitionConfigProvider interface {
	// GetNumberOfReadPartitions returns the number of read partitions
	GetNumberOfReadPartitions(domainID string, taskList types.TaskList, taskListType int) int
	// GetNumberOfWritePartitions returns the number of write partitions
	GetNumberOfWritePartitions(domainID string, taskList types.TaskList, taskListType int) int
	// UpdatePartitionConfig updates the partition configuration for a task list
	UpdatePartitionConfig(domainID string, taskList types.TaskList, taskListType int, config *types.TaskListPartitionConfig)
}

PartitionConfigProvider is the interface for implementers of component that provides partition configuration for task list partitions

func NewPartitionConfigProvider added in v1.2.15

func NewPartitionConfigProvider(
	logger log.Logger,
	metricsClient metrics.Client,
	domainIDToName func(string) (string, error),
	dc *dynamicconfig.Collection,
) PartitionConfigProvider

type PeerResolver added in v0.24.0

type PeerResolver interface {
	FromTaskList(taskListName string) (string, error)
	GetAllPeers() ([]string, error)
	FromHostAddress(hostAddress string) (string, error)
}

func NewPeerResolver added in v0.24.0

func NewPeerResolver(membership membership.Resolver, namedPort string) PeerResolver

NewPeerResolver creates a new matching peer resolver.

type ReadRequest added in v1.2.15

type ReadRequest interface {
	GetDomainUUID() string
	GetTaskList() *types.TaskList
	GetForwardedFrom() string
}

ReadRequest is the interface for all types of Poll* requests

type WriteRequest added in v1.2.15

type WriteRequest interface {
	ReadRequest
	GetPartitionConfig() map[string]string
}

WriteRequest is the interface for all types of AddTask* requests

Jump to

Keyboard shortcuts

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