it

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestVMSOptions

func NewTestVMSOptions(opts ...admin.Option) []admin.Option

func WithTestCluster

func WithTestCluster(t *testing.T, opts []Option, f func(env *VarlogCluster)) func()

Types

type Option

type Option func(*config)

func WithClusterID

func WithClusterID(cid types.ClusterID) Option

func WithCollectorName

func WithCollectorName(collector string) Option

func WithCustomizedMetadataRepositoryOptions added in v0.10.0

func WithCustomizedMetadataRepositoryOptions(mrOpts ...metarepos.Option) Option

WithCustomizedMetadataRepositoryOptions sets customized options for the metadata repository. Users can override the implicit metadata repository options the integration testing environment sets.

func WithCustomizedStorageNodeOptions added in v0.10.0

func WithCustomizedStorageNodeOptions(snOpts ...storagenode.Option) Option

WithCustomizedStorageNodeOptions sets customized options for the storage node. Users can override the implicit storage node options the integration testing environment sets.

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMRCount

func WithMRCount(num int) Option

func WithMetadataRepositoryManagerOptions

func WithMetadataRepositoryManagerOptions(opts ...mrmanager.Option) Option

func WithNumberOfClients

func WithNumberOfClients(numCL int) Option

func WithNumberOfLogStreams

func WithNumberOfLogStreams(numLS int) Option

func WithNumberOfStorageNodes

func WithNumberOfStorageNodes(numSN int) Option

func WithNumberOfTopics

func WithNumberOfTopics(numTopic int) Option

func WithPortBase

func WithPortBase(portBase int) Option

func WithReplicationFactor

func WithReplicationFactor(rf int) Option

func WithReporterClientFactory

func WithReporterClientFactory(fac metarepos.ReporterClientFactory) Option

func WithSnapCount

func WithSnapCount(cnt int) Option

func WithVMSOptions

func WithVMSOptions(vmsOpts ...admin.Option) Option

func WithoutVMS

func WithoutVMS() Option

func WithoutWAL

func WithoutWAL() Option

type VarlogCluster

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

func NewVarlogCluster

func NewVarlogCluster(t *testing.T, opts ...Option) *VarlogCluster

NewVarlogCluster creates a new integration testing environment.

The following metadata repository options are set implicitly:

- WithClusterID - WithReplicationFactor - WithRPCAddress - WithRaftAddress - WithReporterClientFactory - WithSnapshotCount - WithRaftTick - WithRaftDirectory - WithPeers - WithRPCTimeout - JoinCluster - WithTelemetryCollectorName - WithTelemetryCollectorEndpoint - WithLogger

The following storage node options are set implicitly:

- WithClusterID - WithStorageNodeID - WithVolumes - WithLogger

func (*VarlogCluster) AddLS

func (clus *VarlogCluster) AddLS(t *testing.T, topicID types.TopicID) types.LogStreamID

func (*VarlogCluster) AddLSIncomplete

func (clus *VarlogCluster) AddLSIncomplete(t *testing.T, topicID types.TopicID) types.LogStreamID

func (*VarlogCluster) AddLSWithoutMR

func (clus *VarlogCluster) AddLSWithoutMR(t *testing.T, topicID types.TopicID) types.LogStreamID

func (*VarlogCluster) AddSN

func (clus *VarlogCluster) AddSN(t *testing.T) types.StorageNodeID

func (*VarlogCluster) AddTopic

func (clus *VarlogCluster) AddTopic(t *testing.T) types.TopicID

func (*VarlogCluster) AppendMR

func (clus *VarlogCluster) AppendMR(t *testing.T)

func (*VarlogCluster) AppendUncommittedLog

func (clus *VarlogCluster) AppendUncommittedLog(t *testing.T, topicID types.TopicID, lsID types.LogStreamID, data []byte)

func (*VarlogCluster) BackupStorageNodeIDOf

func (clus *VarlogCluster) BackupStorageNodeIDOf(t *testing.T, lsID types.LogStreamID) types.StorageNodeID

func (*VarlogCluster) ClientAtIndex

func (clus *VarlogCluster) ClientAtIndex(t *testing.T, idx int) varlog.Log

func (*VarlogCluster) ClientRefresh

func (clus *VarlogCluster) ClientRefresh(t *testing.T)

TODO: Use built-in refreshing mechanism in clients instead of this.

func (*VarlogCluster) Close

func (clus *VarlogCluster) Close(t *testing.T)

Close closes all cluster MRs.

func (*VarlogCluster) CloseMR

