segment

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Overview

Package segment is a generated GoMock package.

Package segment is a generated GoMock package.

Package segment is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockReplica

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

MockReplica is a mock of Replica interface.

func NewMockReplica

func NewMockReplica(ctrl *gomock.Controller) *MockReplica

NewMockReplica creates a new mock instance.

func (*MockReplica) Append

func (m *MockReplica) Append(ctx context.Context, entries []block.Entry, cb block.AppendCallback)

Append mocks base method.

func (*MockReplica) Bootstrap

func (m *MockReplica) Bootstrap(ctx context.Context, blocks []block0.Peer) error

Bootstrap mocks base method.

func (*MockReplica) Close

func (m *MockReplica) Close(ctx context.Context) error

Close mocks base method.

func (*MockReplica) Delete

func (m *MockReplica) Delete(ctx context.Context) error

Delete mocks base method.

func (*MockReplica) EXPECT

func (m *MockReplica) EXPECT() *MockReplicaMockRecorder

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

func (*MockReplica) ID

func (m *MockReplica) ID() vanus.ID

ID mocks base method.

func (*MockReplica) IDStr

func (m *MockReplica) IDStr() string

IDStr mocks base method.

func (*MockReplica) Read

func (m *MockReplica) Read(ctx context.Context, seq int64, num int) ([]block.Entry, error)

Read mocks base method.

func (*MockReplica) Seek

func (m *MockReplica) Seek(ctx context.Context, index int64, key block.Entry, flag block.SeekKeyFlag) (int64, error)

Seek mocks base method.

func (*MockReplica) Status

func (m *MockReplica) Status() *meta.SegmentHealthInfo

Status mocks base method.

type MockReplicaMockRecorder

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

MockReplicaMockRecorder is the mock recorder for MockReplica.

func (*MockReplicaMockRecorder) Append

func (mr *MockReplicaMockRecorder) Append(ctx, entries, cb interface{}) *gomock.Call

Append indicates an expected call of Append.

func (*MockReplicaMockRecorder) Bootstrap

func (mr *MockReplicaMockRecorder) Bootstrap(ctx, blocks interface{}) *gomock.Call

Bootstrap indicates an expected call of Bootstrap.

func (*MockReplicaMockRecorder) Close

func (mr *MockReplicaMockRecorder) Close(ctx interface{}) *gomock.Call

Close indicates an expected call of Close.

func (*MockReplicaMockRecorder) Delete

func (mr *MockReplicaMockRecorder) Delete(ctx interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockReplicaMockRecorder) ID

ID indicates an expected call of ID.

func (*MockReplicaMockRecorder) IDStr

func (mr *MockReplicaMockRecorder) IDStr() *gomock.Call

IDStr indicates an expected call of IDStr.

func (*MockReplicaMockRecorder) Read

func (mr *MockReplicaMockRecorder) Read(ctx, seq, num interface{}) *gomock.Call

Read indicates an expected call of Read.

func (*MockReplicaMockRecorder) Seek

func (mr *MockReplicaMockRecorder) Seek(ctx, index, key, flag interface{}) *gomock.Call

Seek indicates an expected call of Seek.

func (*MockReplicaMockRecorder) Status

func (mr *MockReplicaMockRecorder) Status() *gomock.Call

Status indicates an expected call of Status.

type MockServer

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

MockServer is a mock of Server interface.

func NewMockServer

func NewMockServer(ctrl *gomock.Controller) *MockServer

NewMockServer creates a new mock instance.

func (*MockServer) ActivateSegment

func (m *MockServer) ActivateSegment(ctx context.Context, logID, segID vanus.ID, replicas map[vanus.ID]string) error

ActivateSegment mocks base method.

func (*MockServer) AppendToBlock

func (m *MockServer) AppendToBlock(ctx context.Context, id vanus.ID, events []*cloudevents.CloudEvent) ([]int64, error)

