Documentation
¶
Index ¶
- Variables
- type DMap
- type Loader
- type OpLog
- type Snapshot
- func (s *Snapshot) DestroyDMap(dkey []byte, partID uint64, name string) error
- func (s *Snapshot) NewLoader(dkey []byte) (*Loader, error)
- func (s *Snapshot) RegisterDMap(dkey []byte, partID uint64, name string, str *storage.Storage) (*OpLog, error)
- func (s *Snapshot) Shutdown() error
- func (s *Snapshot) UnregisterDMap(dkey []byte, partID uint64, name string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrLoaderDone indicates that no more value left in the snapshot to restore. ErrLoaderDone = errors.New("loader done") // ErrFirstRun indicates that there is no key in the snapshot to restore. Run for the first time. ErrFirstRun = errors.New("first run") )
View Source
var ( // PrimaryDMapKey is the key on Badger for registered DMap names on partitions. PrimaryDMapKey = []byte("primary-dmap-key") // BackupDMapKey is the key on Badger for registered DMap names on backups. BackupDMapKey = []byte("backup-dmap-key") )
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader implements an iterator like mechanism to restore dmaps from snapshot.
type OpLog ¶
OpLog defines operation log.
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot implements a low-latency snapshot engine with BadgerDB.
func New ¶
func New(opt *badger.Options, snapshotInterval, gcInterval time.Duration, gcDiscardRatio float64, logger *log.Logger) (*Snapshot, error)
New creates and returns a new Snapshot.
func (*Snapshot) DestroyDMap ¶
DestroyDMap destroys a dmap's hkeys and releated data on the snapshot.
func (*Snapshot) RegisterDMap ¶
func (s *Snapshot) RegisterDMap(dkey []byte, partID uint64, name string, str *storage.Storage) (*OpLog, error)
RegisterDMap registers given DMap to the snapshot instance, creates a new worker for its partition if needed and returns an OpLog.
Click to show internal directories.
Click to hide internal directories.