Documentation ¶
Overview ¶
Package stats is a generated GoMock package.
Index ¶
- type LogStreamStat
- func (lss *LogStreamStat) Copy() LogStreamStat
- func (lss *LogStreamStat) Replica(snid types.StorageNodeID) (snpb.LogStreamReplicaMetadataDescriptor, bool)
- func (lss *LogStreamStat) Replicas() map[types.StorageNodeID]snpb.LogStreamReplicaMetadataDescriptor
- func (lss *LogStreamStat) Status() varlogpb.LogStreamStatus
- type MockRepository
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) GetLogStream(arg0 types.LogStreamID) *LogStreamStat
- func (m *MockRepository) GetStorageNode(arg0 types.StorageNodeID) (*admpb.StorageNodeMetadata, bool)
- func (m *MockRepository) ListStorageNodes() map[types.StorageNodeID]*admpb.StorageNodeMetadata
- func (m *MockRepository) RemoveStorageNode(arg0 types.StorageNodeID)
- func (m *MockRepository) Report(arg0 context.Context, arg1 *snpb.StorageNodeMetadataDescriptor, arg2 time.Time)
- func (m *MockRepository) SetLogStreamStatus(arg0 types.LogStreamID, arg1 varlogpb.LogStreamStatus)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) GetLogStream(arg0 interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetStorageNode(arg0 interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) ListStorageNodes() *gomock.Call
- func (mr *MockRepositoryMockRecorder) RemoveStorageNode(arg0 interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Report(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) SetLogStreamStatus(arg0, arg1 interface{}) *gomock.Call
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogStreamStat ¶
type LogStreamStat struct {
// contains filtered or unexported fields
}
LogStreamStat represents the aggregated information of the log stream that is collected by Repository.
func NewLogStreamStat ¶
func NewLogStreamStat(status varlogpb.LogStreamStatus, replicas map[types.StorageNodeID]snpb.LogStreamReplicaMetadataDescriptor) *LogStreamStat
func (*LogStreamStat) Copy ¶
func (lss *LogStreamStat) Copy() LogStreamStat
Copy returns clone of the log stream statistics.
func (*LogStreamStat) Replica ¶
func (lss *LogStreamStat) Replica(snid types.StorageNodeID) (snpb.LogStreamReplicaMetadataDescriptor, bool)
Replica returns the replica stored by the storage node that is identified by the argument snid.
func (*LogStreamStat) Replicas ¶
func (lss *LogStreamStat) Replicas() map[types.StorageNodeID]snpb.LogStreamReplicaMetadataDescriptor
Replicas returns replicas of the log stream.
func (*LogStreamStat) Status ¶
func (lss *LogStreamStat) Status() varlogpb.LogStreamStatus
Status returns status of the log stream.
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface.
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance.
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRepository) GetLogStream ¶
func (m *MockRepository) GetLogStream(arg0 types.LogStreamID) *LogStreamStat
GetLogStream mocks base method.
func (*MockRepository) GetStorageNode ¶
func (m *MockRepository) GetStorageNode(arg0 types.StorageNodeID) (*admpb.StorageNodeMetadata, bool)
GetStorageNode mocks base method.
func (*MockRepository) ListStorageNodes ¶
func (m *MockRepository) ListStorageNodes() map[types.StorageNodeID]*admpb.StorageNodeMetadata
ListStorageNodes mocks base method.
func (*MockRepository) RemoveStorageNode ¶
func (m *MockRepository) RemoveStorageNode(arg0 types.StorageNodeID)
RemoveStorageNode mocks base method.
func (*MockRepository) Report ¶
func (m *MockRepository) Report(arg0 context.Context, arg1 *snpb.StorageNodeMetadataDescriptor, arg2 time.Time)
Report mocks base method.
func (*MockRepository) SetLogStreamStatus ¶
func (m *MockRepository) SetLogStreamStatus(arg0 types.LogStreamID, arg1 varlogpb.LogStreamStatus)
SetLogStreamStatus mocks base method.
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository.
func (*MockRepositoryMockRecorder) GetLogStream ¶
func (mr *MockRepositoryMockRecorder) GetLogStream(arg0 interface{}) *gomock.Call
GetLogStream indicates an expected call of GetLogStream.
func (*MockRepositoryMockRecorder) GetStorageNode ¶
func (mr *MockRepositoryMockRecorder) GetStorageNode(arg0 interface{}) *gomock.Call
GetStorageNode indicates an expected call of GetStorageNode.
func (*MockRepositoryMockRecorder) ListStorageNodes ¶
func (mr *MockRepositoryMockRecorder) ListStorageNodes() *gomock.Call
ListStorageNodes indicates an expected call of ListStorageNodes.
func (*MockRepositoryMockRecorder) RemoveStorageNode ¶
func (mr *MockRepositoryMockRecorder) RemoveStorageNode(arg0 interface{}) *gomock.Call
RemoveStorageNode indicates an expected call of RemoveStorageNode.
func (*MockRepositoryMockRecorder) Report ¶
func (mr *MockRepositoryMockRecorder) Report(arg0, arg1, arg2 interface{}) *gomock.Call
Report indicates an expected call of Report.
func (*MockRepositoryMockRecorder) SetLogStreamStatus ¶
func (mr *MockRepositoryMockRecorder) SetLogStreamStatus(arg0, arg1 interface{}) *gomock.Call
SetLogStreamStatus indicates an expected call of SetLogStreamStatus.
type Repository ¶
type Repository interface { // Report reports metadata of the storage node with timestamp when the // metadata is fetched. It updates the statistics of the storage nodes // and log streams by using the arguments snmd and ts. If a storage // node or log streams are not included in the cluster metadata, they // are ignored. Report(ctx context.Context, snmd *snpb.StorageNodeMetadataDescriptor, ts time.Time) // SetLogStreamStatus sets status of the log stream specified by the // argument lsid. SetLogStreamStatus(lsid types.LogStreamID, status varlogpb.LogStreamStatus) // GetLogStream returns statistics of the log stream specified by the // argument lsid. GetLogStream(lsid types.LogStreamID) *LogStreamStat // GetStorageNode returns a metadata of storage node specified by the // argument snid. The snm result contains the last heartbeat time // collected by the repository. The ok result indicates whether the // metadata is found in the repository. GetStorageNode(snid types.StorageNodeID) (snm *admpb.StorageNodeMetadata, ok bool) // ListStorageNodes returns a map that maps storage node ID to the // metadata for each storage node. ListStorageNodes() map[types.StorageNodeID]*admpb.StorageNodeMetadata // RemoveStorageNode removes the metadata for the storage node // specified by the snid. RemoveStorageNode(snid types.StorageNodeID) }
Repository is a repository to maintain statistics of log streams to manage the cluster.
func NewRepository ¶
func NewRepository(ctx context.Context, cmview mrmanager.ClusterMetadataView) Repository