sched

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Scope_All scopeType = iota
	Scope_Meta
	Scope_Data
)
View Source
const (
	TurnOffFlushSegmentCmd = iota + sched.CustomizedCmd
	TurnOnFlushSegmentCmd
	TurnOffUpgradeSegmentCmd
	TurnOnUpgradeSegmentCmd
	TurnOnUpgradeSegmentMetaCmd
	TurnOffUpgradeSegmentMetaCmd
)

Variables

View Source
var (
	ErrUnexpectEventType = errors.New("aoe: unexpect event type")
)

Functions

func NewCommitBlkEvent

func NewCommitBlkEvent(ctx *Context, meta *metadata.Block) *commitBlkEvent

func NewCreateBlkEvent

func NewCreateBlkEvent(ctx *Context, tableMeta *metadata.Table, prevBlock *metadata.Block, tableData iface.ITableData) *createBlkEvent

NewCreateBlkEvent creates a logical Block event

func NewFlushBlockIndexEvent

func NewFlushBlockIndexEvent(ctx *Context, host iface.IBlock) *flushBlockIndexEvent

func NewFlushMemBlockEvent

func NewFlushMemBlockEvent(ctx *Context, blk iface.IMutBlock) *flushMemblockEvent

func NewFlushSegEvent

func NewFlushSegEvent(ctx *Context, seg iface.ISegment) *flushSegEvent

func NewFlushSegIndexEvent

func NewFlushSegIndexEvent(ctx *Context, host iface.ISegment) *flushSegIndexEvent

func NewFlushTransientBlockEvent

func NewFlushTransientBlockEvent(ctx *Context, n base.INode, data batch.IBatch, meta *metadata.Block, file *dataio.TransientBlockFile) *flushTransientBlockEvent

func NewInstallBlockEvent

func NewInstallBlockEvent(ctx *Context, meta *metadata.Block, tableData iface.ITableData) *installBlockEvent

func NewMetaEvent

func NewMetaEvent(scope common.ID, scopeAll bool, t sched.EventType, waitable bool) *metaEvent

func NewMetaResourceMgr

func NewMetaResourceMgr(opts *storage.Options, disk, cpu sched.ResourceMgr) *metaResourceMgr

func NewPrecommitBlockEvent

func NewPrecommitBlockEvent(ctx *Context, id common.ID) *precommitBlockEvent

func NewScheduler

func NewScheduler(opts *storage.Options, tables *table.Tables) *scheduler

func NewUninstallTableEvent

func NewUninstallTableEvent(ctx *Context, tableId uint64, tables *table.Tables) *uninstallTableEvent

func NewUpgradeBlkEvent

func NewUpgradeBlkEvent(ctx *Context, meta *metadata.Block, td iface.ITableData) *upgradeBlkEvent

func NewUpgradeSegEvent

func NewUpgradeSegEvent(ctx *Context, old iface.ISegment, td iface.ITableData) *upgradeSegEvent

Types

type BaseEvent

type BaseEvent struct {
	sched.BaseEvent
	Ctx *Context
}

func NewBaseEvent

func NewBaseEvent(impl iops.IOpInternal, t sched.EventType, ctx *Context) *BaseEvent

type CmdMask

type CmdMask = uint64
const (
	FlushSegMask CmdMask = iota
	UpgradeSegMask
	UpgradeSegMetaMask
)

type CommandType

type CommandType = sched.CommandType

type Context

type Context struct {
	// Options of DB
	Opts *storage.Options
	// Callback on event done
	DoneCB ops.OpDoneCB
	// If the event is waitable
	Waitable bool
	// Influence scope
	Scope      *Scope
	Controller *Controller
}

Context is the general context of event.

func (*Context) AddDataScope

func (ctx *Context) AddDataScope()

func (*Context) AddMetaScope

func (ctx *Context) AddMetaScope()

func (*Context) HasAllScope

func (ctx *Context) HasAllScope() bool

func (*Context) HasDataScope

func (ctx *Context) HasDataScope() bool

func (*Context) HasMetaScope

func (ctx *Context) HasMetaScope() bool

func (*Context) RemoveDataScope

func (ctx *Context) RemoveDataScope()

type Controller

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

func NewController

func NewController() *Controller

func (*Controller) IsOn

func (c *Controller) IsOn(mask CmdMask) bool

func (*Controller) UpdateMask

func (c *Controller) UpdateMask(mask CmdMask, on bool)

type EventType

type EventType = sched.EventType
const (
	IOBoundEvent EventType = iota + sched.CustomizedEvent
	CpuBoundEvent
	StatelessEvent
	MetaUpdateEvent
	MemdataUpdateEvent

	PrepareCommitBlockTask
	PrecommitBlkMetaTask
	FlushBlkTask
	FlushTBlkTask
	MetaCreateTableTask
	MetaDropTableTask
	MetaCreateBlkTask
	CommitBlkTask
	FlushTableMetaTask
	FlushInfoMetaTask
	UpgradeBlkTask
	UpgradeSegTask
	FlushSegTask
	FlushIndexTask
)

type MetaEvent

type MetaEvent interface {
	sched.Event
	GetScope() (common.ID, bool)
}

type Scope

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

Scope is the scope of influenced space.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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