Documentation
¶
Overview ¶
Copyright 2021 Molecula Corp. All rights reserved.
Package queryer provides the core query-related structs.
Index ¶
- Constants
- Variables
- func NewMDSTranslator(controller dax.Controller) *mdsTranslator
- type Config
- type Error
- type MDSTopology
- type Queryer
- func (q *Queryer) Orchestrator(qdbid dax.QualifiedDatabaseID) *qualifiedOrchestrator
- func (q *Queryer) QueryPQL(ctx context.Context, qdbid dax.QualifiedDatabaseID, table dax.TableName, ...) (*featurebase.WireQueryResponse, error)
- func (q *Queryer) QuerySQL(ctx context.Context, qdbid dax.QualifiedDatabaseID, sql string) (*featurebase.WireQueryResponse, error)
- func (q *Queryer) SetController(controller dax.Controller) error
- func (q *Queryer) Start() error
- type Topologer
- type Translator
Constants ¶
const ( FieldTypeSet = "set" FieldTypeInt = "int" FieldTypeTime = "time" FieldTypeMutex = "mutex" FieldTypeBool = "bool" FieldTypeDecimal = "decimal" FieldTypeTimestamp = "timestamp" )
Field types.
const FragmentNotFound = Error("fragment not found")
const ViewNotFound = Error("view not found")
Variables ¶
var ErrFieldNotFound error = dax.NewErrFieldDoesNotExist("")
Functions ¶
func NewMDSTranslator ¶
func NewMDSTranslator(controller dax.Controller) *mdsTranslator
Types ¶
type Config ¶
Config defines the configuration parameters for Queryer. At the moment, it's being used to serve two different purposes. This first is to provide the config parameters for the toml (i.e. human-friendly) file used at server startup. The second is as the Config for the Queryer type. If this gets more complex, it might make sense to split this into two different config structs. We initially did that with something called "Injections", but that separation was a bit premature.
type MDSTopology ¶
type MDSTopology struct {
// contains filtered or unexported fields
}
func (*MDSTopology) ComputeNodes ¶
func (m *MDSTopology) ComputeNodes(ctx context.Context, index string, shards []uint64) ([]dax.ComputeNode, error)
type Queryer ¶
type Queryer struct {
// contains filtered or unexported fields
}
Queryer represents the query layer in a Molecula implementation. The idea is that the externally-facing Molecula API would proxy query requests to a pool of "Queryer" nodes, which handle incoming query requests.
func (*Queryer) Orchestrator ¶ added in v3.27.0
func (q *Queryer) Orchestrator(qdbid dax.QualifiedDatabaseID) *qualifiedOrchestrator
Orchestrator gets (or creates) an instance of qualifiedOrchestrator based on the provided dax.QualifiedDatabaseID.
func (*Queryer) QueryPQL ¶
func (q *Queryer) QueryPQL(ctx context.Context, qdbid dax.QualifiedDatabaseID, table dax.TableName, pql string) (*featurebase.WireQueryResponse, error)
func (*Queryer) QuerySQL ¶
func (q *Queryer) QuerySQL(ctx context.Context, qdbid dax.QualifiedDatabaseID, sql string) (*featurebase.WireQueryResponse, error)
func (*Queryer) SetController ¶ added in v3.29.0
func (q *Queryer) SetController(controller dax.Controller) error
type Translator ¶
type Translator interface {
CreateIndexKeys(ctx context.Context, index string, keys []string) (map[string]uint64, error)
CreateFieldKeys(ctx context.Context, index string, field string, keys []string) (map[string]uint64, error)
FindIndexKeys(ctx context.Context, index string, keys []string) (map[string]uint64, error)
FindFieldKeys(ctx context.Context, index, field string, keys []string) (map[string]uint64, error)
// TODO(jaffee) the naming here is a cluster. TranslateIndexIDs takes a list, but TranslateFieldIDs takes a set, both have alternate methods that take the other thing. :facepalm:
TranslateIndexIDs(ctx context.Context, index string, ids []uint64) ([]string, error)
TranslateIndexIDSet(ctx context.Context, index string, ids map[uint64]struct{}) (map[uint64]string, error)
TranslateFieldIDs(ctx context.Context, tableKeyer dax.TableKeyer, field string, ids map[uint64]struct{}) (map[uint64]string, error)
TranslateFieldListIDs(ctx context.Context, index, field string, ids []uint64) ([]string, error)
}
TODO(jaffee) we need version info in here ASAP. whenever schema or topo changes, version gets bumped and nodes know to reject queries and update their info from the MDS instead of querying it every time.