func (clus *VarlogCluster) CloseMR(t *testing.T, idx int)

func (*VarlogCluster) CloseMRAllForRestart

func (clus *VarlogCluster) CloseMRAllForRestart(t *testing.T)

func (*VarlogCluster) CloseMRClientAt

func (clus *VarlogCluster) CloseMRClientAt(t *testing.T, idx int)

func (*VarlogCluster) CloseSN

func (clus *VarlogCluster) CloseSN(t *testing.T, snID types.StorageNodeID)

func (*VarlogCluster) CloseSNClientOf

func (clus *VarlogCluster) CloseSNClientOf(t *testing.T, snID types.StorageNodeID)

func (*VarlogCluster) ClusterID

func (clus *VarlogCluster) ClusterID() types.ClusterID

func (*VarlogCluster) CommitWithoutMR

func (clus *VarlogCluster) CommitWithoutMR(t *testing.T, lsID types.LogStreamID,
	committedLLSNOffset types.LLSN, committedGLSNOffset types.GLSN, committedGLSNLen uint64,
	version types.Version, highWatermark types.GLSN)

func (*VarlogCluster) GetMR

func (*VarlogCluster) GetMRByIndex

func (clus *VarlogCluster) GetMRByIndex(t *testing.T, idx int) *metarepos.RaftMetadataRepository

func (*VarlogCluster) GetMetadata

func (clus *VarlogCluster) GetMetadata(t *testing.T) *varlogpb.MetadataDescriptor

func (*VarlogCluster) GetUncommittedLLSNOffset

func (clus *VarlogCluster) GetUncommittedLLSNOffset(t *testing.T, lsID types.LogStreamID) types.LLSN

func (*VarlogCluster) GetVMS

func (clus *VarlogCluster) GetVMS() *admin.Admin

func (*VarlogCluster) GetVMSClient

func (clus *VarlogCluster) GetVMSClient(t *testing.T) varlog.Admin

func (*VarlogCluster) HealthCheckForMR

func (clus *VarlogCluster) HealthCheckForMR(t *testing.T)

func (*VarlogCluster) IndexOfLeaderMR

func (clus *VarlogCluster) IndexOfLeaderMR() int

func (*VarlogCluster) LeaderFail

func (clus *VarlogCluster) LeaderFail(t *testing.T)

func (*VarlogCluster) LogStreamID

func (clus *VarlogCluster) LogStreamID(t *testing.T, topicID types.TopicID, idx int) types.LogStreamID

func (*VarlogCluster) LogStreamIDs

func (clus *VarlogCluster) LogStreamIDs(topicID types.TopicID) []types.LogStreamID

func (*VarlogCluster) Logger

func (clus *VarlogCluster) Logger() *zap.Logger

func (*VarlogCluster) LookupMR

func (clus *VarlogCluster) LookupMR(nodeID types.NodeID) (*metarepos.RaftMetadataRepository, bool)

func (*VarlogCluster) LookupSN

func (clus *VarlogCluster) LookupSN(t *testing.T, snID types.StorageNodeID) *storagenode.StorageNode

func (*VarlogCluster) MRClientAt

func (clus *VarlogCluster) MRClientAt(t *testing.T, idx int) mrc.MetadataRepositoryClient

func (*VarlogCluster) MRManagementClientAt

func (clus *VarlogCluster) MRManagementClientAt(t *testing.T, idx int) mrc.MetadataRepositoryManagementClient

func (*VarlogCluster) MRPeerAtIndex

func (clus *VarlogCluster) MRPeerAtIndex(t *testing.T, idx int) string

func (*VarlogCluster) MRPeers

func (clus *VarlogCluster) MRPeers() []string

func (*VarlogCluster) MRRPCEndpointAtIndex

func (clus *VarlogCluster) MRRPCEndpointAtIndex(t *testing.T, idx int) string

func (*VarlogCluster) MRRPCEndpoints

func (clus *VarlogCluster) MRRPCEndpoints() []string

func (*VarlogCluster) MetadataRepositories

func (clus *VarlogCluster) MetadataRepositories() []*metarepos.RaftMetadataRepository

func (*VarlogCluster) MetadataRepositoryIDAt

func (clus *VarlogCluster) MetadataRepositoryIDAt(t *testing.T, idx int) types.NodeID

func (*VarlogCluster) MetadataRepositoryIDs

func (clus *VarlogCluster) MetadataRepositoryIDs() []types.NodeID

func (*VarlogCluster) NewMRClient

