poolcache

package
v1.16.0-rc2 Latest Latest
Warning

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

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

Documentation

Overview

Package poolcache implements a simple cache implementation having values mapped by two keys. As of now this package is only used by poolmanager executor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is simple cache having two keys [function][address] mapped to value and requestChannel for operation on it

func NewPoolCache

func NewPoolCache(logger *zap.Logger) *Cache

NewPoolCache create a Cache object

func (*Cache) DeleteValue

func (c *Cache) DeleteValue(ctx context.Context, function, address interface{}) error

DeleteValue deletes the value at key composed of [function][address]

func (*Cache) GetValue

func (c *Cache) GetValue(ctx context.Context, function interface{}, requestsPerPod int) (interface{}, int, error)

GetValue returns a value interface with status inActive else return error

func (*Cache) ListAvailableValue

func (c *Cache) ListAvailableValue() []interface{}

ListAvailableValue returns a list of the available function services stored in the Cache

func (*Cache) MarkAvailable

func (c *Cache) MarkAvailable(function, address interface{})

MarkAvailable marks the value at key [function][address] as available

func (*Cache) SetCPUUtilization

func (c *Cache) SetCPUUtilization(function, address interface{}, cpuUsage resource.Quantity)

SetCPUUtilization updates/sets the CPU utilization limit for the pod

func (*Cache) SetValue

func (c *Cache) SetValue(ctx context.Context, function, address, value interface{}, cpuLimit resource.Quantity)

SetValue marks the value at key [function][address] as active(begin used)

Jump to

Keyboard shortcuts

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