Documentation ¶
Index ¶
- Constants
- func GetAttributesForFuncSvc(fsvc *FuncSvc) []attribute.KeyValue
- func IsNameExistError(err error) bool
- func IsNotFoundError(err error) bool
- func NewFuncSvcGroup() *funcSvcGroup
- type FuncSvc
- type FunctionServiceCache
- func (fsc *FunctionServiceCache) Add(fsvc FuncSvc) (*FuncSvc, error)
- func (fsc *FunctionServiceCache) AddFunc(ctx context.Context, fsvc FuncSvc, requestsPerPod, svcsRetain int)
- func (fsc *FunctionServiceCache) DeleteEntry(fsvc *FuncSvc)
- func (fsc *FunctionServiceCache) DeleteFunctionSvc(ctx context.Context, fsvc *FuncSvc)
- func (fsc *FunctionServiceCache) DeleteOld(fsvc *FuncSvc, minAge time.Duration) (bool, error)
- func (fsc *FunctionServiceCache) DeleteOldPoolCache(ctx context.Context, fsvc *FuncSvc, minAge time.Duration) (bool, error)
- func (fsc *FunctionServiceCache) DumpDebugInfo(ctx context.Context) error
- func (fsc *FunctionServiceCache) GetByFunction(m *metav1.ObjectMeta) (*FuncSvc, error)
- func (fsc *FunctionServiceCache) GetByFunctionUID(uid types.UID) (*FuncSvc, error)
- func (fsc *FunctionServiceCache) GetFuncSvc(ctx context.Context, m *metav1.ObjectMeta, requestsPerPod int, concurrency int) (*FuncSvc, error)
- func (fsc *FunctionServiceCache) ListOld(age time.Duration) ([]*FuncSvc, error)
- func (fsc *FunctionServiceCache) ListOldForPool(age time.Duration) ([]*FuncSvc, error)
- func (fsc *FunctionServiceCache) Log()
- func (fsc *FunctionServiceCache) MarkAvailable(key crd.CacheKeyURG, svcHost string)
- func (fsc *FunctionServiceCache) MarkFuncDeleted(key crd.CacheKeyURG)
- func (fsc *FunctionServiceCache) MarkSpecializationFailure(key crd.CacheKeyURG)
- func (fsc *FunctionServiceCache) SetCPUUtilization(key crd.CacheKeyURG, svcHost string, cpuUsage resource.Quantity)
- func (fsc *FunctionServiceCache) SetCPUUtilizaton(key crd.CacheKeyURG, svcHost string, cpuUsage resource.Quantity)
- func (fsc *FunctionServiceCache) TouchByAddress(address string) error
- type PoolCache
- func (c *PoolCache) DeleteValue(ctx context.Context, function crd.CacheKeyURG, address string) error
- func (c *PoolCache) GetSvcValue(ctx context.Context, function crd.CacheKeyURG, requestsPerPod int, ...) (*FuncSvc, error)
- func (c *PoolCache) ListAvailableValue() []*FuncSvc
- func (c *PoolCache) LogFnSvcGroup(ctx context.Context, file io.Writer) error
- func (c *PoolCache) MarkAvailable(function crd.CacheKeyURG, address string)
- func (c *PoolCache) MarkFuncDeleted(function crd.CacheKeyURG)
- func (c *PoolCache) MarkSpecializationFailure(function crd.CacheKeyURG)
- func (c *PoolCache) SetCPUUtilization(function crd.CacheKeyURG, address string, cpuUsage resource.Quantity)
- func (c *PoolCache) SetSvcValue(ctx context.Context, function crd.CacheKeyURG, address string, value *FuncSvc, ...)
- type Queue
Constants ¶
const ( TOUCH fscRequestType = iota LISTOLD LOG LISTOLDPOOL )
FunctionServiceCache Request Types
Variables ¶
This section is empty.
Functions ¶
func GetAttributesForFuncSvc ¶ added in v1.15.0
func IsNameExistError ¶
IsNameExistError checks if err is ErrorNameExists.
func IsNotFoundError ¶
IsNotFoundError checks if err is ErrorNotFound.
func NewFuncSvcGroup ¶ added in v1.19.0
func NewFuncSvcGroup() *funcSvcGroup
Types ¶
type FuncSvc ¶
type FuncSvc struct { Name string // Name of object Function *metav1.ObjectMeta // function this pod/service is for Environment *fv1.Environment // function's environment Address string // Host:Port or IP:Port that the function's service can be reached at. KubernetesObjects []apiv1.ObjectReference // Kubernetes Objects (within the function namespace) Executor fv1.ExecutorType CPULimit resource.Quantity Ctime time.Time Atime time.Time }
FuncSvc represents a function service
type FunctionServiceCache ¶
type FunctionServiceCache struct { PodToFsvc sync.Map // pod-name -> funcSvc: map[string]*FuncSvc WebsocketFsvc sync.Map // funcSvc-name -> bool: map[string]bool // contains filtered or unexported fields }
FunctionServiceCache represents the function service cache
func MakeFunctionServiceCache ¶
func MakeFunctionServiceCache(logger *zap.Logger) *FunctionServiceCache
MakeFunctionServiceCache starts and returns an instance of FunctionServiceCache.
func (*FunctionServiceCache) Add ¶
func (fsc *FunctionServiceCache) Add(fsvc FuncSvc) (*FuncSvc, error)
Add adds a function service to cache if it does not exist already.
func (*FunctionServiceCache) AddFunc ¶ added in v1.11.0
func (fsc *FunctionServiceCache) AddFunc(ctx context.Context, fsvc FuncSvc, requestsPerPod, svcsRetain int)
AddFunc adds a function service to pool cache.
func (*FunctionServiceCache) DeleteEntry ¶
func (fsc *FunctionServiceCache) DeleteEntry(fsvc *FuncSvc)
DeleteEntry deletes a function service from cache.
func (*FunctionServiceCache) DeleteFunctionSvc ¶ added in v1.11.0
func (fsc *FunctionServiceCache) DeleteFunctionSvc(ctx context.Context, fsvc *FuncSvc)
DeleteFunctionSvc deletes a function service at key composed of [function][address].
func (*FunctionServiceCache) DeleteOld ¶
DeleteOld deletes aged function service entries from cache.
func (*FunctionServiceCache) DeleteOldPoolCache ¶ added in v1.11.0
func (fsc *FunctionServiceCache) DeleteOldPoolCache(ctx context.Context, fsvc *FuncSvc, minAge time.Duration) (bool, error)
DeleteOldPoolCache deletes aged function service entries from pool cache.
func (*FunctionServiceCache) DumpDebugInfo ¶ added in v1.19.0
func (fsc *FunctionServiceCache) DumpDebugInfo(ctx context.Context) error
DumpDebugInfo => dump function service cache data to temporary directory of executor pod.
func (*FunctionServiceCache) GetByFunction ¶
func (fsc *FunctionServiceCache) GetByFunction(m *metav1.ObjectMeta) (*FuncSvc, error)
GetByFunction gets a function service from cache using function key.
func (*FunctionServiceCache) GetByFunctionUID ¶
func (fsc *FunctionServiceCache) GetByFunctionUID(uid types.UID) (*FuncSvc, error)
GetByFunctionUID gets a function service from cache using function UUID.
func (*FunctionServiceCache) GetFuncSvc ¶ added in v1.11.0
func (fsc *FunctionServiceCache) GetFuncSvc(ctx context.Context, m *metav1.ObjectMeta, requestsPerPod int, concurrency int) (*FuncSvc, error)
GetFuncSvc gets a function service from pool cache using function key and returns number of active instances of function pod
func (*FunctionServiceCache) ListOld ¶
func (fsc *FunctionServiceCache) ListOld(age time.Duration) ([]*FuncSvc, error)
ListOld returns a list of aged function services in cache.
func (*FunctionServiceCache) ListOldForPool ¶ added in v1.11.0
func (fsc *FunctionServiceCache) ListOldForPool(age time.Duration) ([]*FuncSvc, error)
ListOldForPool returns a list of aged function services in cache for pooling.
func (*FunctionServiceCache) Log ¶
func (fsc *FunctionServiceCache) Log()
Log makes a LOG type cache request.
func (*FunctionServiceCache) MarkAvailable ¶ added in v1.11.0
func (fsc *FunctionServiceCache) MarkAvailable(key crd.CacheKeyURG, svcHost string)
MarkAvailable marks the value at key [function][address] as available.
func (*FunctionServiceCache) MarkFuncDeleted ¶ added in v1.20.0
func (fsc *FunctionServiceCache) MarkFuncDeleted(key crd.CacheKeyURG)
func (*FunctionServiceCache) MarkSpecializationFailure ¶ added in v1.19.0
func (fsc *FunctionServiceCache) MarkSpecializationFailure(key crd.CacheKeyURG)
func (*FunctionServiceCache) SetCPUUtilization ¶ added in v1.13.0
func (fsc *FunctionServiceCache) SetCPUUtilization(key crd.CacheKeyURG, svcHost string, cpuUsage resource.Quantity)
func (*FunctionServiceCache) SetCPUUtilizaton ¶ added in v1.13.0
func (fsc *FunctionServiceCache) SetCPUUtilizaton(key crd.CacheKeyURG, svcHost string, cpuUsage resource.Quantity)
SetCPUUtilizaton updates/sets CPUutilization in the pool cache
func (*FunctionServiceCache) TouchByAddress ¶
func (fsc *FunctionServiceCache) TouchByAddress(address string) error
TouchByAddress makes a TOUCH request to given address.
type PoolCache ¶ added in v1.19.0
type PoolCache struct {
// contains filtered or unexported fields
}
PoolCache implements a simple cache implementation having values mapped by two keys [function][address]. As of now PoolCache is only used by poolmanager executor
func NewPoolCache ¶ added in v1.19.0
NewPoolCache create a Cache object
func (*PoolCache) DeleteValue ¶ added in v1.19.0
func (c *PoolCache) DeleteValue(ctx context.Context, function crd.CacheKeyURG, address string) error
DeleteValue deletes the value at key composed of [function][address]
func (*PoolCache) GetSvcValue ¶ added in v1.19.0
func (c *PoolCache) GetSvcValue(ctx context.Context, function crd.CacheKeyURG, requestsPerPod int, concurrency int) (*FuncSvc, error)
GetSvcValue returns a function service with status in Active else return error
func (*PoolCache) ListAvailableValue ¶ added in v1.19.0
ListAvailableValue returns a list of the available function services stored in the Cache
func (*PoolCache) LogFnSvcGroup ¶ added in v1.19.0
func (*PoolCache) MarkAvailable ¶ added in v1.19.0
func (c *PoolCache) MarkAvailable(function crd.CacheKeyURG, address string)
MarkAvailable marks the value at key [function][address] as available
func (*PoolCache) MarkFuncDeleted ¶ added in v1.20.0
func (c *PoolCache) MarkFuncDeleted(function crd.CacheKeyURG)
func (*PoolCache) MarkSpecializationFailure ¶ added in v1.19.0
func (c *PoolCache) MarkSpecializationFailure(function crd.CacheKeyURG)
ReduceSpecializationInProgress reduces the svcWaiting count
func (*PoolCache) SetCPUUtilization ¶ added in v1.19.0
func (c *PoolCache) SetCPUUtilization(function crd.CacheKeyURG, address string, cpuUsage resource.Quantity)
SetCPUUtilization updates/sets the CPU utilization limit for the pod