Versions in this module Expand all Collapse all v1 v1.8.9 Sep 17, 2026 v1.8.8 Sep 17, 2026 Changes in this version + const ShardControllerMappingKey + var HeartbeatDuration = env.ParseNumFromEnv(common.EnvControllerHeartbeatTime, 10, 10, 60) + var HeartbeatTimeout = 3 * HeartbeatDuration + func GetOrUpdateShardFromConfigMap(kubeClient kubernetes.Interface, settingsMgr *settings.SettingsManager, ...) (int, error) + func InferShard() (int, error) + type ClusterFilterFunction func(c *v1alpha1.Cluster) bool + func GetClusterFilter(_ db.DB, distributionFunction DistributionFunction, replicas, shard int) ClusterFilterFunction + type ClusterSharding struct + Apps map[string]*v1alpha1.Application + Clusters map[string]*v1alpha1.Cluster + Replicas int + Shard int + Shards map[string]int + func (sharding *ClusterSharding) Add(c *v1alpha1.Cluster) + func (sharding *ClusterSharding) AddApp(a *v1alpha1.Application) + func (sharding *ClusterSharding) Delete(clusterServer string) + func (sharding *ClusterSharding) DeleteApp(a *v1alpha1.Application) + func (sharding *ClusterSharding) GetAppDistribution() map[string]int + func (sharding *ClusterSharding) GetDistribution() map[string]int + func (sharding *ClusterSharding) Init(clusters *v1alpha1.ClusterList, apps *v1alpha1.ApplicationList) + func (sharding *ClusterSharding) IsManagedCluster(c *v1alpha1.Cluster) bool + func (sharding *ClusterSharding) Update(oldCluster *v1alpha1.Cluster, newCluster *v1alpha1.Cluster) + func (sharding *ClusterSharding) UpdateApp(a *v1alpha1.Application) + func (sharding *ClusterSharding) UpdateShard(shard int) bool + type ClusterShardingCache interface + Add func(c *v1alpha1.Cluster) + AddApp func(a *v1alpha1.Application) + Delete func(clusterServer string) + DeleteApp func(a *v1alpha1.Application) + GetAppDistribution func() map[string]int + GetDistribution func() map[string]int + Init func(clusters *v1alpha1.ClusterList, apps *v1alpha1.ApplicationList) + IsManagedCluster func(c *v1alpha1.Cluster) bool + Update func(oldCluster *v1alpha1.Cluster, newCluster *v1alpha1.Cluster) + UpdateApp func(a *v1alpha1.Application) + UpdateShard func(shard int) bool + func GetClusterSharding(kubeClient kubernetes.Interface, settingsMgr *settings.SettingsManager, ...) (ClusterShardingCache, error) + func NewClusterSharding(_ db.DB, shard, replicas int, shardingAlgorithm string) ClusterShardingCache + type DistributionFunction func(c *v1alpha1.Cluster) int + func ConsistentHashingWithBoundedLoadsDistributionFunction(clusters clusterAccessor, apps appAccessor, replicas int) DistributionFunction + func GetDistributionFunction(clusters clusterAccessor, apps appAccessor, shardingAlgorithm string, ...) DistributionFunction + func LegacyDistributionFunction(replicas int) DistributionFunction + func NoShardingDistributionFunction() DistributionFunction + func RoundRobinDistributionFunction(clusters clusterAccessor, replicas int) DistributionFunction