lfu

package
v1.1.0-beta.0...-2761fe0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LFU

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

LFU is a LFU based on the ristretto.Cache

func NewLFU

func NewLFU(totalMemCost int64) (*LFU, error)

NewLFU creates a new LFU cache.

func (*LFU) Clear

func (s *LFU) Clear()

Clear implements statsCacheInner

func (*LFU) Close

func (s *LFU) Close()

Close implements statsCacheInner

func (*LFU) Copy

func (s *LFU) Copy() internal.StatsCacheInner

Copy implements statsCacheInner

func (*LFU) Cost

func (s *LFU) Cost() int64

Cost implements statsCacheInner

func (*LFU) Del

func (s *LFU) Del(tblID int64)

Del implements statsCacheInner

func (*LFU) Get

func (s *LFU) Get(tid int64) (*statistics.Table, bool)

Get implements statsCacheInner

func (*LFU) Len

func (s *LFU) Len() int

Len implements statsCacheInner

func (*LFU) Put

func (s *LFU) Put(tblID int64, tbl *statistics.Table) bool

Put implements statsCacheInner

func (*LFU) SetCapacity

func (s *LFU) SetCapacity(maxCost int64)

SetCapacity implements statsCacheInner

func (*LFU) Values

func (s *LFU) Values() []*statistics.Table

Values implements statsCacheInner

Jump to

Keyboard shortcuts

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