snmanager

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package snmanager is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStorageNodeManager

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

MockStorageNodeManager is a mock of StorageNodeManager interface.

func NewMockStorageNodeManager

func NewMockStorageNodeManager(ctrl *gomock.Controller) *MockStorageNodeManager

NewMockStorageNodeManager creates a new mock instance.

func (*MockStorageNodeManager) AddLogStream

AddLogStream mocks base method.

func (*MockStorageNodeManager) AddLogStreamReplica

AddLogStreamReplica mocks base method.

func (*MockStorageNodeManager) AddStorageNode

func (m *MockStorageNodeManager) AddStorageNode(arg0 context.Context, arg1 types.StorageNodeID, arg2 string)

AddStorageNode mocks base method.

func (*MockStorageNodeManager) Close

func (m *MockStorageNodeManager) Close() error

Close mocks base method.

func (*MockStorageNodeManager) Contains

func (m *MockStorageNodeManager) Contains(arg0 types.StorageNodeID) bool

Contains mocks base method.

func (*MockStorageNodeManager) ContainsAddress

func (m *MockStorageNodeManager) ContainsAddress(arg0 string) bool

ContainsAddress mocks base method.

func (*MockStorageNodeManager) EXPECT

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

func (*MockStorageNodeManager) GetMetadata

GetMetadata mocks base method.

func (*MockStorageNodeManager) GetMetadataByAddress

GetMetadataByAddress mocks base method.

func (*MockStorageNodeManager) RemoveLogStreamReplica

func (m *MockStorageNodeManager) RemoveLogStreamReplica(arg0 context.Context, arg1 types.StorageNodeID, arg2 types.TopicID, arg3 types.LogStreamID) error

RemoveLogStreamReplica mocks base method.

func (*MockStorageNodeManager) RemoveStorageNode

func (m *MockStorageNodeManager) RemoveStorageNode(arg0 types.StorageNodeID)

RemoveStorageNode mocks base method.

func (*MockStorageNodeManager) Seal

Seal mocks base method.

func (*MockStorageNodeManager) Sync

Sync mocks base method.

func (*MockStorageNodeManager) Trim

Trim mocks base method.

func (*MockStorageNodeManager) Unseal

Unseal mocks base method.

type MockStorageNodeManagerMockRecorder

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

MockStorageNodeManagerMockRecorder is the mock recorder for MockStorageNodeManager.

func (*MockStorageNodeManagerMockRecorder) AddLogStream

func (mr *MockStorageNodeManagerMockRecorder) AddLogStream(arg0, arg1 any) *gomock.Call

AddLogStream indicates an expected call of AddLogStream.

func (*MockStorageNodeManagerMockRecorder) AddLogStreamReplica

