queryer

package
v3.35.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Copyright 2021 Molecula Corp. All rights reserved.

Package queryer provides the core query-related structs.

Index

Constants

View Source
const (
	FieldTypeSet       = "set"
	FieldTypeInt       = "int"
	FieldTypeTime      = "time"
	FieldTypeMutex     = "mutex"
	FieldTypeBool      = "bool"
	FieldTypeDecimal   = "decimal"
	FieldTypeTimestamp = "timestamp"
)

Field types.

View Source
const ErrFragmentNotFound = Error("fragment not found")
View Source
const ErrViewNotFound = Error("view not found")

Variables

View Source
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 Error

type Error string // TODO(jaffee) convert to standard error package

func (Error) Error

func (e Error) Error() string

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 New

func New(cfg Config) *Queryer

New returns a new instance of Queryer.

func (*Queryer) Logger added in v3.35.0

func (q *Queryer) Logger() logger.Logger

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 (*Queryer) QuerySQL

func (*Queryer) SetController added in v3.29.0

func (q *Queryer) SetController(controller dax.Controller) error

func (*Queryer) Start

func (q *Queryer) Start() 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 Topologer

type Topologer interface {
	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.

Directories

Path Synopsis
Package client is an HTTP client for the Queryer.
Package client is an HTTP client for the Queryer.

Jump to

Keyboard shortcuts

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