replication

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 41 Imported by: 0

Documentation

Overview

Package replication is a generated GoMock package.

Package replication is a generated GoMock package.

Package replication is a generated GoMock package.

Package replication is a generated GoMock package.

Package replication is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknownReplicationTask is the error to indicate unknown replication task type
	ErrUnknownReplicationTask = serviceerror.NewInvalidArgument("unknown replication task")
)

Functions

func NewTaskProcessorManager

func NewTaskProcessorManager(
	config *configs.Config,
	shard shard.Context,
	engine shard.Engine,
	workflowCache workflow.Cache,
	workflowDeleteManager workflow.DeleteManager,
	clientBean client.Bean,
	eventSerializer serialization.Serializer,
	replicationTaskFetcherFactory TaskFetcherFactory,
	taskExecutorProvider TaskExecutorProvider,
) *taskProcessorManagerImpl

Types

type AckManager

type AckManager interface {
	NotifyNewTasks(tasks []tasks.Task)
	GetMaxTaskInfo() (int64, time.Time)
	GetTasks(ctx context.Context, pollingCluster string, queryMessageID int64) (*replicationspb.ReplicationMessages, error)
	GetTask(ctx context.Context, taskInfo *replicationspb.ReplicationTaskInfo) (*replicationspb.ReplicationTask, error)
}

func NewAckManager

func NewAckManager(
	shard shard.Context,
	workflowCache workflow.Cache,
	executionMgr persistence.ExecutionManager,
	logger log.Logger,
) AckManager

type DLQHandler

type DLQHandler interface {
	GetMessages(
		ctx context.Context,
		sourceCluster string,
		lastMessageID int64,
		pageSize int,
		pageToken []byte,
	) ([]*replicationspb.ReplicationTask, []byte, error)
	PurgeMessages(
		ctx context.Context,
		sourceCluster string,
		lastMessageID int64,
	) error
	MergeMessages(
		ctx context.Context,
		sourceCluster string,
		lastMessageID int64,
		pageSize int,
		pageToken []byte,
	) ([]byte, error)
}

DLQHandler is the interface handles replication DLQ messages

func NewLazyDLQHandler

func NewLazyDLQHandler(
	shard shard.Context,
	deleteManager workflow.DeleteManager,
	workflowCache workflow.Cache,
	clientBean client.Bean,
	taskExecutorProvider TaskExecutorProvider,
) DLQHandler

type MockAckManager

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

MockAckManager is a mock of AckManager interface.

func NewMockAckManager

func NewMockAckManager(ctrl *gomock.Controller) *MockAckManager

NewMockAckManager creates a new mock instance.

func (*MockAckManager) EXPECT

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

func (*MockAckManager) GetMaxTaskInfo added in v1.17.2

func (m *MockAckManager) GetMaxTaskInfo() (int64, time.Time)

GetMaxTaskInfo mocks base method.

func (*MockAckManager) GetTask

GetTask mocks base method.

func (*MockAckManager) GetTasks

func (m *MockAckManager) GetTasks(ctx context.Context, pollingCluster string, queryMessageID int64) (*repication.ReplicationMessages, error)

GetTasks mocks base method.

func (*MockAckManager) NotifyNewTasks

func (m *MockAckManager) NotifyNewTasks(tasks []tasks.Task)

NotifyNewTasks mocks base method.

type MockAckManagerMockRecorder

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

MockAckManagerMockRecorder is the mock recorder for MockAckManager.

func (*MockAckManagerMockRecorder) GetMaxTaskInfo added in v1.17.2

func (mr *MockAckManagerMockRecorder) GetMaxTaskInfo() *gomock.Call

GetMaxTaskInfo indicates an expected call of GetMaxTaskInfo.

func (*MockAckManagerMockRecorder) GetTask

func (mr *MockAckManagerMockRecorder) GetTask(ctx, taskInfo interface{}) *gomock.Call

GetTask indicates an expected call of GetTask.

func (*MockAckManagerMockRecorder) GetTasks

func (mr *MockAckManagerMockRecorder) GetTasks(ctx, pollingCluster, queryMessageID interface{}) *gomock.Call

GetTasks indicates an expected call of GetTasks.

func (*MockAckManagerMockRecorder) NotifyNewTasks

func (mr *MockAckManagerMockRecorder) NotifyNewTasks(tasks interface{}) *gomock.Call

NotifyNewTasks indicates an expected call of NotifyNewTasks.

