Documentation ¶
Index ¶
- func Dump(host, password, path string, databaseCount uint64, threadCount int)
- func Restore(host, password, path string, isSupportReplaceRestore bool)
- type DumpWorker
- type Dumper
- type Record
- type Restorer
- type SyncLauncher
- func (launcher *SyncLauncher) Launch()
- func (launcher *SyncLauncher) SetDatabaseCount(databaseCount uint64) *SyncLauncher
- func (launcher *SyncLauncher) SetDestinationHost(destinationHost string) *SyncLauncher
- func (launcher *SyncLauncher) SetDestinationPassword(destinationPassword string) *SyncLauncher
- func (launcher *SyncLauncher) SetIsSupportReplaceRestore(isSupportReplaceRestore bool) *SyncLauncher
- func (launcher *SyncLauncher) SetSourceHost(sourceHost string) *SyncLauncher
- func (launcher *SyncLauncher) SetSourcePassword(sourcePassword string) *SyncLauncher
- func (launcher *SyncLauncher) SetSyncTimes(syncTimes uint64) *SyncLauncher
- func (launcher *SyncLauncher) SetThreadCount(threadCount int) *SyncLauncher
- type SyncOneRound
- type SyncWorker
- type Synchronizer
- type TransferRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DumpWorker ¶
type DumpWorker struct { Client *redis.Client DatabaseId uint64 // contains filtered or unexported fields }
func (*DumpWorker) CloseClient ¶
func (dw *DumpWorker) CloseClient()
func (*DumpWorker) Dump ¶
func (dw *DumpWorker) Dump(key string) (err error)
type Dumper ¶
type Dumper struct { Host string Password string Client *redis.Client Path string DatabaseId uint64 Count atomic.Uint64 Stream *os.File ThreadCount int // contains filtered or unexported fields }
func (*Dumper) CloseClient ¶
func (d *Dumper) CloseClient()
func (*Dumper) PrintReport ¶
func (d *Dumper) PrintReport()
type Restorer ¶
type Restorer struct { Host string Password string Client map[uint64]*redis.Client Stream *os.File Count uint64 IsSupportReplaceRestore bool // contains filtered or unexported fields }
func (*Restorer) CloseClients ¶
func (r *Restorer) CloseClients()
func (*Restorer) CloseStream ¶
func (r *Restorer) CloseStream()
func (*Restorer) PrintReport ¶
func (r *Restorer) PrintReport()
type SyncLauncher ¶
type SyncLauncher struct { SourceHost string SourcePassword string DestinationHost string DestinationPassword string DatabaseCount uint64 SyncTimes uint64 ThreadCount int IsSupportReplaceRestore bool }
func (*SyncLauncher) Launch ¶
func (launcher *SyncLauncher) Launch()
func (*SyncLauncher) SetDatabaseCount ¶
func (launcher *SyncLauncher) SetDatabaseCount(databaseCount uint64) *SyncLauncher
func (*SyncLauncher) SetDestinationHost ¶
func (launcher *SyncLauncher) SetDestinationHost(destinationHost string) *SyncLauncher
func (*SyncLauncher) SetDestinationPassword ¶
func (launcher *SyncLauncher) SetDestinationPassword(destinationPassword string) *SyncLauncher
func (*SyncLauncher) SetIsSupportReplaceRestore ¶
func (launcher *SyncLauncher) SetIsSupportReplaceRestore(isSupportReplaceRestore bool) *SyncLauncher
func (*SyncLauncher) SetSourceHost ¶
func (launcher *SyncLauncher) SetSourceHost(sourceHost string) *SyncLauncher
func (*SyncLauncher) SetSourcePassword ¶
func (launcher *SyncLauncher) SetSourcePassword(sourcePassword string) *SyncLauncher
func (*SyncLauncher) SetSyncTimes ¶
func (launcher *SyncLauncher) SetSyncTimes(syncTimes uint64) *SyncLauncher
func (*SyncLauncher) SetThreadCount ¶
func (launcher *SyncLauncher) SetThreadCount(threadCount int) *SyncLauncher
type SyncOneRound ¶
type SyncOneRound struct { DatabaseId uint64 SourceClient *redis.Client DestinationClient *redis.Client KeysPipeline chan string DestinationKeysPipeline chan string Workers *lib.Workers ThreadCount int IsSupportReplace bool }
func (*SyncOneRound) CheckNotExistKeys ¶
func (round *SyncOneRound) CheckNotExistKeys() uint64
func (*SyncOneRound) InitChannel ¶
func (round *SyncOneRound) InitChannel()
func (*SyncOneRound) ReadDestinationKeys ¶
func (round *SyncOneRound) ReadDestinationKeys()
func (*SyncOneRound) ReadKeys ¶
func (round *SyncOneRound) ReadKeys()
func (*SyncOneRound) Sync ¶
func (round *SyncOneRound) Sync() (count uint64)
func (*SyncOneRound) SyncData ¶
func (round *SyncOneRound) SyncData() uint64
type SyncWorker ¶
type Synchronizer ¶
type Synchronizer struct {
Workers map[uint64]*SyncOneRound
}
func (*Synchronizer) Go ¶
func (s *Synchronizer) Go(syncTimes uint64)
func (*Synchronizer) InitClients ¶
func (s *Synchronizer) InitClients(sourceHost, sourcePassword, destinationHost, destinationPassword string, dbCount uint64, threadCount int, isSupportReplace bool)
Click to show internal directories.
Click to hide internal directories.