Back to godoc.org

Package cluster

v0.14.1
Latest Go to latest

The latest major version is .

Published: Sep 22, 2020 | License: MIT | Module: github.com/uber/cadence

Overview

Package cluster is a generated GoMock package.

Index

Constants

const (
	// TestCurrentClusterInitialFailoverVersion is initial failover version for current cluster
	TestCurrentClusterInitialFailoverVersion = int64(0)
	// TestAlternativeClusterInitialFailoverVersion is initial failover version for alternative cluster
	TestAlternativeClusterInitialFailoverVersion = int64(1)
	// TestFailoverVersionIncrement is failover version increment used for test
	TestFailoverVersionIncrement = int64(10)
	// TestCurrentClusterName is current cluster used for test
	TestCurrentClusterName = "active"
	// TestAlternativeClusterName is alternative cluster used for test
	TestAlternativeClusterName = "standby"
	// TestCurrentClusterFrontendAddress is the ip port address of current cluster
	TestCurrentClusterFrontendAddress = "127.0.0.1:7104"
	// TestAlternativeClusterFrontendAddress is the ip port address of alternative cluster
	TestAlternativeClusterFrontendAddress = "127.0.0.1:8104"
)

Variables

var (
	// TestAllClusterNames is the all cluster names used for test
	TestAllClusterNames = []string{TestCurrentClusterName, TestAlternativeClusterName}
	// TestAllClusterInfo is the same as above, just convenient for test mocking
	TestAllClusterInfo = map[string]config.ClusterInformation{
		TestCurrentClusterName: config.ClusterInformation{
			Enabled:                true,
			InitialFailoverVersion: TestCurrentClusterInitialFailoverVersion,
			RPCName:                common.FrontendServiceName,
			RPCAddress:             TestCurrentClusterFrontendAddress,
		},
		TestAlternativeClusterName: config.ClusterInformation{
			Enabled:                true,
			InitialFailoverVersion: TestAlternativeClusterInitialFailoverVersion,
			RPCName:                common.FrontendServiceName,
			RPCAddress:             TestAlternativeClusterFrontendAddress,
		},
	}

	// TestSingleDCAllClusterNames is the all cluster names used for test
	TestSingleDCAllClusterNames = []string{TestCurrentClusterName}
	// TestSingleDCClusterInfo is the same as above, just convenient for test mocking
	TestSingleDCClusterInfo = map[string]config.ClusterInformation{
		TestCurrentClusterName: config.ClusterInformation{
			Enabled:                true,
			InitialFailoverVersion: TestCurrentClusterInitialFailoverVersion,
			RPCName:                common.FrontendServiceName,
			RPCAddress:             TestCurrentClusterFrontendAddress,
		},
	}
)

type Metadata

type Metadata interface {
	// IsGlobalDomainEnabled whether the global domain is enabled,
	// this attr should be discarded when cross DC is made public
	IsGlobalDomainEnabled() bool
	// IsMasterCluster whether current cluster is master cluster
	IsMasterCluster() bool
	// GetNextFailoverVersion return the next failover version for domain failover
	GetNextFailoverVersion(string, int64) int64
	// IsVersionFromSameCluster return true if 2 version are used for the same cluster
	IsVersionFromSameCluster(version1 int64, version2 int64) bool
	// GetMasterClusterName return the master cluster name
	GetMasterClusterName() string
	// GetCurrentClusterName return the current cluster name
	GetCurrentClusterName() string
	// GetAllClusterInfo return the all cluster name -> corresponding info
	GetAllClusterInfo() map[string]config.ClusterInformation
	// ClusterNameForFailoverVersion return the corresponding cluster name for a given failover version
	ClusterNameForFailoverVersion(failoverVersion int64) string
	// GetReplicationConsumerConfig returns the config for replication task consumer.
	GetReplicationConsumerConfig() *config.ReplicationConsumerConfig
}

Metadata provides information about clusters

func GetTestClusterMetadata

func GetTestClusterMetadata(enableGlobalDomain bool, isMasterCluster bool) Metadata

GetTestClusterMetadata return an cluster metadata instance, which is initialized

func NewMetadata

func NewMetadata(
	logger log.Logger,
	enableGlobalDomain dynamicconfig.BoolPropertyFn,
	failoverVersionIncrement int64,
	masterClusterName string,
	currentClusterName string,
	clusterInfo map[string]config.ClusterInformation,
	replicationConsumer *config.ReplicationConsumerConfig,
) Metadata