func (clus *VarlogCluster) NewMRClient(t *testing.T, idx int)

func (*VarlogCluster) NewReportCommitterClient

func (clus *VarlogCluster) NewReportCommitterClient(t *testing.T, snID types.StorageNodeID)

func (*VarlogCluster) NewSNClient

func (clus *VarlogCluster) NewSNClient(t *testing.T, snID types.StorageNodeID)

func (*VarlogCluster) NumberOfClients

func (clus *VarlogCluster) NumberOfClients() int

func (*VarlogCluster) NumberOfLogStreams

func (clus *VarlogCluster) NumberOfLogStreams(topicID types.TopicID) int

func (*VarlogCluster) NumberOfMetadataRepositories

func (clus *VarlogCluster) NumberOfMetadataRepositories() int

func (*VarlogCluster) NumberOfStorageNodes

func (clus *VarlogCluster) NumberOfStorageNodes() int

func (*VarlogCluster) PrimaryStorageNodeIDOf

func (clus *VarlogCluster) PrimaryStorageNodeIDOf(t *testing.T, lsID types.LogStreamID) types.StorageNodeID

func (*VarlogCluster) RecoverMR

func (clus *VarlogCluster) RecoverMR(t *testing.T)

func (*VarlogCluster) RecoverSN

func (clus *VarlogCluster) RecoverSN(t *testing.T, snID types.StorageNodeID) *storagenode.StorageNode

FIXME: Extract common codes between AddSN.

func (*VarlogCluster) ReplicasOf

func (clus *VarlogCluster) ReplicasOf(t *testing.T, lsID types.LogStreamID) []varlogpb.ReplicaDescriptor

TODO (jun): non-nullable slice of replica descriptors

func (*VarlogCluster) ReplicationFactor

func (clus *VarlogCluster) ReplicationFactor() int

func (*VarlogCluster) ReportCommitterClientOf

func (clus *VarlogCluster) ReportCommitterClientOf(t *testing.T, snID types.StorageNodeID) reportcommitter.Client

func (*VarlogCluster) RestartMR

func (clus *VarlogCluster) RestartMR(t *testing.T, idx int)

func (*VarlogCluster) RestartVMS added in v0.3.0

func (clus *VarlogCluster) RestartVMS(t *testing.T)

func (*VarlogCluster) SNClientOf

func (*VarlogCluster) Seal added in v0.11.0

func (clus *VarlogCluster) Seal(tpID types.TopicID, lsID types.LogStreamID) (*admpb.SealResponse, error)

func (*VarlogCluster) StartMR

func (clus *VarlogCluster) StartMR(t *testing.T, idx int)

func (*VarlogCluster) StartVMS

func (clus *VarlogCluster) StartVMS(t *testing.T)

func (*VarlogCluster) StorageNodeIDAtIndex

func (clus *VarlogCluster) StorageNodeIDAtIndex(t *testing.T, idx int) types.StorageNodeID

func (*VarlogCluster) StorageNodes

func (clus *VarlogCluster) StorageNodes() map[types.StorageNodeID]*storagenode.StorageNode

func (*VarlogCluster) StorageNodesManagementClients

func (clus *VarlogCluster) StorageNodesManagementClients() map[types.StorageNodeID]client.StorageNodeManagementClient

func (*VarlogCluster) TopicIDs

func (clus *VarlogCluster) TopicIDs() []types.TopicID

func (*VarlogCluster) Unseal added in v0.11.0

func (*VarlogCluster) UnsealWithoutMR

func (clus *VarlogCluster) UnsealWithoutMR(t *testing.T, topicID types.TopicID, logStreamID types.LogStreamID, expectedHighWatermark types.GLSN)

func (*VarlogCluster) UpdateLS

func (clus *VarlogCluster) UpdateLS(t *testing.T, tpID types.TopicID, lsID types.LogStreamID, oldsn, newsn types.StorageNodeID)

func (*VarlogCluster) UpdateLSWithoutMR

func (clus *VarlogCluster) UpdateLSWithoutMR(t *testing.T, topicID types.TopicID, logStreamID types.LogStreamID, storageNodeID types.StorageNodeID, clear bool)

func (*VarlogCluster) WaitCommit

func (clus *VarlogCluster) WaitCommit(t *testing.T, lsID types.LogStreamID, version types.Version)

func (*VarlogCluster) WaitSealed

func (clus *VarlogCluster) WaitSealed(t *testing.T, lsID types.LogStreamID)

Jump to

Keyboard shortcuts

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