Inheritance: RedisInstanceBase
Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
 public void SetCurrentMaster(MasterInstance master)
 {
     Master = master;
 }