AppendToBlock mocks base method.

func (*MockServer) CreateBlock

func (m *MockServer) CreateBlock(ctx context.Context, id vanus.ID, size int64) error

CreateBlock mocks base method.

func (*MockServer) DescribeBlock added in v0.9.0

func (m *MockServer) DescribeBlock(ctx context.Context, id vanus.ID) (*meta.SegmentHealthInfo, error)

DescribeBlock mocks base method.

func (*MockServer) EXPECT

func (m *MockServer) EXPECT() *MockServerMockRecorder

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

func (*MockServer) InactivateSegment

func (m *MockServer) InactivateSegment(ctx context.Context) error

InactivateSegment mocks base method.

func (*MockServer) Initialize

func (m *MockServer) Initialize(arg0 context.Context) error

Initialize mocks base method.

func (*MockServer) LookupOffsetInBlock

func (m *MockServer) LookupOffsetInBlock(ctx context.Context, id vanus.ID, stime int64) (int64, error)

LookupOffsetInBlock mocks base method.

func (*MockServer) ReadFromBlock

func (m *MockServer) ReadFromBlock(ctx context.Context, id vanus.ID, seq int64, num int, pollingTimeout uint32) ([]*cloudevents.CloudEvent, error)

ReadFromBlock mocks base method.

func (*MockServer) RegisterToController

func (m *MockServer) RegisterToController(ctx context.Context) error

RegisterToController mocks base method.

func (*MockServer) RemoveBlock

func (m *MockServer) RemoveBlock(ctx context.Context, id vanus.ID) error

RemoveBlock mocks base method.

func (*MockServer) Serve

func (m *MockServer) Serve(lis net.Listener) error

Serve mocks base method.

func (*MockServer) Start

func (m *MockServer) Start(ctx context.Context) error

Start mocks base method.

func (*MockServer) Status

func (m *MockServer) Status() primitive.ServerState

Status mocks base method.

func (*MockServer) Stop

func (m *MockServer) Stop(ctx context.Context) error

Stop mocks base method.

type MockServerMockRecorder

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

MockServerMockRecorder is the mock recorder for MockServer.

func (*MockServerMockRecorder) ActivateSegment

func (mr *MockServerMockRecorder) ActivateSegment(ctx, logID, segID, replicas interface{}) *gomock.Call

ActivateSegment indicates an expected call of ActivateSegment.

func (*MockServerMockRecorder) AppendToBlock

func (mr *MockServerMockRecorder) AppendToBlock(ctx, id, events interface{}) *gomock.Call

AppendToBlock indicates an expected call of AppendToBlock.

func (*MockServerMockRecorder) CreateBlock

func (mr *MockServerMockRecorder) CreateBlock(ctx, id, size interface{}) *gomock.Call

CreateBlock indicates an expected call of CreateBlock.

func (*MockServerMockRecorder) DescribeBlock added in v0.9.0

func (mr *MockServerMockRecorder) DescribeBlock(ctx, id interface{}) *gomock.Call

DescribeBlock indicates an expected call of DescribeBlock.

func (*MockServerMockRecorder) InactivateSegment

func (mr *MockServerMockRecorder) InactivateSegment(ctx interface{}) *gomock.Call

InactivateSegment indicates an expected call of InactivateSegment.

func (*MockServerMockRecorder) Initialize

func (mr *MockServerMockRecorder) Initialize(arg0 interface{}) *gomock.Call

Initialize indicates an expected call of Initialize.

func (*MockServerMockRecorder) LookupOffsetInBlock

func (mr *MockServerMockRecorder) LookupOffsetInBlock(ctx, id, stime interface{}) *gomock.Call

LookupOffsetInBlock indicates an expected call of LookupOffsetInBlock.

func (*MockServerMockRecorder) ReadFromBlock

func (mr *MockServerMockRecorder) ReadFromBlock(ctx, id, seq, num, pollingTimeout interface{}) *gomock.Call

