cluster

package
v0.0.0-...-e3e1183 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

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 *sync.Map = &sync.Map{}

net.Addr reuse for same address, valid in simple type

Functions

func ExtractSubsetMetadata

func ExtractSubsetMetadata(subsetKeys []string, metadata v2.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 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 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

Jump to

Keyboard shortcuts

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