Documentation
¶
Index ¶
- type BlockStatus
- type Config
- type MigrationProgress
- type Migrator
- func (m *Migrator) GetHashes() map[uint][sha256.Size]byte
- func (m *Migrator) GetLatestDirty() []uint
- func (m *Migrator) GetLatestDirtyFunc(getter func() []uint) []uint
- func (m *Migrator) GetMetrics() *MigrationProgress
- func (m *Migrator) Migrate(numBlocks int) error
- func (m *Migrator) MigrateDirty(blocks []uint) error
- func (m *Migrator) MigrateDirtyWithID(blocks []uint, tid uint64) error
- func (m *Migrator) SetMigratedBlock(block int)
- func (m *Migrator) SetSourceMapped(ms *modules.MappedStorage, ...)
- func (m *Migrator) Unlock()
- func (m *Migrator) WaitForCompletion() error
- type SyncConfig
- type Syncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockStatus ¶ added in v0.1.0
type Config ¶ added in v0.1.0
type Config struct { Logger types.Logger BlockSize int LockerHandler func() UnlockerHandler func() ErrorHandler func(b *storage.BlockInfo, err error) ProgressHandler func(p *MigrationProgress) ProgressRateLimit time.Duration BlockHandler func(b *storage.BlockInfo, id uint64, block []byte) Concurrency map[int]int Integrity bool CancelWrites bool DedupeWrites bool RecentWriteAge time.Duration }
func (*Config) WithBlockSize ¶ added in v0.1.0
type MigrationProgress ¶
type MigrationProgress struct { BlockSize int TotalBlocks int // Total blocks MigratedBlocks int // Number of blocks that have been migrated MigratedBlocksPerc float64 ReadyBlocks int // Number of blocks which are up to date (clean). May go down as well as up. ReadyBlocksPerc float64 ActiveBlocks int // Number of blocks in progress now TotalCanceledBlocks int // Total blocks that were cancelled TotalMigratedBlocks int // Total blocks that were migrated TotalDuplicatedBlocks int }
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
func NewMigrator(source storage.TrackingProvider, dest storage.Provider, blockOrder storage.BlockOrder, config *Config) (*Migrator, error)
func (*Migrator) GetLatestDirty ¶
*
- Get the latest dirty blocks.
- If there a no more dirty blocks, we leave the src locked.
func (*Migrator) GetLatestDirtyFunc ¶ added in v0.0.5
*
- Get the latest dirty blocks.
- If there a no more dirty blocks, we leave the src locked.
func (*Migrator) GetMetrics ¶ added in v0.1.5
func (m *Migrator) GetMetrics() *MigrationProgress
*
- Get overall status of the migration *
func (*Migrator) MigrateDirty ¶
*
- MigrateDirty migrates a list of dirty blocks.
- An attempt is made to cancel any existing writes for the blocks first.
func (*Migrator) MigrateDirtyWithID ¶ added in v0.1.0
*
* * You can give a tracking ID which will turn up at block_fn on success
func (*Migrator) SetSourceMapped ¶ added in v0.0.6
func (m *Migrator) SetSourceMapped(ms *modules.MappedStorage, writer func([]byte, int64, map[uint64]uint64) (int, error))
*
- Set a MappedStorage for the source. *
func (*Migrator) WaitForCompletion ¶
type SyncConfig ¶ added in v0.0.10
type SyncConfig struct { Logger types.Logger Name string Tracker *dirtytracker.Remote // A dirty block tracker Lockable storage.LockableProvider // Lockable LockerHandler func() UnlockerHandler func() Destination storage.Provider Orderer storage.BlockOrder DirtyCheckPeriod time.Duration DirtyBlockGetter func() []uint BlockSize int HashesHandler func(map[uint][32]byte) ProgressHandler func(p *MigrationProgress) ProgressRateLimit time.Duration ErrorHandler func(b *storage.BlockInfo, err error) Concurrency map[int]int Integrity bool CancelWrites bool DedupeWrites bool }
type Syncer ¶ added in v0.0.10
type Syncer struct {
// contains filtered or unexported fields
}
func (*Syncer) GetMetrics ¶ added in v0.1.5
func (s *Syncer) GetMetrics() *MigrationProgress
func (*Syncer) GetSafeBlockMap ¶ added in v0.0.10
*
- Get a list of blocks that are safe (On the destination)
- NB This does not include the very latest dirty list, but it's a good starting point.
Click to show internal directories.
Click to hide internal directories.