replicator

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyDomainReplicationTask is the error to indicate empty replication task
	ErrEmptyDomainReplicationTask = &shared.BadRequestError{Message: "empty domain replication task"}
	// ErrInvalidDomainOperation is the error to indicate empty domain operation attribute
	ErrInvalidDomainOperation = &shared.BadRequestError{Message: "invalid domain operation attribute"}
	// ErrInvalidDomainID is the error to indicate empty rID attribute
	ErrInvalidDomainID = &shared.BadRequestError{Message: "invalid domain ID attribute"}
	// ErrInvalidDomainInfo is the error to indicate empty info attribute
	ErrInvalidDomainInfo = &shared.BadRequestError{Message: "invalid domain info attribute"}
	// ErrInvalidDomainConfig is the error to indicate empty config attribute
	ErrInvalidDomainConfig = &shared.BadRequestError{Message: "invalid domain config attribute"}
	// ErrInvalidDomainReplicationConfig is the error to indicate empty replication config attribute
	ErrInvalidDomainReplicationConfig = &shared.BadRequestError{Message: "invalid domain replication config attribute"}
	// ErrInvalidDomainConfigVersion is the error to indicate empty config version attribute
	ErrInvalidDomainConfigVersion = &shared.BadRequestError{Message: "invalid domain config version attribute"}
	// ErrInvalidDomainFailoverVersion is the error to indicate empty failover version attribute
	ErrInvalidDomainFailoverVersion = &shared.BadRequestError{Message: "invalid domain failover version attribute"}
	// ErrInvalidDomainStatus is the error to indicate invalid domain status
	ErrInvalidDomainStatus = &shared.BadRequestError{Message: "invalid domain status attribute"}
	// ErrNameUUIDCollision is the error to indicate domain name / UUID collision
	ErrNameUUIDCollision = &shared.BadRequestError{Message: "domain replication encounter name / UUID collision"}
)
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
	ReplicatorActivityBufferRetryCount dynamicconfig.IntPropertyFn
	ReplicatorHistoryBufferRetryCount  dynamicconfig.IntPropertyFn
	ReplicationTaskMaxRetryCount       dynamicconfig.IntPropertyFn
	ReplicationTaskMaxRetryDuration    dynamicconfig.DurationPropertyFn
}

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