internal RepMgrSite(DB_REPMGR_SITE site) { EId = site.eid; Address = new ReplicationHostAddress(site.host, site.port); isConnected = (site.status == DbConstants.DB_REPMGR_CONNECTED); isPeer = (site.flags & DbConstants.DB_REPMGR_PEER) != 0; }
internal RepMgrSite(DB_REPMGR_SITE site) { EId = site.eid; Address = new ReplicationHostAddress(site.host, site.port); maxAcknowledgedLSN = new LSN(site.max_ack_lsn.file, site.max_ack_lsn.offset); isConnected = (site.status == DbConstants.DB_REPMGR_CONNECTED); isElectable = (site.flags & DbConstants.DB_REPMGR_ISELECTABLE) != 0; isPeer = (site.flags & DbConstants.DB_REPMGR_ISPEER) != 0; isView = (site.flags & DbConstants.DB_REPMGR_ISVIEW) != 0; }
public RepConfig() { ackPolicy = AckPolicy.QUORUM; bulk = false; home = ""; host = new ReplicationHostAddress(); priority = 100; remote = new List<RemoteSite>(); startPolicy = StartPolicy.ELECTION; totalSites = 0; verbose = false; }
internal RepMgrSite(DB_REPMGR_SITE site) { EId = site.eid; Address = new ReplicationHostAddress(site.host, site.port); isConnected = (site.status == DbConstants.DB_REPMGR_CONNECTED); }
public void TestConfigAll() { testName = "TestConfigAll"; SetUpTest(true); XmlElement xmlElem = Configuration.TestSetUp( testFixtureName, testName); /* * Open a new environment with all properties, * fields and subsystems configured. */ DatabaseEnvironmentConfig envConig = new DatabaseEnvironmentConfig(); Config(xmlElem, ref envConig, true, true, true, true, true, true); // Configure with methods. ReplicationHostAddress address = new ReplicationHostAddress("127.0.0.0", 11111); envConig.RepSystemCfg.Clockskew(102, 100); envConig.RepSystemCfg.RetransmissionRequest(10, 100); envConig.RepSystemCfg.TransmitLimit(1, 1024); // Open the environment. DatabaseEnvironment env = DatabaseEnvironment.Open( testHome, envConig); // Confirm environment status with its configuration. Confirm(xmlElem, env, true, true, true, true, true, true); // Print statistics of the current environment. env.PrintStats(true, true); // Print statistics of all subsytems. env.PrintSubsystemStats(true, true); env.Close(); }
/// <summary> /// Add a new replication site to the replication manager's list of /// known sites. It is not necessary for all sites in a replication /// group to know about all other sites in the group. /// </summary> /// <remarks> /// Currently, the replication manager framework only supports a single /// client peer, and the last specified peer is used. /// </remarks> /// <param name="host">The remote site's address</param> /// <param name="isPeer"> /// If true, configure client-to-client synchronization with the /// specified remote site. /// </param> public void AddRemoteSite(ReplicationHostAddress host, bool isPeer) { remoteAddrs.Add(host, isPeer); }
public RemoteSite(string host, uint port, bool isPeer) { this.host = new ReplicationHostAddress(host, port); this.isPeer = isPeer; }
public static void ConfirmReplicationHostAddress( XmlElement xmlElem, string name, ReplicationHostAddress address, bool compulsory) { XmlNode xmlNode = XMLReader.GetNode(xmlElem, name); if (xmlNode == null && compulsory == true) throw new ConfigNotFoundException(name); else if (xmlNode != null) { string host = XMLReader.GetNode( (XmlElement)xmlNode, "Host").InnerText; uint port = uint.Parse(XMLReader.GetNode( (XmlElement)xmlNode, "Port").InnerText); Assert.AreEqual(host, address.Host); Assert.AreEqual(port, address.Port); } }
public static bool ConfigReplicationHostAddress( XmlElement xmlElem, string name, ref ReplicationHostAddress address, bool compulsory) { XmlNode xmlNode = XMLReader.GetNode( xmlElem, name); if (xmlNode == null && compulsory == false) return false; else if (xmlNode == null && compulsory == true) throw new ConfigNotFoundException(name); address.Host = XMLReader.GetNode( (XmlElement)xmlNode, "Host").InnerText; address.Port = uint.Parse(XMLReader.GetNode( (XmlElement)xmlNode, "Port").InnerText); return true; }
/// <summary> /// Add a new replication site to the replication manager's list of /// known sites. It is not necessary for all sites in a replication /// group to know about all other sites in the group. /// </summary> /// <remarks> /// Currently, the replication manager framework only supports a single /// client peer, and the last specified peer is used. /// </remarks> /// <param name="Host">The remote site's address</param> /// <param name="isPeer"> /// If true, configure client-to-client synchronization with the /// specified remote site. /// </param> /// <returns>The environment ID assigned to the remote site</returns> public int RepMgrAddRemoteSite( ReplicationHostAddress Host, bool isPeer) { int eidp = 0; dbenv.repmgr_add_remote_site(Host.Host, Host.Port, ref eidp, isPeer ? DbConstants.DB_REPMGR_PEER : 0); return eidp; }
/// <summary> /// Add a new replication site to the replication manager's list of /// known sites. It is not necessary for all sites in a replication /// group to know about all other sites in the group. /// </summary> /// <param name="Host">The remote site's address</param> /// <returns>The environment ID assigned to the remote site</returns> public int RepMgrAddRemoteSite(ReplicationHostAddress Host) { return RepMgrAddRemoteSite(Host, false); }