func (mr *MockStorageNodeManagerMockRecorder) AddLogStreamReplica(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call

AddLogStreamReplica indicates an expected call of AddLogStreamReplica.

func (*MockStorageNodeManagerMockRecorder) AddStorageNode

func (mr *MockStorageNodeManagerMockRecorder) AddStorageNode(arg0, arg1, arg2 any) *gomock.Call

AddStorageNode indicates an expected call of AddStorageNode.

func (*MockStorageNodeManagerMockRecorder) Close

Close indicates an expected call of Close.

func (*MockStorageNodeManagerMockRecorder) Contains

func (mr *MockStorageNodeManagerMockRecorder) Contains(arg0 any) *gomock.Call

Contains indicates an expected call of Contains.

func (*MockStorageNodeManagerMockRecorder) ContainsAddress

func (mr *MockStorageNodeManagerMockRecorder) ContainsAddress(arg0 any) *gomock.Call

ContainsAddress indicates an expected call of ContainsAddress.

func (*MockStorageNodeManagerMockRecorder) GetMetadata

func (mr *MockStorageNodeManagerMockRecorder) GetMetadata(arg0, arg1 any) *gomock.Call

GetMetadata indicates an expected call of GetMetadata.

func (*MockStorageNodeManagerMockRecorder) GetMetadataByAddress

func (mr *MockStorageNodeManagerMockRecorder) GetMetadataByAddress(arg0, arg1, arg2 any) *gomock.Call

GetMetadataByAddress indicates an expected call of GetMetadataByAddress.

func (*MockStorageNodeManagerMockRecorder) RemoveLogStreamReplica

func (mr *MockStorageNodeManagerMockRecorder) RemoveLogStreamReplica(arg0, arg1, arg2, arg3 any) *gomock.Call

RemoveLogStreamReplica indicates an expected call of RemoveLogStreamReplica.

func (*MockStorageNodeManagerMockRecorder) RemoveStorageNode

func (mr *MockStorageNodeManagerMockRecorder) RemoveStorageNode(arg0 any) *gomock.Call

RemoveStorageNode indicates an expected call of RemoveStorageNode.

func (*MockStorageNodeManagerMockRecorder) Seal

func (mr *MockStorageNodeManagerMockRecorder) Seal(arg0, arg1, arg2, arg3 any) *gomock.Call

Seal indicates an expected call of Seal.

func (*MockStorageNodeManagerMockRecorder) Sync

func (mr *MockStorageNodeManagerMockRecorder) Sync(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call

Sync indicates an expected call of Sync.

func (*MockStorageNodeManagerMockRecorder) Trim

func (mr *MockStorageNodeManagerMockRecorder) Trim(arg0, arg1, arg2 any) *gomock.Call

Trim indicates an expected call of Trim.

func (*MockStorageNodeManagerMockRecorder) Unseal

func (mr *MockStorageNodeManagerMockRecorder) Unseal(arg0, arg1, arg2 any) *gomock.Call

Unseal indicates an expected call of Unseal.

type Option

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

func WithClusterID

func WithClusterID(cid types.ClusterID) Option

func WithClusterMetadataView

func WithClusterMetadataView(cmview mrmanager.ClusterMetadataView) Option

func WithDefaultGRPCDialOptions added in v0.21.0

func WithDefaultGRPCDialOptions(defaultGRPCDialOpts ...grpc.DialOption) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

type StorageNodeManager

type StorageNodeManager interface {
	Contains(storageNodeID types.StorageNodeID) bool

	ContainsAddress(addr string) bool

	GetMetadataByAddress(ctx context.Context, snid types.StorageNodeID, addr string) (*snpb.StorageNodeMetadataDescriptor, error)

	// GetMetadata returns metadata for the storage node identified by the argument snid.
	GetMetadata(ctx context.Context, snid types.StorageNodeID) (*snpb.StorageNodeMetadataDescriptor, error)

	// AddStorageNode adds the storage node to the manager.
	// The new storage node should be registered to the metadata repository first.
	// It is idempotent - already registered one also can be passed by this method.
	// Note that this method cannot guarantee that the manager maintains the storage node immediately. However, the storage node is eventually managed since it is registered to the metadata repository.
	AddStorageNode(ctx context.Context, snid types.StorageNodeID, addr string)

	// RemoveStorageNode unregisters the storage node identified by the argument snid.
	RemoveStorageNode(snid types.StorageNodeID)

	// AddLogStream adds a new log stream to storage nodes.
	AddLogStream(ctx context.Context, lsd *varlogpb.LogStreamDescriptor) (*varlogpb.LogStreamDescriptor, error)

	// AddLogStreamReplica adds a new log stream replica to the storage node whose ID is the argument snid.
	// The new log stream replica is identified by the argument tpid and lsid. The argument path is storage node path, for example `/data/cid_1_snid_1`.
	AddLogStreamReplica(ctx context.Context, snid types.StorageNodeID, tpid types.TopicID, lsid types.LogStreamID, path string) (snpb.LogStreamReplicaMetadataDescriptor, error)

	RemoveLogStreamReplica(ctx context.Context, snid types.StorageNodeID, tpid types.TopicID, lsid types.LogStreamID) error

	// Seal seals logstream replicas of storage nodes corresponded with the logStreamID. It
	// passes the last committed GLSN to the logstream replicas.
	Seal(ctx context.Context, topicID types.TopicID, logStreamID types.LogStreamID, lastCommittedGLSN types.GLSN) ([]snpb.LogStreamReplicaMetadataDescriptor, error)

	Sync(ctx context.Context, topicID types.TopicID, logStreamID types.LogStreamID, srcID, dstID types.StorageNodeID, lastGLSN types.GLSN) (*snpb.SyncStatus, error)

	Unseal(ctx context.Context, topicID types.TopicID, logStreamID types.LogStreamID) error

	Trim(ctx context.Context, topicID types.TopicID, lastGLSN types.GLSN) ([]admpb.TrimResult, error)

	Close() error
}

func New

func New(ctx context.Context, opts ...Option) (StorageNodeManager, error)

Jump to

Keyboard shortcuts

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