cache

package
v2.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncCache

type SyncCache struct {
	RuleID string
	OpID   string

	CacheLength int // readonly, for metrics only to save calculation
	// contains filtered or unexported fields
}

func NewSyncCache

func NewSyncCache(ctx api.StreamContext, cacheConf *conf.SinkConf) (*SyncCache, error)

func (*SyncCache) AddCache

func (c *SyncCache) AddCache(ctx api.StreamContext, item any) error

AddCache not thread safe!

func (*SyncCache) Flush

func (c *SyncCache) Flush(ctx api.StreamContext)

Flush save memory states to disk.

func (*SyncCache) InitStore added in v2.0.5

func (c *SyncCache) InitStore(ctx api.StreamContext) error

func (*SyncCache) PopCache

func (c *SyncCache) PopCache(ctx api.StreamContext) (any, bool)

PopCache not thread safe!

func (*SyncCache) SetupMeta

func (c *SyncCache) SetupMeta(ctx api.StreamContext)

Jump to

Keyboard shortcuts

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