scopemgr

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperTypeAllocScope = iota + 1
)

Variables

View Source
var (
	MaxCount = 1000000

	ErrInvalidCount = errors.New("request count is invalid")
)

Functions

This section is empty.

Types

type ScopeMgr

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

func NewScopeMgr

func NewScopeMgr(db *normaldb.NormalDB) (*ScopeMgr, error)

func (*ScopeMgr) Alloc

func (s *ScopeMgr) Alloc(ctx context.Context, name string, count int) (base, new uint64, err error)

func (*ScopeMgr) Apply

func (s *ScopeMgr) Apply(ctx context.Context, operTypes []int32, datas [][]byte, contexts []base.ProposeContext) error

func (*ScopeMgr) Flush

func (s *ScopeMgr) Flush(ctx context.Context) error

nothing to do

func (*ScopeMgr) GetCurrent

func (s *ScopeMgr) GetCurrent(name string) uint64

func (*ScopeMgr) GetModuleName

func (s *ScopeMgr) GetModuleName() string

func (*ScopeMgr) LoadData

func (s *ScopeMgr) LoadData(ctx context.Context) error

func (*ScopeMgr) NotifyLeaderChange

func (s *ScopeMgr) NotifyLeaderChange(ctx context.Context, leader uint64, host string)

nothing to do

func (*ScopeMgr) SetModuleName

func (s *ScopeMgr) SetModuleName(module string)

func (*ScopeMgr) SetRaftServer

func (s *ScopeMgr) SetRaftServer(raftServer raftserver.RaftServer)

type ScopeMgrAPI

type ScopeMgrAPI interface {
	Alloc(ctx context.Context, name string, count int) (base, new uint64, err error)
	GetCurrent(name string) uint64
}

Jump to

Keyboard shortcuts

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