Documentation
¶
Index ¶
- type Storage
- func (s *Storage) Append(index uint64, offset int, batchSize int, shardId uint64, cmd []byte, ...) (uint64, int64, []byte)
- func (s *Storage) ApplySnapshot(shardID uint64, path string) error
- func (s *Storage) Close() error
- func (s *Storage) CreateSnapshot(shardID uint64, path string) error
- func (s *Storage) Feature() storage.Feature
- func (s *Storage) GetInitialStates() ([]metapb.ShardMetadata, error)
- func (s *Storage) GetPersistentLogIndex(shardID uint64) (uint64, error)
- func (s *Storage) GetShardPesistedId(shardId uint64) uint64
- func (s *Storage) GetSnapshot(ctx *dbi.GetSnapshotCtx) (*handle.Snapshot, error)
- func (s *Storage) IsTablesSame(s2 *Storage, sid uint64) bool
- func (s *Storage) NewWriteBatch() storage.Resetable
- func (s *Storage) Read(ctx storage.ReadContext) ([]byte, error)
- func (s *Storage) ReadAll(sid uint64, tbl string) ([]*batch.Batch, error)
- func (s *Storage) Relation(dbname, tabletName string) (*aoedb.Relation, error)
- func (s *Storage) RemoveShard(shard metapb.Shard, removeData bool) error
- func (s *Storage) SaveShardMetadata(metadatas []metapb.ShardMetadata) error
- func (s *Storage) Split(old metapb.ShardMetadata, news []metapb.ShardMetadata, ctx []byte) error
- func (s *Storage) SplitCheck(shard metapb.Shard, size uint64) (currentApproximateSize uint64, currentApproximateKeys uint64, ...)
- func (s *Storage) Stats() stats.Stats
- func (s *Storage) Sync(ids []uint64) error
- func (s *Storage) TotalRows(sid uint64) (rows uint64, err error)
- func (s *Storage) Write(ctx storage.WriteContext) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
Storage memory storage
func NewStorage ¶
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 ¶
ApplySnapshot apply the snapshot in the storage
func (*Storage) CreateSnapshot ¶
CreateSnapshot create a snapshot
func (*Storage) GetInitialStates ¶
func (s *Storage) GetInitialStates() ([]metapb.ShardMetadata, error)
func (*Storage) GetPersistentLogIndex ¶
func (*Storage) GetShardPesistedId ¶
GetShardPesistedId returns the smallest segmente id among the tables starts with prefix
func (*Storage) GetSnapshot ¶
GetSnapshot gets the snapshot from the table. If there's no segment, it returns an empty snapshot.
func (*Storage) IsTablesSame ¶
for test
func (*Storage) NewWriteBatch ¶
func (*Storage) RemoveShard ¶
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
Click to show internal directories.
Click to hide internal directories.