cluster

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 22 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultMaxConnections     uint64 = 0
	DefaultMaxPendingRequests uint64 = 0
	DefaultMaxRequests        uint64 = 0
	DefaultMaxRetries         uint64 = 0
)

default value is zero

Variables

View Source
var AddrStore *utils.ExpiredMap = utils.NewExpiredMap(
	func(key interface{}) (interface{}, bool) {
		addr, err := net.ResolveTCPAddr("tcp", key.(string))
		if err == nil {
			return addr, true
		}
		return nil, false
	}, false)

net.Addr reuse for same address, valid in simple type Update DNS cache using asynchronous mode

Functions

func ExtractSubsetMetadata

func ExtractSubsetMetadata(subsetKeys []string, metadata api.Metadata) types.SubsetMetadata

if subsetKeys are all contained in the host metadata

func GenerateSubsetKeys

func GenerateSubsetKeys(keysArray [][]string) []types.SortedStringSetType

func GetOrCreateAddr

func GetOrCreateAddr(addrstr string) net.Addr

func HostMatches

func HostMatches(kvs types.SubsetMetadata, host types.Host) bool

func NewCluster

func NewCluster(clusterConfig v2.Cluster) types.Cluster

func NewClusterManagerSingleton

func NewClusterManagerSingleton(clusters []v2.Cluster, clusterMap map[string][]v2.Host) types.ClusterManager

func NewLBOriDstInfo added in v0.11.0

func NewLBOriDstInfo(oridstCfg *v2.LBOriDstConfig) types.LBOriDstInfo

func NewLBSubsetInfo

func NewLBSubsetInfo(subsetCfg *v2.LBSubsetConfig) types.LBSubsetInfo

func NewLoadBalancer

func NewLoadBalancer(lbType types.LoadBalancerType, hosts types.HostSet) types.LoadBalancer

func NewResourceManager

func NewResourceManager(circuitBreakers v2.CircuitBreakers) types.ResourceManager

func NewSimpleHost

func NewSimpleHost(config v2.Host, clusterInfo types.ClusterInfo) types.Host

func NewSubsetLoadBalancer

func NewSubsetLoadBalancer(info *clusterInfo, hostSet *hostSet) types.LoadBalancer

func RegisterLBType

func RegisterLBType(lbType types.LoadBalancerType, f func(types.HostSet) types.LoadBalancer)

Types

type LBOriDstInfoImpl added in v0.11.0

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

func (*LBOriDstInfoImpl) GetHeader added in v0.11.0

func (info *LBOriDstInfoImpl) GetHeader() string

func (*LBOriDstInfoImpl) IsEnabled added in v0.11.0

func (info *LBOriDstInfoImpl) IsEnabled() bool

type LBSubsetEntryImpl

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

func (*LBSubsetEntryImpl) Active

func (entry *LBSubsetEntryImpl) Active() bool

func (*LBSubsetEntryImpl) Children

func (entry *LBSubsetEntryImpl) Children() types.LbSubsetMap

func (*LBSubsetEntryImpl) CreateLoadBalancer

func (entry *LBSubsetEntryImpl) CreateLoadBalancer(lbType types.LoadBalancerType, hosts types.HostSet)

func (*LBSubsetEntryImpl) HostNum

func (entry *LBSubsetEntryImpl) HostNum() int

func (*LBSubsetEntryImpl) Initialized

func (entry *LBSubsetEntryImpl) Initialized() bool

func (*LBSubsetEntryImpl) LoadBalancer

func (entry *LBSubsetEntryImpl) LoadBalancer() types.LoadBalancer

type LBSubsetInfoImpl

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

func (*LBSubsetInfoImpl) DefaultSubset

func (info *LBSubsetInfoImpl) DefaultSubset() types.SubsetMetadata

func (*LBSubsetInfoImpl) FallbackPolicy

func (info *LBSubsetInfoImpl) FallbackPolicy() types.FallBackPolicy

func (*LBSubsetInfoImpl) IsEnabled

func (info *LBSubsetInfoImpl) IsEnabled() bool

func (*LBSubsetInfoImpl) SubsetKeys

func (info *LBSubsetInfoImpl) SubsetKeys() []types.SortedStringSetType

type MngAdapter

type MngAdapter struct {
	types.ClusterManager
}

cluster adapter wrapper cluster manager the adapter can call clustermanager directly but at most time, we call the wrapper functions

func GetClusterMngAdapterInstance

func GetClusterMngAdapterInstance() *MngAdapter

func (*MngAdapter) TriggerClusterAddOrUpdate

func (ca *MngAdapter) TriggerClusterAddOrUpdate(cluster v2.Cluster) error

func (*MngAdapter) TriggerClusterAndHostsAddOrUpdate

func (ca *MngAdapter) TriggerClusterAndHostsAddOrUpdate(cluster v2.Cluster, hosts []v2.Host) error

func (*MngAdapter) TriggerClusterDel

func (ca *MngAdapter) TriggerClusterDel(clusterNames ...string) error

func (*MngAdapter) TriggerClusterHostUpdate

func (ca *MngAdapter) TriggerClusterHostUpdate(clusterName string, hosts []v2.Host) error

func (*MngAdapter) TriggerHostAppend

func (ca *MngAdapter) TriggerHostAppend(clusterName string, hostAppend []v2.Host) error

func (*MngAdapter) TriggerHostDel

func (ca *MngAdapter) TriggerHostDel(clusterName string, hosts []string) error

type OriginalDstLoadBalancer added in v0.11.0

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

LoadBalancer Implementations

func (*OriginalDstLoadBalancer) ChooseHost added in v0.11.0

func (*OriginalDstLoadBalancer) HostNum added in v0.11.0

func (lb *OriginalDstLoadBalancer) HostNum(metadata api.MetadataMatchCriteria) int

func (*OriginalDstLoadBalancer) IsExistsHosts added in v0.11.0

func (lb *OriginalDstLoadBalancer) IsExistsHosts(metadata api.MetadataMatchCriteria) bool

Jump to

Keyboard shortcuts

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