aoedb

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IDToNameFactory = new(idToNameFactory)

Functions

This section is empty.

Types

type AppendCtx

type AppendCtx struct {
	TableMutationCtx
	Data *batch.Batch
}

func (*AppendCtx) ToLogIndex

func (ctx *AppendCtx) ToLogIndex(database *metadata.Database) *db.LogIndex

type ApplySnapshotCtx

type ApplySnapshotCtx struct {
	DB   string
	Path string
}

type CreateDBCtx

type CreateDBCtx = DBMutationCtx

type CreateIndexCtx

type CreateIndexCtx struct {
	DBMutationCtx
	Table   string
	Indices *db.IndexSchema
}

type CreateSnapshotCtx

type CreateSnapshotCtx struct {
	DB   string
	Path string
	Sync bool
}

type CreateTableCtx

type CreateTableCtx struct {
	DBMutationCtx
	Schema *db.TableSchema
	Indice *db.IndexSchema
}

type DB

type DB struct {
	Impl
}

func Open

func Open(dirname string, opts *storage.Options) (inst *DB, err error)

func (*DB) Append

func (d *DB) Append(ctx *AppendCtx) (err error)

func (*DB) ApplySnapshot

func (d *DB) ApplySnapshot(ctx *ApplySnapshotCtx) error

func (*DB) CreateDatabase

func (d *DB) CreateDatabase(ctx *CreateDBCtx) (*metadata.Database, error)

FIXME: Log index first. Since the shard is should be defined first, we have to prepare create first to get a shard id and then use the shard id to log wal

func (*DB) CreateIndex

func (d *DB) CreateIndex(ctx *CreateIndexCtx) error

func (*DB) CreateSnapshot

func (d *DB) CreateSnapshot(ctx *CreateSnapshotCtx) (uint64, error)

func (*DB) CreateTable

func (d *DB) CreateTable(ctx *CreateTableCtx) (*metadata.Table, error)

func (*DB) DropDatabase

func (d *DB) DropDatabase(ctx *DropDBCtx) (*metadata.Database, error)

func (*DB) DropIndex

func (d *DB) DropIndex(ctx *DropIndexCtx) error

func (*DB) DropTable

func (d *DB) DropTable(ctx *DropTableCtx) (*metadata.Table, error)

func (*DB) ExecSplitDatabase

func (d *DB) ExecSplitDatabase(ctx *ExecSplitCtx) error

func (*DB) PrepareSplitDatabase

func (d *DB) PrepareSplitDatabase(ctx *PrepareSplitCtx) (uint64, uint64, [][]byte, []byte, error)

func (*DB) Relation

func (d *DB) Relation(dbName, tableName string) (*Relation, error)

type DBMutationCtx

type DBMutationCtx struct {
	ID     uint64
	Offset int
	Size   int
	DB     string
}

func (*DBMutationCtx) ToLogIndex

func (ctx *DBMutationCtx) ToLogIndex(database *metadata.Database) *db.LogIndex

type DBNameFactory

type DBNameFactory interface {
	Encode(interface{}) string
	Decode(string) interface{}
}

type DropDBCtx

type DropDBCtx = DBMutationCtx

type DropIndexCtx

type DropIndexCtx struct {
	DBMutationCtx
	Table      string
	IndexNames []string
}

type DropTableCtx

type DropTableCtx = TableMutationCtx

type ExecSplitCtx

type ExecSplitCtx struct {
	DBMutationCtx
	NewNames    []string
	RenameTable db.RenameTableFactory
	SplitKeys   [][]byte
	SplitCtx    []byte
}

type Impl

type Impl = db.DB

type PrepareSplitCtx

type PrepareSplitCtx struct {
	DB   string
	Size uint64
}

type Relation

type Relation struct {
	Data   iface.ITableData
	DBImpl *DB
	Meta   *md.Table
	// contains filtered or unexported fields
}

Relation is a high-level abstraction provided for the upper layer, contains the table data, schema, and the segments it refers to.

func NewRelation

func NewRelation(impl *DB, data iface.ITableData, meta *md.Table) *Relation

func (*Relation) Attribute

func (r *Relation) Attribute() []engine.Attribute

func (*Relation) Close

func (r *Relation) Close() error

func (*Relation) ID

func (r *Relation) ID() string

func (*Relation) Index

func (r *Relation) Index() []*engine.IndexTableDef

func (*Relation) Rows

func (r *Relation) Rows() int64

func (*Relation) Segment

func (r *Relation) Segment(id uint64) aoe.Segment

func (*Relation) SegmentIds

func (r *Relation) SegmentIds() dbi.IDS

func (*Relation) Size

func (r *Relation) Size(attr string) int64

func (*Relation) Write

func (r *Relation) Write(ctx *AppendCtx) error

type TableMutationCtx

type TableMutationCtx struct {
	DBMutationCtx
	Table string
}

Jump to

Keyboard shortcuts

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