Documentation
¶
Index ¶
- func ListenerRegister(name string, l Listener)
- func Listeners() map[string]Listener
- type Config
- type Listener
- type ListenerConfig
- type Request
- type Result
- type ResultWriter
- type RulesConfig
- type ServerCtx
- func (m *ServerCtx) InfoSchema() (*schema.Schema, error)
- func (m *ServerCtx) Init() error
- func (m *ServerCtx) JobMaker(ctx *plan.Context) (*planner.GridTask, error)
- func (m *ServerCtx) Schema(source string) (*schema.Schema, bool)
- func (m *ServerCtx) SchemaLoader(db string) (*schema.Schema, error)
- func (m *ServerCtx) Table(schemaName, tableName string) (*schema.Table, error)
- type ShardConfig
- type StatementHandler
- type StatementHandlerCreator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenerRegister ¶
Types ¶
type Config ¶
type Config struct {
SupressRecover bool `json:"supress_recover"` // do we recover?
WorkerCt int `json:"worker_ct"` // 4 how many worker nodes on this instance
LogLevel string `json:"log_level"` // [debug,info,error,]
Etcd []string `json:"etcd"` // list of etcd servers http://127.0.0.1:2379,http://127.0.0.1:2380
Frontends []*ListenerConfig `json:"frontends"` // tcp listener configs
Sources []*schema.ConfigSource `json:"sources"` // backend servers/sources (es, mysql etc)
Schemas []*schema.ConfigSchema `json:"schemas"` // Schemas, each backend has 1 schema
Rules *RulesConfig `json:"rules"` // rules for routing
}
Config for DataUX Server config made up of blocks 1) Frontend Listeners (protocols) 2) Sources (types of backends such as elasticsearch, mysql, mongo, ...) 3) Schemas: n number of sources can create a "Virtual Schema" 4) etcd coordinators hosts
func LoadConfig ¶
LoadConfig load a confl formatted file from string (assumes came) from file or passed in
func LoadConfigFromFile ¶
LoadConfigFromFile Read a Confl formatted config file from disk
func (*Config) DistributedMode ¶
DistributedMode Does this config operate in distributed mode?
type Listener ¶
type Listener interface {
Init(*ListenerConfig, *ServerCtx) error
Run(stop chan bool) error
Close() error
}
A listener is a protocol specific, and transport specific
reader of requests which will be routed to a handler
func ListenerGet ¶
type ListenerConfig ¶
type ListenerConfig struct {
Type string `json:"type"` // named protocol type [mysql,mongo,mc,postgres,etc]
Addr string `json:"address"` // net.Conn compatible ip/dns address
User string `json:"user"` // user to talk to backend with
Password string `json:"password"` // optional pwd for backend
}
ListenerConfig Frontend Listener to listen for inbound traffic on specific protocol aka transport (mysql)
type Request ¶
type Request struct {
Raw []byte // raw full byte statement
Db string // Db name parsed from statement
Schema *schema.Schema
Session expr.ContextReader
}
a DataUx Request contains the request/command from client and references to session and schema
type ResultWriter ¶
type RulesConfig ¶
type RulesConfig struct {
Schema string `json:"schema"`
Default string `json:"default"`
ShardRule []ShardConfig `json:"shard"`
}
RulesConfig
type ServerCtx ¶
type ServerCtx struct {
// The dataux server config info on schema, backends, frontends, etc
Config *Config
// The underlying qlbridge registry holds info about the available datasource providers
Reg *schema.Registry
// PlanGrid is swapping out the qlbridge planner
// with a distributed version that uses Grid lib to split
// tasks across nodes
PlanGrid *planner.PlannerGrid
// contains filtered or unexported fields
}
ServerCtx Singleton global Context for the DataUX Server giving access to the shared Config, Schemas, Grid runtime
func NewServerCtx ¶
NewServerCtx create new server context. Main stateful object for sharing server state.
func (*ServerCtx) InfoSchema ¶
InfoSchema Get A schema
func (*ServerCtx) Init ¶
Init Load all the config info for this server and start the grid/messaging/coordination systems
func (*ServerCtx) SchemaLoader ¶
SchemaLoader finds a schema by name from the registry
type ShardConfig ¶
type ShardConfig struct {
Table string `json:"table"`
Key string `json:"key"`
Nodes []string `json:"nodes"`
Type string `json:"type"`
Range string `json:"range"`
}
ShardConfig
type StatementHandler ¶
type StatementHandler interface {
SchemaUse(db string) *schema.Schema
Handle(writer ResultWriter, req *Request) error
Close() error
}
A statement handler fulfills a frontend network client request. Examples of handlers are mysql, mongo, etc
type StatementHandlerCreator ¶
type StatementHandlerCreator interface {
Open(conn interface{}) StatementHandler
}