aoe

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: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	DB *aoedb.DB
	// contains filtered or unexported fields
}

Storage memory storage

func NewStorage

func NewStorage(dir string, feature storage.Feature) (*Storage, error)

NewStorage returns pebble kv store on a default options

func NewStorageWithOptions

func NewStorageWithOptions(dir string, feature storage.Feature, opts *store.Options) (*Storage, error)

NewStorageWithOptions returns badger kv store

func (*Storage) Append

func (s *Storage) Append(index uint64, offset int, batchSize int, shardId uint64, cmd []byte, key []byte) (uint64, int64, []byte)

Append appends batch in the table

func (*Storage) ApplySnapshot

func (s *Storage) ApplySnapshot(shardID uint64, path string) error

ApplySnapshot apply the snapshot in the storage

func (*Storage) Close

func (s *Storage) Close() error

Close closes the storage.

func (*Storage) CreateSnapshot

func (s *Storage) CreateSnapshot(shardID uint64, path string) error

CreateSnapshot create a snapshot

func (*Storage) Feature

func (s *Storage) Feature() storage.Feature

func (*Storage) GetInitialStates

func (s *Storage) GetInitialStates() ([]metapb.ShardMetadata, error)

func (*Storage) GetPersistentLogIndex

func (s *Storage) GetPersistentLogIndex(shardID uint64) (uint64, error)

func (*Storage) GetShardPesistedId

func (s *Storage) GetShardPesistedId(shardId uint64) uint64

GetShardPesistedId returns the smallest segmente id among the tables starts with prefix

func (*Storage) GetSnapshot

func (s *Storage) GetSnapshot(ctx *dbi.GetSnapshotCtx) (*handle.Snapshot, error)

GetSnapshot gets the snapshot from the table. If there's no segment, it returns an empty snapshot.

func (*Storage) IsTablesSame

func (s *Storage) IsTablesSame(s2 *Storage, sid uint64) bool

for test

func (*Storage) NewWriteBatch

func (s *Storage) NewWriteBatch() storage.Resetable

func (*Storage) Read

func (s *Storage) Read(ctx storage.ReadContext) ([]byte, error)

func (*Storage) ReadAll

func (s *Storage) ReadAll(sid uint64, tbl string) ([]*batch.Batch, error)

for test

func (*Storage) Relation

func (s *Storage) Relation(dbname, tabletName string) (*aoedb.Relation, error)

Relation returns a relation of the db and the table

func (*Storage) RemoveShard

func (s *Storage) RemoveShard(shard metapb.Shard, removeData bool) error

func (*Storage) SaveShardMetadata

func (s *Storage) SaveShardMetadata(metadatas []metapb.ShardMetadata) error

func (*Storage) Split

func (s *Storage) Split(old metapb.ShardMetadata, news []metapb.ShardMetadata, ctx []byte) error

func (*Storage) SplitCheck

func (s *Storage) SplitCheck(shard metapb.Shard, size uint64) (currentApproximateSize uint64,
	currentApproximateKeys uint64, splitKeys [][]byte, ctx []byte, err error)

SplitCheck checks before the split

func (*Storage) Stats

func (s *Storage) Stats() stats.Stats

Stats returns the stats of the Storage

func (*Storage) Sync

func (s *Storage) Sync(ids []uint64) error

func (*Storage) TotalRows

func (s *Storage) TotalRows(sid uint64) (rows uint64, err error)

for test

func (*Storage) Write

func (s *Storage) Write(ctx storage.WriteContext) error

Jump to

Keyboard shortcuts

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