broker

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMergeNode

func NewMergeNode(agg common.AggType) common.MergeNode

func NewQueryExecutor

NewQueryExecutor creates a new QueryExecutor

Types

type AggQueryPlan

type AggQueryPlan struct {
	// contains filtered or unexported fields
}

AggQueryPlan is the plan for aggregate queries

func NewAggQueryPlan

func NewAggQueryPlan(qc *QueryContext, topo topology.HealthTrackingDynamicTopoloy, client dataCli.DataNodeQueryClient) (plan *AggQueryPlan, err error)

NewAggQueryPlan creates a new agg query plan

func (*AggQueryPlan) Execute

func (ap *AggQueryPlan) Execute(ctx context.Context, w http.ResponseWriter) (err error)

type BlockingScanNode

type BlockingScanNode struct {
	// contains filtered or unexported fields
}

BlockingScanNode is a BlockingPlanNode that handles rpc calls to fetch data from datanode

func (*BlockingScanNode) Add

func (bpn *BlockingScanNode) Add(nodes ...common.BlockingPlanNode)

func (*BlockingScanNode) Children

func (bpn *BlockingScanNode) Children() []common.BlockingPlanNode

func (*BlockingScanNode) Execute

func (sn *BlockingScanNode) Execute(ctx context.Context) (result queryCom.AQLQueryResult, err error)

type BrokerAQLRequest

type BrokerAQLRequest struct {
	// in: query
	Verbose int `query:"verbose,optional" json:"verbose"`
	// in: query
	Debug int `query:"debug,optional" json:"debug"`
	// in: header
	Accept string `header:"Accept,optional" json:"accept"`
	// in: header
	Origin string `header:"Rpc-Caller,optional" json:"origin"`
	// in: body
	Body struct {
		Query queryCom.AQLQuery `json:"query"`
	} `body:""`
}

BrokerAQLRequest represents AQL query request. Debug mode will run **each batch** in synchronized mode and report time for each step. swagger:parameters querySQL

type BrokerSQLRequest

type BrokerSQLRequest struct {
	// in: query
	Verbose int `query:"verbose,optional" json:"verbose"`
	// in: query
	Debug int `query:"debug,optional" json:"debug"`
	// in: header
	Accept string `header:"Accept,optional" json:"accept"`
	// in: header
	Origin string `header:"Rpc-Caller,optional" json:"origin"`
	// in: body
	Body struct {
		Query string `json:"query"`
	} `body:""`
}

BrokerSQLRequest represents SQL query request. Debug mode will run **each batch** in synchronized mode and report time for each step. swagger:parameters querySQL

type BrokerSchemaMutator

type BrokerSchemaMutator struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

BrokerSchemaMutator implements metastore.TableSchemaMutator and memstore.TableSchemaReader, and memstore.EnumUpdater

func NewBrokerSchemaMutator

func NewBrokerSchemaMutator() *BrokerSchemaMutator

func (*BrokerSchemaMutator) AddColumn

func (b *BrokerSchemaMutator) AddColumn(table string, column common.Column, appendToArchivingSortOrder bool) (err error)

func (*BrokerSchemaMutator) CreateTable

func (b *BrokerSchemaMutator) CreateTable(table *common.Table) (err error)

func (*BrokerSchemaMutator) DeleteColumn

func (b *BrokerSchemaMutator) DeleteColumn(table string, column string) (err error)

func (*BrokerSchemaMutator) DeleteTable

func (b *BrokerSchemaMutator) DeleteTable(name string) (err error)

func (*BrokerSchemaMutator) GetSchema

func (b *BrokerSchemaMutator) GetSchema(table string) (*memCom.TableSchema, error)

==== memstore/common.TableSchemaReader ====

func (*BrokerSchemaMutator) GetSchemas

func (b *BrokerSchemaMutator) GetSchemas() map[string]*memCom.TableSchema

func (*BrokerSchemaMutator) GetTable

func (b *BrokerSchemaMutator) GetTable(name string) (table *common.Table, err error)

func (*BrokerSchemaMutator) ListTables

func (b *BrokerSchemaMutator) ListTables() (tables []string, err error)

==== metastore/common.TableSchemaMutator ====

func (*BrokerSchemaMutator) UpdateColumn

func (b *BrokerSchemaMutator) UpdateColumn(table string, column string, config common.ColumnConfig) (err error)

func (*BrokerSchemaMutator) UpdateEnum

func (b *BrokerSchemaMutator) UpdateEnum(table, column string, enumList []string) error

func (*BrokerSchemaMutator) UpdateTable

func (b *BrokerSchemaMutator) UpdateTable(table common.Table) (err error)

func (*BrokerSchemaMutator) UpdateTableConfig

func (b *BrokerSchemaMutator) UpdateTableConfig(table string, config common.TableConfig) (err error)

type NonAggQueryPlan

type NonAggQueryPlan struct {
	// contains filtered or unexported fields
}

NonAggQueryPlan implements QueryPlan

func (*NonAggQueryPlan) Execute

func (nqp *NonAggQueryPlan) Execute(ctx context.Context, w http.ResponseWriter) (err error)

type QueryContext

type QueryContext struct {
	AQLQuery              *common.AQLQuery
	IsNonAggregationQuery bool
	ReturnHLLBinary       bool
	Writer                http.ResponseWriter
	Error                 error
	Tables                []*memCom.TableSchema
	TableIDByAlias        map[string]int
	TableSchemaByName     map[string]*memCom.TableSchema

	NumDimsPerDimWidth common.DimCountsPerDimWidth
	// lookup table from enum dimension index to EnumDict, used for postprocessing
	DimensionEnumReverseDicts map[int][]string
	// this should be the same as generated by datanodes. in the future we should pass
	// it down to datanodes
	DimensionVectorIndex []int
	DimRowBytes          int
	RequestID            string
}

QueryContext is broker query context

func NewQueryContext

func NewQueryContext(aql *common.AQLQuery, returnHLLBinary bool, w http.ResponseWriter) *QueryContext

NewQueryContext creates new query context

func (*QueryContext) Compile

func (qc *QueryContext) Compile(tableSchemaReader memCom.TableSchemaReader)

Compile parses expressions into ast, load schema from schema reader, resolve types, and collects meta data needed by post processing

func (*QueryContext) Rewrite

func (qc *QueryContext) Rewrite(expression expr.Expr) expr.Expr

Rewrite walks the expresison AST and resolves data types bottom up. In addition it also translates enum strings and rewrites their predicates. TODO: remove dup in aql_compiler.go

type QueryHandler

type QueryHandler struct {
	// contains filtered or unexported fields
}

func NewQueryHandler

func NewQueryHandler(executor common.QueryExecutor, instanceID string) QueryHandler

func (*QueryHandler) HandleAQL

func (handler *QueryHandler) HandleAQL(w http.ResponseWriter, r *http.Request)

func (*QueryHandler) HandleSQL

func (handler *QueryHandler) HandleSQL(w http.ResponseWriter, r *http.Request)

func (*QueryHandler) Register

func (handler *QueryHandler) Register(router *mux.Router, wrappers ...utils.HTTPHandlerWrapper)

type StreamingScanNode

type StreamingScanNode struct {
	// contains filtered or unexported fields
}

StreamingScanNode implements StreamingPlanNode

func (*StreamingScanNode) Execute

func (ssn *StreamingScanNode) Execute(ctx context.Context) (bs []byte, err error)

Directories

Path Synopsis
mocks
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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