type MockDLQHandler

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

MockDLQHandler is a mock of DLQHandler interface.

func NewMockDLQHandler

func NewMockDLQHandler(ctrl *gomock.Controller) *MockDLQHandler

NewMockDLQHandler creates a new mock instance.

func (*MockDLQHandler) EXPECT

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

func (*MockDLQHandler) GetMessages

func (m *MockDLQHandler) GetMessages(ctx context.Context, sourceCluster string, lastMessageID int64, pageSize int, pageToken []byte) ([]*repication.ReplicationTask, []byte, error)

GetMessages mocks base method.

func (*MockDLQHandler) MergeMessages

func (m *MockDLQHandler) MergeMessages(ctx context.Context, sourceCluster string, lastMessageID int64, pageSize int, pageToken []byte) ([]byte, error)

MergeMessages mocks base method.

func (*MockDLQHandler) PurgeMessages

func (m *MockDLQHandler) PurgeMessages(ctx context.Context, sourceCluster string, lastMessageID int64) error

PurgeMessages mocks base method.

type MockDLQHandlerMockRecorder

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

MockDLQHandlerMockRecorder is the mock recorder for MockDLQHandler.

func (*MockDLQHandlerMockRecorder) GetMessages

func (mr *MockDLQHandlerMockRecorder) GetMessages(ctx, sourceCluster, lastMessageID, pageSize, pageToken interface{}) *gomock.Call

GetMessages indicates an expected call of GetMessages.

func (*MockDLQHandlerMockRecorder) MergeMessages

func (mr *MockDLQHandlerMockRecorder) MergeMessages(ctx, sourceCluster, lastMessageID, pageSize, pageToken interface{}) *gomock.Call

MergeMessages indicates an expected call of MergeMessages.

func (*MockDLQHandlerMockRecorder) PurgeMessages

func (mr *MockDLQHandlerMockRecorder) PurgeMessages(ctx, sourceCluster, lastMessageID interface{}) *gomock.Call

PurgeMessages indicates an expected call of PurgeMessages.

type MockTaskExecutor

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

MockTaskExecutor is a mock of TaskExecutor interface.

func NewMockTaskExecutor

func NewMockTaskExecutor(ctrl *gomock.Controller) *MockTaskExecutor

NewMockTaskExecutor creates a new mock instance.

func (*MockTaskExecutor) EXPECT

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

func (*MockTaskExecutor) Execute

func (m *MockTaskExecutor) Execute(ctx context.Context, replicationTask *repication.ReplicationTask, forceApply bool) (int, error)

Execute mocks base method.

type MockTaskExecutorMockRecorder

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

MockTaskExecutorMockRecorder is the mock recorder for MockTaskExecutor.

func (*MockTaskExecutorMockRecorder) Execute

func (mr *MockTaskExecutorMockRecorder) Execute(ctx, replicationTask, forceApply interface{}) *gomock.Call

Execute indicates an expected call of Execute.

type MockTaskFetcherFactory

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

MockTaskFetcherFactory is a mock of TaskFetcherFactory interface.

func NewMockTaskFetcherFactory

func NewMockTaskFetcherFactory(ctrl *gomock.Controller) *MockTaskFetcherFactory

NewMockTaskFetcherFactory creates a new mock instance.

func (*MockTaskFetcherFactory) EXPECT

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

func (*MockTaskFetcherFactory) GetOrCreateFetcher

func (m *MockTaskFetcherFactory) GetOrCreateFetcher(clusterName string) taskFetcher

GetOrCreateFetcher mocks base method.

func (*MockTaskFetcherFactory) Start

func (m *MockTaskFetcherFactory) Start()

Start mocks base method.

func (*MockTaskFetcherFactory) Stop

func (m *MockTaskFetcherFactory) Stop()

Stop mocks base method.

type MockTaskFetcherFactoryMockRecorder

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

MockTaskFetcherFactoryMockRecorder is the mock recorder for MockTaskFetcherFactory.

func (*MockTaskFetcherFactoryMockRecorder) GetOrCreateFetcher

func (mr *MockTaskFetcherFactoryMockRecorder) GetOrCreateFetcher(clusterName interface{}) *gomock.Call

GetOrCreateFetcher indicates an expected call of GetOrCreateFetcher.

func (*MockTaskFetcherFactoryMockRecorder) Start

Start indicates an expected call of Start.

