示例#1
0
 public static RedisInstanceOperation SlaveTo(RedisInstance instance, RedisInstance newMaster) =>
 new RedisInstanceOperation
 {
     Command   = InstanceCommandType.SlaveTo,
     Instance  = instance,
     NewMaster = newMaster
 };
示例#2
0
 public bool Equals(RedisInstance other)
 {
     if (other == null)
     {
         return(false);
     }
     return(Host == other.Host && Port == other.Port);
 }
示例#3
0
 public RedisAnalyzer(RedisInstance instance)
 {
     Instance    = instance;
     KeyMatchers = instance.ConnectionInfo.Settings.AnalysisRegexes
                   .Where(r => r.Value.HasValue())
                   .Select(r => new KeyMatcher {
         Name = r.Key, Regex = new Regex(r.Value, RegexOptions.Compiled)
     })
                   .ToList();
     KeyMatchers.Add(new KeyMatcher {
         Name = "Other (unrecognized)", Regex = new Regex(".", RegexOptions.Compiled)
     });
 }
示例#4
0
 public RedisInstance GetServer()
 {
     return(RedisInstance.Get(Port, IPAddress));
 }
示例#5
0
 public static RedisInstanceOperation MakeMaster(RedisInstance instance) =>
 new RedisInstanceOperation
 {
     Command  = InstanceCommandType.MakeMaster,
     Instance = instance
 };