ReadFromBlock indicates an expected call of ReadFromBlock.

func (*MockServerMockRecorder) RegisterToController

func (mr *MockServerMockRecorder) RegisterToController(ctx interface{}) *gomock.Call

RegisterToController indicates an expected call of RegisterToController.

func (*MockServerMockRecorder) RemoveBlock

func (mr *MockServerMockRecorder) RemoveBlock(ctx, id interface{}) *gomock.Call

RemoveBlock indicates an expected call of RemoveBlock.

func (*MockServerMockRecorder) Serve

func (mr *MockServerMockRecorder) Serve(lis interface{}) *gomock.Call

Serve indicates an expected call of Serve.

func (*MockServerMockRecorder) Start

func (mr *MockServerMockRecorder) Start(ctx interface{}) *gomock.Call

Start indicates an expected call of Start.

func (*MockServerMockRecorder) Status

func (mr *MockServerMockRecorder) Status() *gomock.Call

Status indicates an expected call of Status.

func (*MockServerMockRecorder) Stop

func (mr *MockServerMockRecorder) Stop(ctx interface{}) *gomock.Call

Stop indicates an expected call of Stop.

type MockpollingManager

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

MockpollingManager is a mock of pollingManager interface.

func NewMockpollingManager

func NewMockpollingManager(ctrl *gomock.Controller) *MockpollingManager

NewMockpollingManager creates a new mock instance.

func (*MockpollingManager) Add

func (m *MockpollingManager) Add(ctx context.Context, blockID vanus.ID) <-chan struct{}

Add mocks base method.

func (*MockpollingManager) Destroy

func (m *MockpollingManager) Destroy()

Destroy mocks base method.

func (*MockpollingManager) EXPECT

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

func (*MockpollingManager) NewMessageArrived

func (m *MockpollingManager) NewMessageArrived(blockID vanus.ID)

NewMessageArrived mocks base method.

type MockpollingManagerMockRecorder

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

MockpollingManagerMockRecorder is the mock recorder for MockpollingManager.

func (*MockpollingManagerMockRecorder) Add

func (mr *MockpollingManagerMockRecorder) Add(ctx, blockID interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockpollingManagerMockRecorder) Destroy

Destroy indicates an expected call of Destroy.

func (*MockpollingManagerMockRecorder) NewMessageArrived

func (mr *MockpollingManagerMockRecorder) NewMessageArrived(blockID interface{}) *gomock.Call

NewMessageArrived indicates an expected call of NewMessageArrived.

type Replica

type Replica interface {
	block.Block

	IDStr() string
	Bootstrap(ctx context.Context, blocks []raft.Peer) error
	Close(ctx context.Context) error
	Delete(ctx context.Context) error
	Status() *metapb.SegmentHealthInfo
}

type Server

type Server interface {
	primitive.Initializer

	Serve(lis net.Listener) error
	RegisterToController(ctx context.Context) error
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Status() primitive.ServerState

	CreateBlock(ctx context.Context, id vanus.ID, size int64) error
	RemoveBlock(ctx context.Context, id vanus.ID) error
	DescribeBlock(ctx context.Context, id vanus.ID) (*metapb.SegmentHealthInfo, error)

	ActivateSegment(ctx context.Context, logID vanus.ID, segID vanus.ID, replicas map[vanus.ID]string) error
	InactivateSegment(ctx context.Context) error

	AppendToBlock(ctx context.Context, id vanus.ID, events []*cepb.CloudEvent) ([]int64, error)
	ReadFromBlock(ctx context.Context, id vanus.ID, seq int64, num int, pollingTimeout uint32) ([]*cepb.CloudEvent, error)
	LookupOffsetInBlock(ctx context.Context, id vanus.ID, stime int64) (int64, error)
}

func NewServer

func NewServer(cfg store.Config) Server

Jump to

Keyboard shortcuts

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