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

            pair.SetPrimary(pair.GetReplica());
            pair.SetReplica(newReplicaUrl);
        }
Exemple #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);
        }
Exemple #3
0
        public string GetReplicaEndpoint(int uid)
        {
            ServerPair pair = lookupTable.GetServerPair(uid);

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