replication

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 28 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.

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(
		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(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(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 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 TaskExecutor

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

TaskExecutor is the executor for replication task

func NewTaskExecutor

func NewTaskExecutor(
	sourceCluster string,
	shard shard.Context,
	domainCache cache.DomainCache,
	nDCHistoryResender xdc.NDCHistoryResender,
	historyRereplicator xdc.HistoryRereplicator,
	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,
	consumerConfig *serviceConfig.ReplicationConsumerConfig,
	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