Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrUnhandledWorkerEvent ¶
type ErrUnhandledWorkerEvent struct {
Evt string
}
ErrUnhandledWorkerEvent is a typed error that replicator can return if it receives any unhandled event
func NewUnhandledEvtErr ¶
func NewUnhandledEvtErr(evt string) *ErrUnhandledWorkerEvent
NewUnhandledEvtErr returns an unhandled type error. TODO move this to errors package once we enable monitoring to capture err counts
func (*ErrUnhandledWorkerEvent) Error ¶
func (e *ErrUnhandledWorkerEvent) Error() string
type MigrationEvent ¶
type MigrationEvent struct {
// contains filtered or unexported fields
}
MigrationEvent captures unit work of replication based on the key, value and the event type. SET/DEL
func (*MigrationEvent) Do ¶
func (m *MigrationEvent) Do(workerID int) (err error)
Do implements the core business logic of migration. We ensure a single instance of worker active. TODO investigate if the we can take fine grained lock per keys. This will improve locking performance.
func (*MigrationEvent) String ¶
func (m *MigrationEvent) String() string
type Replicator ¶
Replicator implements redis migration
func NewReplicator ¶
func NewReplicator(log *logrus.Entry, srcAddr, dstAddr string, workerCount int) (*Replicator, error)
NewReplicator returns an instantiated replicator instance
func (*Replicator) Close ¶
func (r *Replicator) Close()
Close cleans up the src and dst redis client conn handlers.
func (*Replicator) Migrate ¶
func (r *Replicator) Migrate() error
Migrate migrates all new key values to dest redis