Documentation ¶
Index ¶
- func Query(ctx context.Context, clientManager clientmanager.ClientManager, ...) (*query.Result, error)
- func QueryStream(ctx context.Context, clientManager clientmanager.ClientManager, ...) (*query.ResultStream, error)
- type Config
- type HTTPApi
- type HTTPApiConfig
- type MetaConfig
- type RouterNode
- func (s *RouterNode) FetchMeta() error
- func (s *RouterNode) GetMeta() *metadata.Meta
- func (s *RouterNode) HandleQuery(ctx context.Context, q *query.Query) *query.Result
- func (s *RouterNode) HandleStreamQuery(ctx context.Context, q *query.Query) *query.ResultStream
- func (s *RouterNode) Start() error
- func (s *RouterNode) Sync() error
- type RouterNodeMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Query ¶
func Query(ctx context.Context, clientManager clientmanager.ClientManager, datasourceInstance *metadata.DatasourceInstance, q *query.Query) (*query.Result, error)
TODO: remove this method? Doesn't do much. Once we support sending things to more than just the primary this won't be helpful (since each call will need to know what is acceptable)
func QueryStream ¶
func QueryStream(ctx context.Context, clientManager clientmanager.ClientManager, datasourceInstance *metadata.DatasourceInstance, q *query.Query) (*query.ResultStream, error)
TODO: remove this method? Doesn't do much. Once we support sending things to more than just the primary this won't be helpful (since each call will need to know what is acceptable)
Types ¶
type Config ¶
type Config struct { HTTP HTTPApiConfig `yaml:"http_api"` MetaConfig MetaConfig `yaml:"meta"` }
Common configuration for all storage nodes
type HTTPApi ¶
type HTTPApi struct {
// contains filtered or unexported fields
}
func NewHTTPApi ¶
func NewHTTPApi(routerNode *RouterNode) *HTTPApi
func (*HTTPApi) Start ¶
func (h *HTTPApi) Start(router *httprouter.Router)
Register any endpoints to the router
type MetaConfig ¶
type RouterNode ¶
type RouterNode struct { Config *Config // contains filtered or unexported fields }
This node is responsible for routing requests to the appropriate storage node This is also responsible for maintaining schema, indexes, etc. from the metadata store
func NewRouterNode ¶
func NewRouterNode(config *Config) (*RouterNode, error)
func (*RouterNode) FetchMeta ¶
func (s *RouterNode) FetchMeta() error
This method will create a new `Databases` map and swap it in
func (*RouterNode) GetMeta ¶
func (s *RouterNode) GetMeta() *metadata.Meta
func (*RouterNode) HandleQuery ¶
Handle a single query
func (*RouterNode) HandleStreamQuery ¶
func (s *RouterNode) HandleStreamQuery(ctx context.Context, q *query.Query) *query.ResultStream
func (*RouterNode) Sync ¶
func (s *RouterNode) Sync() error
TODO: remove? since we need to do this while holding the lock it seems useless
type RouterNodeMetrics ¶
type RouterNodeMetrics struct { MetaLastSync *metrics.ObserveArray MetaLastDuration *metrics.ObserveArray QueryTime *metrics.ObserveArray }
func NewRouterNodeMetrics ¶
func NewRouterNodeMetrics(r metrics.Registry) RouterNodeMetrics