replicator

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyDomainReplicationTask is the error to indicate empty replication task
	ErrEmptyDomainReplicationTask = errors.New("empty domain replication task")
	// ErrInvalidDomainOperation is the error to indicate empty domain operation attribute
	ErrInvalidDomainOperation = errors.New("invalid domain operation attribute")
	// ErrInvalidDomainID is the error to indicate empty rID attribute
	ErrInvalidDomainID = errors.New("invalid domain ID attribute")
	// ErrInvalidDomainInfo is the error to indicate empty info attribute
	ErrInvalidDomainInfo = errors.New("invalid domain info attribute")
	// ErrInvalidDomainConfig is the error to indicate empty config attribute
	ErrInvalidDomainConfig = errors.New("invalid domain config attribute")
	// ErrInvalidDomainReplicationConfig is the error to indicate empty replication config attribute
	ErrInvalidDomainReplicationConfig = errors.New("invalid domain replication config attribute")
	// ErrInvalidDomainConfigVersion is the error to indicate empty config version attribute
	ErrInvalidDomainConfigVersion = errors.New("invalid domain config version attribute")
	// ErrInvalidDomainFailoverVersion is the error to indicate empty failover version attribute
	ErrInvalidDomainFailoverVersion = errors.New("invalid domain failover version attribute")
	// ErrInvalidDomainStatus is the error to indicate invalid domain status
	ErrInvalidDomainStatus = errors.New("invalid domain status attribute")
)
View Source
var (
	// ErrEmptyReplicationTask is the error to indicate empty replication task
	ErrEmptyReplicationTask = &shared.BadRequestError{Message: "empty replication task"}
	// ErrUnknownReplicationTask is the error to indicate unknown replication task type
	ErrUnknownReplicationTask = &shared.BadRequestError{Message: "unknown replication task"}
	// ErrDeserializeReplicationTask is the error to indicate failure to deserialize replication task
	ErrDeserializeReplicationTask = &shared.BadRequestError{Message: "Failed to deserialize replication task"}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	PersistenceMaxQPS                 dynamicconfig.IntPropertyFn
	ReplicatorMetaTaskConcurrency     dynamicconfig.IntPropertyFn
	ReplicatorTaskConcurrency         dynamicconfig.IntPropertyFn
	ReplicatorMessageConcurrency      dynamicconfig.IntPropertyFn
	ReplicatorHistoryBufferRetryCount dynamicconfig.IntPropertyFn
	ReplicationTaskMaxRetry           dynamicconfig.IntPropertyFn
}

Config contains all the replication config for worker

type DomainReplicator

type DomainReplicator interface {
	HandleReceivingTask(task *replicator.DomainTaskAttributes) error
}

DomainReplicator is the interface which can replicate the domain

func NewDomainReplicator

func NewDomainReplicator(metadataManagerV2 persistence.MetadataManager, logger log.Logger) DomainReplicator

NewDomainReplicator create a new instance odf domain replicator

type MockDomainReplicator added in v0.5.7

type MockDomainReplicator struct {
	mock.Mock
}

MockDomainReplicator is an autogenerated mock type for the DomainReplicator type

func (*MockDomainReplicator) HandleReceivingTask added in v0.5.7

func (_m *MockDomainReplicator) HandleReceivingTask(task *replicator.DomainTaskAttributes) error

HandleReceivingTask provides a mock function with given fields: task

type Replicator

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

Replicator is the processor for replication tasks

func NewReplicator

func NewReplicator(clusterMetadata cluster.Metadata, metadataManagerV2 persistence.MetadataManager,
	domainCache cache.DomainCache, clientBean client.Bean, config *Config,
	client messaging.Client, logger log.Logger, metricsClient metrics.Client) *Replicator

NewReplicator creates a new replicator for processing replication tasks

func (*Replicator) Start

func (r *Replicator) Start() error

Start is called to start replicator

func (*Replicator) Stop

func (r *Replicator) Stop()

Stop is called to stop replicator

Jump to

Keyboard shortcuts

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