Documentation ¶
Overview ¶
Package admin is a generated GoMock package.
Index ¶
- Constants
- type Admin
- func (adm *Admin) Address() string
- func (adm *Admin) Close() (err error)
- func (adm *Admin) HandleHeartbeatTimeout(ctx context.Context, snid types.StorageNodeID)
- func (adm *Admin) HandleReport(ctx context.Context, snm *snpb.StorageNodeMetadataDescriptor)
- func (adm *Admin) Metadata(ctx context.Context) (*varlogpb.MetadataDescriptor, error)deprecated
- func (adm *Admin) Serve() error
- type LogStreamIDGenerator
- type MockReplicaSelector
- type MockReplicaSelectorMockRecorder
- type Option
- func WithAutoUnseal() Option
- func WithClusterID(cid types.ClusterID) Option
- func WithListenAddress(listen string) Option
- func WithLogStreamGCTimeout(logStreamGCTimeout time.Duration) Option
- func WithLogger(logger *zap.Logger) Option
- func WithMetadataRepositoryManager(mrMgr mrmanager.MetadataRepositoryManager) Option
- func WithReplicaSelector(replicaSelector ReplicaSelector) Option
- func WithReplicationFactor(replicationFactor uint) Option
- func WithStatisticsRepository(statsRepos stats.Repository) Option
- func WithStorageNodeManager(snMgr snmanager.StorageNodeManager) Option
- func WithStorageNodeWatcherOptions(opts ...snwatcher.Option) Option
- func WithoutAutoLogStreamSync() Option
- type ReplicaSelector
- type TestMockServer
- type TestServer
- type TopicIDGenerator
Constants ¶
const ( DefaultClusterID = types.ClusterID(1) DefaultListenAddress = "127.0.0.1:9090" DefaultReplicationFactor = 1 DefaultLogStreamGCTimeout = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct {
// contains filtered or unexported fields
}
func New ¶
New creates an Admin. It should be created only once. It returns an error if cluster metadata cannot be fetched.
func (*Admin) HandleHeartbeatTimeout ¶
func (adm *Admin) HandleHeartbeatTimeout(ctx context.Context, snid types.StorageNodeID)
func (*Admin) HandleReport ¶
func (adm *Admin) HandleReport(ctx context.Context, snm *snpb.StorageNodeMetadataDescriptor)
type LogStreamIDGenerator ¶
type LogStreamIDGenerator struct {
// contains filtered or unexported fields
}
LogStreamIDGenerator generates LogStreamID.
func NewLogStreamIDGenerator ¶
func NewLogStreamIDGenerator(ctx context.Context, cmView mrmanager.ClusterMetadataView) (*LogStreamIDGenerator, error)
NewLogStreamIDGenerator creates a LogStreamIDGenerator. Admin should create a single LogStreamIDGenerator to avoid conflict of LogStreamID.
func (*LogStreamIDGenerator) Generate ¶
func (gen *LogStreamIDGenerator) Generate() types.LogStreamID
Generate returns a new LogStreamID. The LogStreamID generated by this method is incremented by one starting from MinLogStreamID, which is 1. Note that the result ID may already exist in the cluster, the caller can call Refresh to reflect the recent metadata, and then call this method again.
type MockReplicaSelector ¶
type MockReplicaSelector struct {
// contains filtered or unexported fields
}
MockReplicaSelector is a mock of ReplicaSelector interface.
func NewMockReplicaSelector ¶
func NewMockReplicaSelector(ctrl *gomock.Controller) *MockReplicaSelector
NewMockReplicaSelector creates a new mock instance.
func (*MockReplicaSelector) EXPECT ¶
func (m *MockReplicaSelector) EXPECT() *MockReplicaSelectorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockReplicaSelector) Select ¶
func (m *MockReplicaSelector) Select(arg0 context.Context) ([]*varlogpb.ReplicaDescriptor, error)
Select mocks base method.
type MockReplicaSelectorMockRecorder ¶
type MockReplicaSelectorMockRecorder struct {
// contains filtered or unexported fields
}
MockReplicaSelectorMockRecorder is the mock recorder for MockReplicaSelector.
func (*MockReplicaSelectorMockRecorder) Select ¶
func (mr *MockReplicaSelectorMockRecorder) Select(arg0 interface{}) *gomock.Call
Select indicates an expected call of Select.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithAutoUnseal ¶
func WithAutoUnseal() Option
func WithClusterID ¶
func WithListenAddress ¶
func WithLogStreamGCTimeout ¶
WithLogStreamGCTimeout sets expiration duration for garbage log streams. To turn off log stream GC, a very large value can be set.
func WithLogger ¶
func WithMetadataRepositoryManager ¶
func WithMetadataRepositoryManager(mrMgr mrmanager.MetadataRepositoryManager) Option
func WithReplicaSelector ¶
func WithReplicaSelector(replicaSelector ReplicaSelector) Option
func WithReplicationFactor ¶
func WithStatisticsRepository ¶
func WithStatisticsRepository(statsRepos stats.Repository) Option
func WithStorageNodeManager ¶
func WithStorageNodeManager(snMgr snmanager.StorageNodeManager) Option
func WithoutAutoLogStreamSync ¶
func WithoutAutoLogStreamSync() Option
WithoutAutoLogStreamSync disables automatic sync job between replicas in the log stream.
type ReplicaSelector ¶
type ReplicaSelector interface {
Select(ctx context.Context) ([]*varlogpb.ReplicaDescriptor, error)
}
ReplicaSelector selects storage nodes and volumes to store data for replicas of a new log stream. This method returns a slice of `varlogpb.ReplicaDescriptor` and its length should be equal to the replication factor.
type TestMockServer ¶ added in v0.3.1
type TestMockServer struct { *vmspb.MockClusterManagerServer // contains filtered or unexported fields }
func TestNewMockServer ¶ added in v0.3.1
func TestNewMockServer(t *testing.T, ctrl *gomock.Controller) *TestMockServer
func (*TestMockServer) Address ¶ added in v0.3.1
func (tms *TestMockServer) Address() string
func (*TestMockServer) Close ¶ added in v0.3.1
func (tms *TestMockServer) Close()
func (*TestMockServer) Run ¶ added in v0.3.1
func (tms *TestMockServer) Run()
type TestServer ¶
type TestServer struct { *Admin // contains filtered or unexported fields }
func TestNewClusterManager ¶
func TestNewClusterManager(t *testing.T, opts ...Option) *TestServer
func (*TestServer) Close ¶
func (ts *TestServer) Close(t *testing.T)
func (*TestServer) Serve ¶
func (ts *TestServer) Serve(t *testing.T)
type TopicIDGenerator ¶
type TopicIDGenerator struct {
// contains filtered or unexported fields
}
TopicIDGenerator generates TopicID.
func NewTopicIDGenerator ¶
func NewTopicIDGenerator(ctx context.Context, cmView mrmanager.ClusterMetadataView) (*TopicIDGenerator, error)
NewTopicIDGenerator creates a TopicIDGenerator. Admin should create a single TopicIDGenerator to avoid conflict of TopicID.
func (*TopicIDGenerator) Generate ¶
func (gen *TopicIDGenerator) Generate() types.TopicID
Generate returns a new TopicID. The TopicID generated by this method is incremented by one starting from MinTopicID, which is 1. Note that the result ID may already exist in the cluster, the caller can call Refresh to reflect the recent metadata, and then call this method again.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mrmanager is a generated GoMock package.
|
Package mrmanager is a generated GoMock package. |
Package snmanager is a generated GoMock package.
|
Package snmanager is a generated GoMock package. |
Package snwatcher is a generated GoMock package.
|
Package snwatcher is a generated GoMock package. |
Package stats is a generated GoMock package.
|
Package stats is a generated GoMock package. |