idmap

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Max     int `statsd:"max-bucket"`
	Size    int `statsd:"size"`
	AvgScan int `statsd:"avg-scan"` // 平均扫描次数
	// contains filtered or unexported fields
}

type U128IDMap

type U128IDMap struct {
	utils.Closable
	// contains filtered or unexported fields
}

注意:不是线程安全的

func NewU128IDMap

func NewU128IDMap(module string, hashSlots uint32, opts ...stats.OptionStatTags) *U128IDMap

func NewU128IDMapNoStats

func NewU128IDMapNoStats(module string, hashSlots uint32) *U128IDMap

func (*U128IDMap) AddOrGet

func (m *U128IDMap) AddOrGet(key0, key1 uint64, value uint32, overwrite bool) (uint32, bool)

第一个返回值表示value,第二个返回值表示是否进行了Add。若key已存在,指定overwrite=true可覆写value。

func (*U128IDMap) AddOrGetWithSlice

func (m *U128IDMap) AddOrGetWithSlice(key []byte, _ uint32, value uint32, overwrite bool) (uint32, bool)

func (*U128IDMap) Clear

func (m *U128IDMap) Clear()

func (*U128IDMap) Close

func (m *U128IDMap) Close() error

func (*U128IDMap) Get

func (m *U128IDMap) Get(key0, key1 uint64) (uint32, bool)

func (*U128IDMap) GetCollisionChain

func (m *U128IDMap) GetCollisionChain() []byte

func (*U128IDMap) GetCounter

func (m *U128IDMap) GetCounter() interface{}

func (*U128IDMap) GetWithSlice

func (m *U128IDMap) GetWithSlice(key []byte, _ uint32) (uint32, bool)

func (*U128IDMap) ID

func (m *U128IDMap) ID() string

func (*U128IDMap) KeySize

func (m *U128IDMap) KeySize() int

func (*U128IDMap) NoStats

func (m *U128IDMap) NoStats() *U128IDMap

func (*U128IDMap) SetCollisionChainDebugThreshold

func (m *U128IDMap) SetCollisionChainDebugThreshold(t int)

func (*U128IDMap) Size

func (m *U128IDMap) Size() int

func (*U128IDMap) Width

func (m *U128IDMap) Width() int

type UBigIDMap

type UBigIDMap interface {
	AddOrGetWithSlice(key []byte, hash uint32, value uint32, overwrite bool) (uint32, bool)
	GetWithSlice(key []byte, hash uint32) (uint32, bool)

	Size() int
	Width() int
	Clear()
}

Jump to

Keyboard shortcuts

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