示例#1
0
        //
        public void SwapPrimaryReplica(String oldPrimaryUrl, String newReplicaUrl)
        {
            ServerPair pair = GetRowGivenPrimary(oldPrimaryUrl).GetServerPair();

            pair.SetPrimary(pair.GetReplica());
            pair.SetReplica(newReplicaUrl);
        }
示例#2
0
        public TableRow GetRowGivenReplica(String replicaUrl)
        {
            foreach (TableRow row in lookupTable)
            {
                ServerPair pair = row.GetServerPair();

                if (replicaUrl.Equals(pair.GetReplica()))
                {
                    return(row); //DEVIAMOS LANCAR EXCEPCAO CASO NAO EXISTA O MAIN SERVER.
                }
            }
            return(null);
        }
示例#3
0
        public string GetReplicaEndpoint(int uid)
        {
            ServerPair pair = lookupTable.GetServerPair(uid);

            return(pair == null ? null : pair.GetReplica());
        }