Documentation ¶
Overview ¶
Copyright 2021 Molecula Corp. All rights reserved.
Package queryer provides the core query-related structs.
Index ¶
- Constants
- Variables
- func NewServerlessTranslator(controller dax.Controller) *serverlessTranslator
- type Config
- type Error
- type Queryer
- func (q *Queryer) Logger() logger.Logger
- 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 io.Reader) (*featurebase.WireQueryResponse, error)
- func (q *Queryer) SetController(controller dax.Controller) error
- func (q *Queryer) Start() error
- type ServerlessTopology
- type Topologer
- type Translator
Constants ¶
const ( FieldTypeSet = "set" FieldTypeInt = "int" FieldTypeTime = "time" FieldTypeMutex = "mutex" FieldTypeBool = "bool" FieldTypeDecimal = "decimal" FieldTypeTimestamp = "timestamp" )
Field types.
const ErrFragmentNotFound = Error("fragment not found")
const ErrViewNotFound = Error("view not found")
Variables ¶
var ErrFieldNotFound error = dax.NewErrFieldDoesNotExist("")
Functions ¶
func NewServerlessTranslator ¶ added in v3.30.0
func NewServerlessTranslator(controller dax.Controller) *serverlessTranslator
Types ¶
type Config ¶
type Config struct { ControllerAddress string `toml:"controller-address"` Logger logger.Logger `toml:"-"` }
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 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 io.Reader) (*featurebase.WireQueryResponse, error)
func (*Queryer) SetController ¶ added in v3.29.0
func (q *Queryer) SetController(controller dax.Controller) error
type ServerlessTopology ¶ added in v3.30.0
type ServerlessTopology struct {
// contains filtered or unexported fields
}
func (*ServerlessTopology) ComputeNodes ¶ added in v3.30.0
func (m *ServerlessTopology) ComputeNodes(ctx context.Context, index string, shards []uint64) ([]dax.ComputeNode, 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) }
Translator serves the translation portion of a query request. 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 Controller instead of querying it every time.