Versions in this module Expand all Collapse all v0 v0.16.3 Nov 29, 2024 Changes in this version + const DefaultHealthCheckRetryDelay + const DefaultHealthCheckTimeout + const DefaultTopoReadConcurrency + const DefaultTopologyWatcherRefreshInterval + const HealthCheckTemplate + func IsReplicationLagHigh(tabletStats *TabletStats) bool + func IsReplicationLagVeryHigh(tabletStats *TabletStats) bool + func ParseTabletURLTemplateFromFlag() + func TabletToMapKey(tablet *topodatapb.Tablet) string + func TrivialStatsUpdate(o, n *TabletStats) bool + type FakeHealthCheck struct + func NewFakeHealthCheck() *FakeHealthCheck + func (fhc *FakeHealthCheck) AddFakeTablet(cell, host string, port int32, keyspace, shard string, ...) queryservice.QueryService + func (fhc *FakeHealthCheck) AddTablet(tablet *topodatapb.Tablet, name string) + func (fhc *FakeHealthCheck) AddTestTablet(cell, host string, port int32, keyspace, shard string, ...) *sandboxconn.SandboxConn + func (fhc *FakeHealthCheck) CacheStatus() TabletsCacheStatusList + func (fhc *FakeHealthCheck) Close() error + func (fhc *FakeHealthCheck) GetAllTablets() map[string]*topodatapb.Tablet + func (fhc *FakeHealthCheck) GetConnection(key string) queryservice.QueryService + func (fhc *FakeHealthCheck) RegisterStats() + func (fhc *FakeHealthCheck) RemoveTablet(tablet *topodatapb.Tablet) + func (fhc *FakeHealthCheck) ReplaceTablet(old, new *topodatapb.Tablet, name string) + func (fhc *FakeHealthCheck) Reset() + func (fhc *FakeHealthCheck) SetListener(listener HealthCheckStatsListener, sendDownEvents bool) + func (fhc *FakeHealthCheck) WaitForInitialStatsUpdates() + type FilterByKeyspace struct + func NewFilterByKeyspace(tr TabletRecorder, selectedKeyspaces []string) *FilterByKeyspace + func (fbk *FilterByKeyspace) AddTablet(tablet *topodatapb.Tablet, name string) + func (fbk *FilterByKeyspace) RemoveTablet(tablet *topodatapb.Tablet) + func (fbk *FilterByKeyspace) ReplaceTablet(old *topodatapb.Tablet, new *topodatapb.Tablet, name string) + type FilterByShard struct + func NewFilterByShard(tr TabletRecorder, filters []string) (*FilterByShard, error) + func (fbs *FilterByShard) AddTablet(tablet *topodatapb.Tablet, name string) + func (fbs *FilterByShard) RemoveTablet(tablet *topodatapb.Tablet) + func (fbs *FilterByShard) ReplaceTablet(old, new *topodatapb.Tablet, name string) + type HealthCheck interface + CacheStatus func() TabletsCacheStatusList + Close func() error + GetConnection func(key string) queryservice.QueryService + RegisterStats func() + SetListener func(listener HealthCheckStatsListener, sendDownEvents bool) + WaitForInitialStatsUpdates func() + func NewDefaultHealthCheck() HealthCheck + func NewHealthCheck(retryDelay, healthCheckTimeout time.Duration) HealthCheck + type HealthCheckImpl struct + func (hc *HealthCheckImpl) AddTablet(tablet *topodatapb.Tablet, name string) + func (hc *HealthCheckImpl) CacheStatus() TabletsCacheStatusList + func (hc *HealthCheckImpl) Close() error + func (hc *HealthCheckImpl) GetConnection(key string) queryservice.QueryService + func (hc *HealthCheckImpl) RegisterStats() + func (hc *HealthCheckImpl) RemoveTablet(tablet *topodatapb.Tablet) + func (hc *HealthCheckImpl) ReplaceTablet(old, new *topodatapb.Tablet, name string) + func (hc *HealthCheckImpl) ServeHTTP(w http.ResponseWriter, _ *http.Request) + func (hc *HealthCheckImpl) SetListener(listener HealthCheckStatsListener, sendDownEvents bool) + func (hc *HealthCheckImpl) WaitForInitialStatsUpdates() + type HealthCheckStatsListener interface + StatsUpdate func(*TabletStats) + type TabletPicker struct + func NewTabletPicker(ctx context.Context, ts *topo.Server, ...) (*TabletPicker, error) + func (tp *TabletPicker) Close() + func (tp *TabletPicker) PickForStreaming(ctx context.Context) (*topodatapb.Tablet, error) + type TabletRecorder interface + AddTablet func(tablet *topodatapb.Tablet, name string) + RemoveTablet func(tablet *topodatapb.Tablet) + ReplaceTablet func(old, new *topodatapb.Tablet, name string) + type TabletStats struct + Key string + LastError error + Name string + Serving bool + Stats *querypb.RealtimeStats + Tablet *topodatapb.Tablet + TabletExternallyReparentedTimestamp int64 + Target *querypb.Target + Up bool + func FilterByReplicationLag(tabletStatsList []*TabletStats) []*TabletStats + func RemoveUnhealthyTablets(tabletStatsList []TabletStats) []TabletStats + func (e *TabletStats) Copy() *TabletStats + func (e *TabletStats) DeepEqual(f *TabletStats) bool + func (e *TabletStats) String() string + func (e TabletStats) GetHostNameLevel(level int) string + func (e TabletStats) GetTabletHostPort() string + type TabletStatsCache struct + func NewTabletStatsCache(hc HealthCheck, ts *topo.Server, cell string) *TabletStatsCache + func NewTabletStatsCacheDoNotSetListener(ts *topo.Server, cell string) *TabletStatsCache + func (tc *TabletStatsCache) GetHealthyTabletStats(keyspace, shard string, tabletType topodatapb.TabletType) []TabletStats + func (tc *TabletStatsCache) GetTabletStats(keyspace, shard string, tabletType topodatapb.TabletType) []TabletStats + func (tc *TabletStatsCache) ResetForTesting() + func (tc *TabletStatsCache) StatsUpdate(ts *TabletStats) + func (tc *TabletStatsCache) WaitByFilter(ctx context.Context, keyspace, shard string, ...) error + func (tc *TabletStatsCache) WaitForAllServingTablets(ctx context.Context, targets []*querypb.Target) error + func (tc *TabletStatsCache) WaitForTablets(ctx context.Context, keyspace, shard string, tabletType topodatapb.TabletType) error + type TabletStatsList []*TabletStats + func (tsl TabletStatsList) Len() int + func (tsl TabletStatsList) Less(i, j int) bool + func (tsl TabletStatsList) Swap(i, j int) + type TabletsCacheStatus struct + Cell string + TabletsStats TabletStatsList + Target *querypb.Target + func (tcs *TabletsCacheStatus) StatusAsHTML() template.HTML + type TabletsCacheStatusList []*TabletsCacheStatus + func (tcsl TabletsCacheStatusList) Len() int + func (tcsl TabletsCacheStatusList) Less(i, j int) bool + func (tcsl TabletsCacheStatusList) Swap(i, j int) + type TopologyWatcher struct + func NewCellTabletsWatcher(ctx context.Context, topoServer *topo.Server, tr TabletRecorder, cell string, ...) *TopologyWatcher + func NewShardReplicationWatcher(ctx context.Context, topoServer *topo.Server, tr TabletRecorder, ...) *TopologyWatcher + func NewTopologyWatcher(ctx context.Context, topoServer *topo.Server, tr TabletRecorder, cell string, ...) *TopologyWatcher + func (tw *TopologyWatcher) RefreshLag() time.Duration + func (tw *TopologyWatcher) Stop() + func (tw *TopologyWatcher) TopoChecksum() uint32 + func (tw *TopologyWatcher) WaitForInitialTopology() error