Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCells ¶
func ParseCells(settings config.VitessConfigurationSettings) (cells []string)
ParseCells returns a slice of non-empty Vitess cell names
Types ¶
type Tablet ¶
type Tablet struct { Alias *topodata.TabletAlias `json:"alias,omitempty"` MysqlHostname string `json:"mysql_hostname,omitempty"` MysqlPort int32 `json:"mysql_port,omitempty"` Stats *TabletStats `json:"stats,omitempty"` Type topodata.TabletType `json:"type,omitempty"` }
Tablet represents information about a running instance of vttablet.
func ParseTablets ¶
func ParseTablets(settings config.VitessConfigurationSettings) (tablets []Tablet, err error)
ParseTablets reads from vitess /api/keyspace/<keyspace>/tablets/[shard] and returns a listing (mysql_hostname, mysql_port, type) of REPLICA tablets
func (Tablet) HasValidCell ¶
HasValidCell returns a bool reflecting if a tablet is in a valid Vitess cell
func (Tablet) IsServeable ¶ added in v1.2.0
IsServeable returns a bool reflecting if a tablet is eligible to serve traffic based on tablet stats. For backwards-compatibilty tablets are assumed to be healthy if realtime stats is disabled. This method aims to mimic the logic used by vtgate to select tablets for read queries without considering 'serving', minimum tablet count (not important to freno) and replication lag (freno polls its own replication lag)
func (Tablet) IsValidReplica ¶
IsValidReplica returns a bool reflecting if a tablet type is REPLICA
type TabletRealtimeStats ¶ added in v1.2.0
type TabletRealtimeStats struct {
HealthError string `json:"health_error,omitempty"`
}
TabletRealtimeStats represents realtime stats from a running instance of vttablet.
type TabletStats ¶ added in v1.2.0
type TabletStats struct { LastError string `json:"last_error,omitempty"` Realtime *TabletRealtimeStats `json:"realtime,omitempty"` Serving bool `json:"serving,omitempty"` Up bool `json:"up,omitempty"` }
TabletStats represents stats from a running instance of vttablet.