private SlaveInstance MasterToSlave(MasterInstance master) { var group = master.Group; var newSlave = new SlaveInstance(group) { EndPoint = master.EndPoint, }; newSlave.CopyFrom(master); redisInstancesDict[newSlave.EndPoint.ToString()] = newSlave; group.AddSlave(newSlave); Console.WriteLine("modify {0} from master to slave in momery", master.EndPoint); return(newSlave); }
private MasterInstance SlaveToMaster(SlaveInstance slave) { var group = slave.Group; var newMaster = new MasterInstance(group) { EndPoint = slave.EndPoint, }; newMaster.CopyFrom(slave); redisInstancesDict[newMaster.EndPoint.ToString()] = newMaster; group.SetCurrentMaster(newMaster); group.RemoveSlave(slave); Console.WriteLine("modify {0} from slave to master in momery", slave.EndPoint); return(newMaster); }
private SlaveInstance MasterToSlave(MasterInstance master) { var group = master.Group; var newSlave = new SlaveInstance(group) { EndPoint = master.EndPoint, }; newSlave.CopyFrom(master); redisInstancesDict[newSlave.EndPoint.ToString()] = newSlave; group.AddSlave(newSlave); Console.WriteLine("modify {0} from master to slave in momery", master.EndPoint); return newSlave; }
private MasterInstance SlaveToMaster(SlaveInstance slave) { var group = slave.Group; var newMaster = new MasterInstance(group) { EndPoint = slave.EndPoint, }; newMaster.CopyFrom(slave); redisInstancesDict[newMaster.EndPoint.ToString()] = newMaster; group.SetCurrentMaster(newMaster); group.RemoveSlave(slave); Console.WriteLine("modify {0} from slave to master in momery", slave.EndPoint); return newMaster; }
public void SetCurrentMaster(MasterInstance master) { Master = master; }