public static void ConfigAckPolicy(XmlElement xmlElem, string name, ref AckPolicy ackPolicy, bool compulsory) { XmlNode xmlNode = XMLReader.GetNode(xmlElem, name); if (xmlNode == null && compulsory == true) throw new ConfigNotFoundException(name); else if (xmlNode != null) { string policy = xmlNode.InnerText; if (policy == "ALL") ackPolicy = AckPolicy.ALL; else if (policy == "ALL_PEERS") ackPolicy = AckPolicy.ALL_PEERS; else if (policy == "NONE") ackPolicy = AckPolicy.NONE; else if (policy == "ONE") ackPolicy = AckPolicy.ONE; else if (policy == "ONE_PEER") ackPolicy = AckPolicy.ONE_PEER; else if (policy == "QUORUM") ackPolicy = AckPolicy.QUORUM; else throw new InvalidConfigException(name); } }
public RepConfig() { ackPolicy = AckPolicy.QUORUM; bulk = false; home = ""; localSite = new DbSiteConfig(); priority = 100; remoteSites = new List<DbSiteConfig>(); startPolicy = StartPolicy.ELECTION; verbose = false; }
public RepConfig() { ackPolicy = AckPolicy.QUORUM; bulk = false; home = ""; host = new ReplicationHostAddress(); priority = 100; remote = new List<RemoteSite>(); startPolicy = StartPolicy.ELECTION; totalSites = 0; verbose = false; }
public void SetRepMgrAckPolicy(string home, AckPolicy policy) { Configuration.ClearDir(home); DatabaseEnvironmentConfig envConfig = new DatabaseEnvironmentConfig(); envConfig.Create = true; envConfig.UseLocking = true; envConfig.UseLogging = true; envConfig.UseMPool = true; envConfig.UseReplication = true; envConfig.UseTxns = true; DatabaseEnvironment env = DatabaseEnvironment.Open( home, envConfig); if (policy != null) { env.RepMgrAckPolicy = policy; Assert.AreEqual(policy, env.RepMgrAckPolicy); } env.Close(); }