route

package
v0.0.0-...-e11fe06 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: PostgreSQL Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

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

func NewRouteKey

func NewRouteKey(user, db string) *Key

func (*Key) DB

func (r *Key) DB() string

func (*Key) String

func (r *Key) String() string

func (*Key) Usr

func (r *Key) Usr() string

type Route

type Route struct {
	pool.PoolIterator
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute(beRule *config.BackendRule, frRule *config.FrontendRule, mapping map[string]*config.Shard) *Route

func (*Route) AddClient

func (r *Route) AddClient(cl client.Client) error

func (*Route) BeRule

func (r *Route) BeRule() *config.BackendRule

func (*Route) ForEachPool

func (r *Route) ForEachPool(cb func(pool.Pool) error) error

func (*Route) FrRule

func (r *Route) FrRule() *config.FrontendRule

func (*Route) NofityClients

func (r *Route) NofityClients(cb func(cl client.ClientInfo) error) error

func (*Route) Params

func (r *Route) Params() (shard.ParameterSet, error)

TODO : unit tests

func (*Route) ReleaseClient

func (r *Route) ReleaseClient(clientID uint) (bool, error)

func (*Route) ServPool

func (r *Route) ServPool() *pool.DBPool

func (*Route) SetParams

func (r *Route) SetParams(ps shard.ParameterSet)

TODO : unit tests

type RouteMgr

type RouteMgr interface {
	// Parse and analyze user query, and decide which shard routes
	// will participate in query execturion
	Reroute() error
	// Acquire (prepare) connection to any random shard route
	// Without any user query analysis
	RerouteToRandomRoute() error
	RerouteToTargetRoute(route *routingstate.DataShardRoute) error

	CurrentRoutes() []*routingstate.DataShardRoute
	/* Unroute Routines */
	UnRouteWithError(shkey []kr.ShardKey, errmsg error) error
	Unroute(shkey []kr.ShardKey) error
	UnrouteRoutes(routes []*routingstate.DataShardRoute) error
}

Jump to

Keyboard shortcuts

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