engine

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyDefaultExpr = DefaultExpr{Exist: false}

EmptyDefaultExpr means there is no definition for default expr

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name    string      // name of attribute
	Alg     compress.T  // compression algorithm
	Type    types.Type  // type of attribute
	Default DefaultExpr // default value of this attribute.
	Primary bool        // if true, it is primary key
}

func (*Attribute) Format

func (node *Attribute) Format(buf *bytes.Buffer)

func (Attribute) GetDefaultExpr

func (node Attribute) GetDefaultExpr() (interface{}, bool)

func (Attribute) HasDefaultExpr

func (node Attribute) HasDefaultExpr() bool

type AttributeDef

type AttributeDef struct {
	Attr Attribute
}

func (*AttributeDef) Format

func (node *AttributeDef) Format(buf *bytes.Buffer)

type CommentDef

type CommentDef struct {
	Comment string
}

type Database

type Database interface {
	Relations(Snapshot) []string
	Relation(string, Snapshot) (Relation, error)

	Delete(uint64, string, Snapshot) error
	Create(uint64, string, []TableDef, Snapshot) error // Create Table - (name, table define)
}

type DefaultExpr

type DefaultExpr struct {
	Exist  bool
	Value  interface{} // int64, float32, float64, string, types.Date, types.Datetime
	IsNull bool
}

func MakeDefaultExpr

func MakeDefaultExpr(exist bool, value interface{}, isNull bool) DefaultExpr

MakeDefaultExpr returns a new DefaultExpr

type Engine

type Engine interface {
	Delete(uint64, string, Snapshot) error
	Create(uint64, string, int, Snapshot) error // Create Database - (name, engine type)

	Databases(Snapshot) []string
	Database(string, Snapshot) (Database, error)

	Node(string, Snapshot) *NodeInfo
}

type Filter

type Filter interface {
	Eq(string, interface{}) (*roaring.Bitmap, error)
	Ne(string, interface{}) (*roaring.Bitmap, error)
	Lt(string, interface{}) (*roaring.Bitmap, error)
	Le(string, interface{}) (*roaring.Bitmap, error)
	Gt(string, interface{}) (*roaring.Bitmap, error)
	Ge(string, interface{}) (*roaring.Bitmap, error)
	Btw(string, interface{}, interface{}) (*roaring.Bitmap, error)
}

type IndexT

type IndexT int
const (
	Invalid IndexT = iota
	ZoneMap
	BsiIndex
)

func (IndexT) ToString

func (node IndexT) ToString() string

type IndexTableDef

type IndexTableDef struct {
	Typ      IndexT
	ColNames []string
	Name     string
}

func (*IndexTableDef) Format

func (node *IndexTableDef) Format(buf *bytes.Buffer)

type Node

type Node struct {
	Id   string `json:"id"`
	Addr string `json:"address"`
	Data []byte `json:"payload"`
}

type NodeInfo

type NodeInfo struct {
	Mcpu int
}

type Nodes

type Nodes []Node

type PrimaryIndexDef

type PrimaryIndexDef struct {
	TableDef
	Names []string
}

func (*PrimaryIndexDef) Format

func (node *PrimaryIndexDef) Format(buf *bytes.Buffer)

type PropertiesDef

type PropertiesDef struct {
	TableDef
	Properties []Property
}

type Property

type Property struct {
	Key   string
	Value string
}

type Reader

type Reader interface {
	Read([]uint64, []string) (*batch.Batch, error)
}

type Relation

type Relation interface {
	Statistics

	Close(Snapshot)

	ID(Snapshot) string

	Nodes(Snapshot) Nodes

	TableDefs(Snapshot) []TableDef

	GetPrimaryKeys(Snapshot) []*Attribute

	GetHideKey(Snapshot) *Attribute
	// true: primary key, false: hide key
	GetPriKeyOrHideKey(Snapshot) ([]Attribute, bool)

	Write(uint64, *batch.Batch, Snapshot) error

	Update(uint64, *batch.Batch, Snapshot) error

	Delete(uint64, *vector.Vector, string, Snapshot) error

	Truncate(Snapshot) (uint64, error)

	AddTableDef(uint64, TableDef, Snapshot) error
	DelTableDef(uint64, TableDef, Snapshot) error

	// first argument is the number of reader, second argument is the filter extend,  third parameter is the payload required by the engine
	NewReader(int, *plan.Expr, []byte, Snapshot) []Reader
}

type Snapshot added in v0.5.0

type Snapshot []byte

type SparseFilter

type SparseFilter interface {
	Eq(string, interface{}) (Reader, error)
	Ne(string, interface{}) (Reader, error)
	Lt(string, interface{}) (Reader, error)
	Le(string, interface{}) (Reader, error)
	Gt(string, interface{}) (Reader, error)
	Ge(string, interface{}) (Reader, error)
	Btw(string, interface{}, interface{}) (Reader, error)
}

type Statistics

type Statistics interface {
	Rows() int64
	Size(string) int64
}

type Summarizer

type Summarizer interface {
	Count(string, *roaring.Bitmap) (uint64, error)
	NullCount(string, *roaring.Bitmap) (uint64, error)
	Max(string, *roaring.Bitmap) (interface{}, error)
	Min(string, *roaring.Bitmap) (interface{}, error)
	Sum(string, *roaring.Bitmap) (int64, uint64, error)
}

type TableDef

type TableDef interface {
	// contains filtered or unexported methods
}

Directories

Path Synopsis
kv
tae
db
mergesort/bools
Package heap provides heap operations for any type that implements heap.Interface.
Package heap provides heap operations for any type that implements heap.Interface.
mergesort/decimal128s
Package heap provides heap operations for any type that implements heap.Interface.
Package heap provides heap operations for any type that implements heap.Interface.
mergesort/numerics
Package heap provides heap operations for any type that implements heap.Interface.
Package heap provides heap operations for any type that implements heap.Interface.
mergesort/varchar
Package heap provides heap operations for any type that implements heap.Interface.
Package heap provides heap operations for any type that implements heap.Interface.
stl
wal

Jump to

Keyboard shortcuts

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