filters

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateMixFilterSlots

func CalculateMixFilterSlots(mixFilters []Filter, slotCount int) (mixFiltersIndexes map[Filter][]int)

this function calculates which slot indexes should be filtered by what filters when mix filtering it divides the mix filters to abtches where one batch is always empty and the rest contain one or more mix filters in case there are too many mix filters the batches grow in the amount of filters, in case there are less mix filters than slots, each batch will contain only one filter

func SetupScores

func SetupScores(ctx sdk.Context, filters []Filter, providers []epochstoragetypes.StakeEntry, strictestPolicy *planstypes.Policy, currentEpoch uint64, slotCount int, cluster string, qg pairingscores.QosGetter) ([]*pairingscores.PairingScore, error)

Types

type AddonFilter

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

func (*AddonFilter) Filter

func (f *AddonFilter) Filter(ctx sdk.Context, providers []epochstoragetypes.StakeEntry, currentEpoch uint64) []bool

func (*AddonFilter) InitFilter

func (f *AddonFilter) InitFilter(strictestPolicy planstypes.Policy) bool

func (*AddonFilter) IsMix

func (f *AddonFilter) IsMix() bool

type Filter

type Filter interface {
	Filter(ctx sdk.Context, providers []epochstoragetypes.StakeEntry, currentEpoch uint64) []bool
	InitFilter(strictestPolicy planstypes.Policy) bool // return if filter is usable (by the policy)
	IsMix() bool
}

func GetAllFilters

func GetAllFilters() []Filter

type FrozenProvidersFilter

type FrozenProvidersFilter struct{}

func (*FrozenProvidersFilter) Filter

func (f *FrozenProvidersFilter) Filter(ctx sdk.Context, providers []epochstoragetypes.StakeEntry, currentEpoch uint64) []bool

func (*FrozenProvidersFilter) InitFilter

func (f *FrozenProvidersFilter) InitFilter(strictestPolicy planstypes.Policy) bool

func (*FrozenProvidersFilter) IsMix

func (f *FrozenProvidersFilter) IsMix() bool

type GeolocationFilter

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

func (*GeolocationFilter) Filter

func (f *GeolocationFilter) Filter(ctx sdk.Context, providers []epochstoragetypes.StakeEntry, currentEpoch uint64) []bool

func (*GeolocationFilter) InitFilter

func (f *GeolocationFilter) InitFilter(strictestPolicy planstypes.Policy) bool

func (*GeolocationFilter) IsMix

func (f *GeolocationFilter) IsMix() bool

type SelectedProvidersFilter

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

func (*SelectedProvidersFilter) Filter

func (f *SelectedProvidersFilter) Filter(ctx sdk.Context, providers []epochstoragetypes.StakeEntry, currentEpoch uint64) []bool

func (*SelectedProvidersFilter) InitFilter

func (f *SelectedProvidersFilter) InitFilter(strictestPolicy planstypes.Policy) bool

func (*SelectedProvidersFilter) IsMix

func (f *SelectedProvidersFilter) IsMix() bool

Jump to

Keyboard shortcuts

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