NewMetadata create a new instance of Metadata

type MockMetadata

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

MockMetadata is a mock of Metadata interface

func NewMockMetadata

func NewMockMetadata(ctrl *gomock.Controller) *MockMetadata

NewMockMetadata creates a new mock instance

func (*MockMetadata) ClusterNameForFailoverVersion

func (m *MockMetadata) ClusterNameForFailoverVersion(failoverVersion int64) string

ClusterNameForFailoverVersion mocks base method

func (*MockMetadata) EXPECT

func (m *MockMetadata) EXPECT() *MockMetadataMockRecorder

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

func (*MockMetadata) GetAllClusterInfo

func (m *MockMetadata) GetAllClusterInfo() map[string]config.ClusterInformation

GetAllClusterInfo mocks base method

func (*MockMetadata) GetCurrentClusterName

func (m *MockMetadata) GetCurrentClusterName() string

GetCurrentClusterName mocks base method

func (*MockMetadata) GetMasterClusterName

func (m *MockMetadata) GetMasterClusterName() string

GetMasterClusterName mocks base method

func (*MockMetadata) GetNextFailoverVersion

func (m *MockMetadata) GetNextFailoverVersion(arg0 string, arg1 int64) int64

GetNextFailoverVersion mocks base method

func (*MockMetadata) GetReplicationConsumerConfig

func (m *MockMetadata) GetReplicationConsumerConfig() *config.ReplicationConsumerConfig

GetReplicationConsumerConfig mocks base method

func (*MockMetadata) IsGlobalDomainEnabled

func (m *MockMetadata) IsGlobalDomainEnabled() bool

IsGlobalDomainEnabled mocks base method

func (*MockMetadata) IsMasterCluster

func (m *MockMetadata) IsMasterCluster() bool

IsMasterCluster mocks base method

func (*MockMetadata) IsVersionFromSameCluster

func (m *MockMetadata) IsVersionFromSameCluster(version1, version2 int64) bool

IsVersionFromSameCluster mocks base method

type MockMetadataMockRecorder

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

MockMetadataMockRecorder is the mock recorder for MockMetadata

func (*MockMetadataMockRecorder) ClusterNameForFailoverVersion

func (mr *MockMetadataMockRecorder) ClusterNameForFailoverVersion(failoverVersion interface{}) *gomock.Call

ClusterNameForFailoverVersion indicates an expected call of ClusterNameForFailoverVersion

func (*MockMetadataMockRecorder) GetAllClusterInfo

func (mr *MockMetadataMockRecorder) GetAllClusterInfo() *gomock.Call

GetAllClusterInfo indicates an expected call of GetAllClusterInfo

func (*MockMetadataMockRecorder) GetCurrentClusterName

func (mr *MockMetadataMockRecorder) GetCurrentClusterName() *gomock.Call

GetCurrentClusterName indicates an expected call of GetCurrentClusterName

func (*MockMetadataMockRecorder) GetMasterClusterName

func (mr *MockMetadataMockRecorder) GetMasterClusterName() *gomock.Call

GetMasterClusterName indicates an expected call of GetMasterClusterName

func (*MockMetadataMockRecorder) GetNextFailoverVersion

func (mr *MockMetadataMockRecorder) GetNextFailoverVersion(arg0, arg1 interface{}) *gomock.Call

GetNextFailoverVersion indicates an expected call of GetNextFailoverVersion

func (*MockMetadataMockRecorder) GetReplicationConsumerConfig

func (mr *MockMetadataMockRecorder) GetReplicationConsumerConfig() *gomock.Call

GetReplicationConsumerConfig indicates an expected call of GetReplicationConsumerConfig

func (*MockMetadataMockRecorder) IsGlobalDomainEnabled

func (mr *MockMetadataMockRecorder) IsGlobalDomainEnabled() *gomock.Call

IsGlobalDomainEnabled indicates an expected call of IsGlobalDomainEnabled

func (*MockMetadataMockRecorder) IsMasterCluster

func (mr *MockMetadataMockRecorder) IsMasterCluster() *gomock.Call

IsMasterCluster indicates an expected call of IsMasterCluster

func (*MockMetadataMockRecorder) IsVersionFromSameCluster

func (mr *MockMetadataMockRecorder) IsVersionFromSameCluster(version1, version2 interface{}) *gomock.Call

IsVersionFromSameCluster indicates an expected call of IsVersionFromSameCluster

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier