eventlog

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: 21 Imported by: 0

Documentation

Overview

Package eventlog is a generated GoMock package.

Index

Constants

View Source
const (
	StateCreated  = SegmentState("created")
	StateWorking  = SegmentState("working")
	StateFrozen   = SegmentState("frozen")
	StateArchived = SegmentState("archived")
	StateExpired  = SegmentState("expired")
)

Variables

This section is empty.

Functions

func Convert2ProtoSegment

func Convert2ProtoSegment(ctx context.Context, ins ...Segment) []*metapb.Segment

Types

type Manager

type Manager interface {
	Run(ctx context.Context, kvClient kv.Client, startTask bool) error
	Stop()
	AcquireEventlog(ctx context.Context, eventbusID vanus.ID, eventbusName string) (*metadata.Eventlog, error)
	GetEventlog(ctx context.Context, id vanus.ID) *metadata.Eventlog
	DeleteEventlog(ctx context.Context, id vanus.ID)
	GetBlock(id vanus.ID) *metadata.Block
	UpdateSegmentReplicas(ctx context.Context, segID vanus.ID, term uint64) error
	GetEventlogSegmentList(elID vanus.ID) []Segment
	GetAppendableSegment(ctx context.Context, eli *metadata.Eventlog, num int) ([]Segment, error)
	UpdateSegment(ctx context.Context, m map[string][]Segment)
	GetSegmentByBlockID(block *metadata.Block) (Segment, error)
}

func NewManager

func NewManager(volMgr volume.Manager, replicaNum uint, defaultBlockSize int64) Manager

type MockManager

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

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) AcquireEventlog

func (m *MockManager) AcquireEventlog(ctx context.Context, eventbusID vanus.ID, eventbusName string) (*metadata.Eventlog, error)

AcquireEventlog mocks base method.

func (*MockManager) DeleteEventlog

func (m *MockManager) DeleteEventlog(ctx context.Context, id vanus.ID)

DeleteEventlog mocks base method.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

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

func (*MockManager) GetAppendableSegment

func (m *MockManager) GetAppendableSegment(ctx context.Context, eli *metadata.Eventlog, num int) ([]Segment, error)

GetAppendableSegment mocks base method.

func (*MockManager) GetBlock

func (m *MockManager) GetBlock(id vanus.ID) *metadata.Block

GetBlock mocks base method.

func (*MockManager) GetEventlog

func (m *MockManager) GetEventlog(ctx context.Context, id vanus.ID) *metadata.Eventlog

GetEventlog mocks base method.

func (*MockManager) GetEventlogSegmentList

func (m *MockManager) GetEventlogSegmentList(elID vanus.ID) []Segment

GetEventlogSegmentList mocks base method.

func (*MockManager) GetSegmentByBlockID

func (m *MockManager) GetSegmentByBlockID(block *metadata.Block) (Segment, error)

GetSegmentByBlockID mocks base method.

func (*MockManager) Run

func (m *MockManager) Run(ctx context.Context, kvClient kv.Client, startTask bool) error

Run mocks base method.

func (*MockManager) Stop

func (m *MockManager) Stop()

Stop mocks base method.

func (*MockManager) UpdateSegment

func (m_2 *MockManager) UpdateSegment(ctx context.Context, m map[string][]Segment)

UpdateSegment mocks base method.

func (*MockManager) UpdateSegmentReplicas

func (m *MockManager) UpdateSegmentReplicas(ctx context.Context, segID vanus.ID, term uint64) error

UpdateSegmentReplicas mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) AcquireEventlog

func (mr *MockManagerMockRecorder) AcquireEventlog(ctx, eventbusID, eventbusName interface{}) *gomock.Call

AcquireEventlog indicates an expected call of AcquireEventlog.

func (*MockManagerMockRecorder) DeleteEventlog

func (mr *MockManagerMockRecorder) DeleteEventlog(ctx, id interface{}) *gomock.Call

DeleteEventlog indicates an expected call of DeleteEventlog.

func (*MockManagerMockRecorder) GetAppendableSegment

func (mr *MockManagerMockRecorder) GetAppendableSegment(ctx, eli, num interface{}) *gomock.Call

GetAppendableSegment indicates an expected call of GetAppendableSegment.

func (*MockManagerMockRecorder) GetBlock

func (mr *MockManagerMockRecorder) GetBlock(id interface{}) *gomock.Call

GetBlock indicates an expected call of GetBlock.

func (*MockManagerMockRecorder) GetEventlog

func (mr *MockManagerMockRecorder) GetEventlog(ctx, id interface{}) *gomock.Call

GetEventlog indicates an expected call of GetEventlog.

func (*MockManagerMockRecorder) GetEventlogSegmentList

func (mr *MockManagerMockRecorder) GetEventlogSegmentList(elID interface{}) *gomock.Call

GetEventlogSegmentList indicates an expected call of GetEventlogSegmentList.

func (*MockManagerMockRecorder) GetSegmentByBlockID

func (mr *MockManagerMockRecorder) GetSegmentByBlockID(block interface{}) *gomock.Call

GetSegmentByBlockID indicates an expected call of GetSegmentByBlockID.

func (*MockManagerMockRecorder) Run

func (mr *MockManagerMockRecorder) Run(ctx, kvClient, startTask interface{}) *gomock.Call

Run indicates an expected call of Run.

func (*MockManagerMockRecorder) Stop

func (mr *MockManagerMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

func (*MockManagerMockRecorder) UpdateSegment

func (mr *MockManagerMockRecorder) UpdateSegment(ctx, m interface{}) *gomock.Call

UpdateSegment indicates an expected call of UpdateSegment.

func (*MockManagerMockRecorder) UpdateSegmentReplicas

func (mr *MockManagerMockRecorder) UpdateSegmentReplicas(ctx, segID, term interface{}) *gomock.Call

UpdateSegmentReplicas indicates an expected call of UpdateSegmentReplicas.

type ReplicaGroup

type ReplicaGroup struct {
	ID vanus.ID `json:"id"`
	// the id of LeaderBlock
	Leader uint64 `json:"leader"`
	// blockID *metadata.Block
	Peers     map[uint64]*metadata.Block `json:"blocks"`
	Term      uint64                     `json:"term"`
	CreateAt  time.Time                  `json:"create_at"`
	DestroyAt time.Time                  `json:"destroy_at"`
}

type Segment

type Segment struct {
	ID                 vanus.ID      `json:"id,omitempty"`
	Capacity           int64         `json:"capacity,omitempty"`
	EventlogID         vanus.ID      `json:"event_log_id,omitempty"`
	PreviousSegmentID  vanus.ID      `json:"previous_segment_id,omitempty"`
	NextSegmentID      vanus.ID      `json:"next_segment_id,omitempty"`
	StartOffsetInLog   int64         `json:"start_offset_in_log,omitempty"`
	Replicas           *ReplicaGroup `json:"replicas,omitempty"`
	State              SegmentState  `json:"state,omitempty"`
	Size               int64         `json:"size,omitempty"`
	Number             int32         `json:"number,omitempty"`
	FirstEventBornTime time.Time     `json:"first_event_born_time"`
	LastEventBornTime  time.Time     `json:"last_event_born_time"`
}

func (*Segment) Copy

func (seg *Segment) Copy() Segment

func (*Segment) GetLeaderBlock

func (seg *Segment) GetLeaderBlock() *metadata.Block

func (*Segment) IsAppendable

func (seg *Segment) IsAppendable() bool

func (*Segment) String

func (seg *Segment) String() string

type SegmentState

type SegmentState string

Jump to

Keyboard shortcuts

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