replication

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 32 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 = &shared.BadRequestError{Message: "unknown replication task"}
)

Functions

This section is empty.

Types

type DLQHandler

type DLQHandler interface {
	ReadMessages(
		ctx context.Context,
		sourceCluster string,
		lastMessageID int64,
		pageSize int,
		pageToken []byte,
	) ([]*replicator.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 NewDLQHandler

func NewDLQHandler(
	shard shard.Context,
	taskExecutors map[string]TaskExecutor,
) DLQHandler

NewDLQHandler initialize the replication message DLQ handler

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) 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

func (*MockDLQHandler) ReadMessages

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

ReadMessages mocks base method

type MockDLQHandlerMockRecorder

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

MockDLQHandlerMockRecorder is the mock recorder for MockDLQHandler

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

func (*MockDLQHandlerMockRecorder) ReadMessages

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

ReadMessages indicates an expected call of ReadMessages

type MockTaskAckManager added in v0.15.0

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

MockTaskAckManager is a mock of TaskAckManager interface

func NewMockTaskAckManager added in v0.15.0

func NewMockTaskAckManager(ctrl *gomock.Controller) *MockTaskAckManager

NewMockTaskAckManager creates a new mock instance

func (*MockTaskAckManager) EXPECT added in v0.15.0

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

func (*MockTaskAckManager) GetTask added in v0.15.0

GetTask mocks base method

func (*MockTaskAckManager) GetTasks added in v0.15.0

func (m *MockTaskAckManager) GetTasks(ctx context.Context, pollingCluster string, lastReadTaskID int64) (*replicator.ReplicationMessages, error)

GetTasks mocks base method

type MockTaskAckManagerMockRecorder added in v0.15.0

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

MockTaskAckManagerMockRecorder is the mock recorder for MockTaskAckManager

func (*MockTaskAckManagerMockRecorder) GetTask added in v0.15.0

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

GetTask indicates an expected call of GetTask

func (*MockTaskAckManagerMockRecorder) GetTasks added in v0.15.0

func (mr *MockTaskAckManagerMockRecorder) GetTasks(ctx, pollingCluster, lastReadTaskID interface{}) *gomock.Call

GetTasks indicates an expected call of GetTasks

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

type MockTaskExecutorMockRecorder

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

MockTaskExecutorMockRecorder is the mock recorder for MockTaskExecutor

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) GetRateLimiter added in v0.14.0

func (m *MockTaskFetcher) GetRateLimiter() *quotas.DynamicRateLimiter

GetRateLimiter mocks base method

func (*MockTaskFetcher) GetRequestChan

func (m *MockTaskFetcher) GetRequestChan() chan<- *request

GetRequestChan mocks base method

func (*MockTaskFetcher) GetSourceCluster

func (m *MockTaskFetcher) GetSourceCluster() string

GetSourceCluster mocks base method

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) GetRateLimiter added in v0.14.0

func (mr *MockTaskFetcherMockRecorder) GetRateLimiter() *gomock.Call

GetRateLimiter indicates an expected call of GetRateLimiter

func (*MockTaskFetcherMockRecorder) GetRequestChan

func (mr *MockTaskFetcherMockRecorder) GetRequestChan() *gomock.Call

GetRequestChan indicates an expected call of GetRequestChan

func (*MockTaskFetcherMockRecorder) GetSourceCluster

func (mr *MockTaskFetcherMockRecorder) GetSourceCluster() *gomock.Call

GetSourceCluster indicates an expected call of GetSourceCluster

func (*MockTaskFetcherMockRecorder) Start

Start indicates an expected call of Start

func (*MockTaskFetcherMockRecorder) Stop

Stop indicates an expected call of Stop

type MockTaskFetchers

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

MockTaskFetchers is a mock of TaskFetchers interface

func NewMockTaskFetchers

func NewMockTaskFetchers(ctrl *gomock.Controller) *MockTaskFetchers

NewMockTaskFetchers creates a new mock instance

func (*MockTaskFetchers) EXPECT

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

func (*MockTaskFetchers) GetFetchers

func (m *MockTaskFetchers) GetFetchers() []TaskFetcher

GetFetchers mocks base method

func (*MockTaskFetchers) Start

func (m *MockTaskFetchers) Start()

Start mocks base method

func (*MockTaskFetchers) Stop

func (m *MockTaskFetchers) Stop()

Stop mocks base method

type MockTaskFetchersMockRecorder

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

MockTaskFetchersMockRecorder is the mock recorder for MockTaskFetchers

func (*MockTaskFetchersMockRecorder) GetFetchers

func (mr *MockTaskFetchersMockRecorder) GetFetchers() *gomock.Call

GetFetchers indicates an expected call of GetFetchers

func (*MockTaskFetchersMockRecorder) Start

Start indicates an expected call of Start

func (*MockTaskFetchersMockRecorder) 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 TaskAckManager added in v0.15.0

type TaskAckManager interface {
	GetTask(
		ctx ctx.Context,
		taskInfo *replicator.ReplicationTaskInfo,
	) (*replicator.ReplicationTask, error)

	GetTasks(
		ctx ctx.Context,
		pollingCluster string,
		lastReadTaskID int64,
	) (*replicator.ReplicationMessages, error)
}

TaskAckManager is the ack manager for replication tasks

func NewTaskAckManager added in v0.15.0

func NewTaskAckManager(
	shard shard.Context,
	executionCache *exec.Cache,
) TaskAckManager

NewTaskAckManager initializes a new replication task ack manager

type TaskExecutor

type TaskExecutor interface {
	// contains filtered or unexported methods
}

TaskExecutor is the executor for replication task

func NewTaskExecutor

func NewTaskExecutor(
	shard shard.Context,
	domainCache cache.DomainCache,
	historyResender ndc.HistoryResender,
	historyEngine engine.Engine,
	metricsClient metrics.Client,
	logger log.Logger,
) TaskExecutor

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

type TaskFetcher

type TaskFetcher interface {
	common.Daemon

	GetSourceCluster() string
	GetRequestChan() chan<- *request
	GetRateLimiter() *quotas.DynamicRateLimiter
}

TaskFetcher is responsible for fetching replication messages from remote DC.

type TaskFetchers

type TaskFetchers interface {
	common.Daemon

	GetFetchers() []TaskFetcher
}

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

func NewTaskFetchers

func NewTaskFetchers(
	logger log.Logger,
	config *config.Config,
	clusterMetadata cluster.Metadata,
	clientBean client.Bean,
) TaskFetchers

NewTaskFetchers creates an instance of ReplicationTaskFetchers with given configs.

type TaskProcessor

type TaskProcessor interface {
	common.Daemon
}

TaskProcessor is responsible for processing replication tasks for a shard.

func NewTaskProcessor

func NewTaskProcessor(
	shard shard.Context,
	historyEngine engine.Engine,
	config *config.Config,
	metricsClient metrics.Client,
	taskFetcher TaskFetcher,
	taskExecutor TaskExecutor,
) 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