public Client(string[] nodes) { cptr = scaliendb_client.SDBP_Create(); result = null; SDBP_NodeParams nodeParams = new SDBP_NodeParams(nodes.Length); for (int i = 0; i < nodes.Length; i++) nodeParams.AddNode(nodes[i]); int status = scaliendb_client.SDBP_Init(cptr, nodeParams); nodeParams.Close(); }
/// <summary> /// Construct a Client object. Pass in the list of controllers as strings in the form "host:port". /// </summary> /// <param name="nodes">The controllers as a list of strings in the form "host:port".</param> /// <example><code> /// Client client = new Client({"192.168.1.1:7080", "192.168.1.2:7080"}); /// </code></example> public Client(string[] nodes) { cptr = scaliendb_client.SDBP_Create(); result = null; SDBP_NodeParams nodeParams = new SDBP_NodeParams(nodes.Length); for (int i = 0; i < nodes.Length; i++) { nodeParams.AddNode(nodes[i]); } int status = scaliendb_client.SDBP_Init(cptr, nodeParams); nodeParams.Close(); Nodes = nodes; }
public Quorum CreateQuorum(ulong[] nodes) { SDBP_NodeParams nodeParams = new SDBP_NodeParams(nodes.Length); for (int i = 0; i < nodes.Length; i++) { string nodeString = "" + nodes[i]; nodeParams.AddNode(nodeString); } int status = scaliendb_client.SDBP_CreateQuorum(cptr, nodeParams); nodeParams.Close(); CheckResultStatus(status, "Cannot create quorum"); return new Quorum(this, result.GetNumber()); }