func (*MockTaskFetcherFactoryMockRecorder) Stop

Stop indicates an expected call of Stop.

type MockTaskProcessor

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

MockTaskProcessor is a mock of TaskProcessor interface.

func NewMockTaskProcessor

func NewMockTaskProcessor(ctrl *gomock.Controller) *MockTaskProcessor

NewMockTaskProcessor creates a new mock instance.

func (*MockTaskProcessor) EXPECT

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

func (*MockTaskProcessor) Start

func (m *MockTaskProcessor) Start()

Start mocks base method.

func (*MockTaskProcessor) Stop

func (m *MockTaskProcessor) Stop()

Stop mocks base method.

type MockTaskProcessorMockRecorder

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

MockTaskProcessorMockRecorder is the mock recorder for MockTaskProcessor.

func (*MockTaskProcessorMockRecorder) Start

Start indicates an expected call of Start.

func (*MockTaskProcessorMockRecorder) Stop

Stop indicates an expected call of Stop.

type MocktaskFetcher

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

MocktaskFetcher is a mock of taskFetcher interface.

func NewMocktaskFetcher

func NewMocktaskFetcher(ctrl *gomock.Controller) *MocktaskFetcher

NewMocktaskFetcher creates a new mock instance.

func (*MocktaskFetcher) EXPECT

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

func (*MocktaskFetcher) Start

func (m *MocktaskFetcher) Start()

Start mocks base method.

func (*MocktaskFetcher) Stop

func (m *MocktaskFetcher) Stop()

Stop mocks base method.

type MocktaskFetcherMockRecorder

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

MocktaskFetcherMockRecorder is the mock recorder for MocktaskFetcher.

func (*MocktaskFetcherMockRecorder) Start

Start indicates an expected call of Start.

func (*MocktaskFetcherMockRecorder) Stop

Stop indicates an expected call of Stop.

type TaskExecutor

type TaskExecutor interface {
	Execute(ctx context.Context, replicationTask *replicationspb.ReplicationTask, forceApply bool) (int, error)
}

func NewTaskExecutor

func NewTaskExecutor(
	remoteCluster string,
	shard shard.Context,
	nDCHistoryResender xdc.NDCHistoryResender,
	historyEngine shard.Engine,
	deleteManager workflow.DeleteManager,
	workflowCache workflow.Cache,
) TaskExecutor

NewTaskExecutor creates a replication task executor The executor uses by 1) DLQ replication task handler 2) history replication task processor

type TaskExecutorParams

type TaskExecutorParams struct {
	RemoteCluster   string // TODO: Remove this remote cluster from executor then it can use singleton.
	Shard           shard.Context
	HistoryResender xdc.NDCHistoryResender
	HistoryEngine   shard.Engine
	DeleteManager   workflow.DeleteManager
	WorkflowCache   workflow.Cache
}

type TaskExecutorProvider

type TaskExecutorProvider func(params TaskExecutorParams) TaskExecutor

func ReplicationTaskExecutorProvider

func ReplicationTaskExecutorProvider() TaskExecutorProvider

type TaskFetcherFactory

type TaskFetcherFactory interface {
	common.Daemon

	GetOrCreateFetcher(clusterName string) taskFetcher
}

TaskFetcherFactory is a group of fetchers, one per source DC.

func NewTaskFetcherFactory

func NewTaskFetcherFactory(
	logger log.Logger,
	config *configs.Config,
	clusterMetadata cluster.Metadata,
	clientBean client.Bean,
) TaskFetcherFactory

NewTaskFetcherFactory creates an instance of TaskFetcherFactory with given configs.

func ReplicationTaskFetcherFactoryProvider

func ReplicationTaskFetcherFactoryProvider(
	logger log.Logger,
	config *configs.Config,
	clusterMetadata cluster.Metadata,
	clientBean client.Bean,
) TaskFetcherFactory

type TaskProcessor

type TaskProcessor interface {
	common.Daemon
}

TaskProcessor is the interface for task processor

func NewTaskProcessor

func NewTaskProcessor(
	shard shard.Context,
	historyEngine shard.Engine,
	config *configs.Config,
	metricsClient metrics.Client,
	replicationTaskFetcher taskFetcher,
	replicationTaskExecutor TaskExecutor,
	eventSerializer serialization.Serializer,
) TaskProcessor

NewTaskProcessor creates a new replication task processor.

Jump to

Keyboard shortcuts

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