// public void SwapPrimaryReplica(String oldPrimaryUrl, String newReplicaUrl) { ServerPair pair = GetRowGivenPrimary(oldPrimaryUrl).GetServerPair(); pair.SetPrimary(pair.GetReplica()); pair.SetReplica(newReplicaUrl); }
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); }
public string GetReplicaEndpoint(int uid) { ServerPair pair = lookupTable.GetServerPair(uid); return(pair == null ? null : pair.GetReplica()); }