Exemple #1
0
        /// <summary>
        /// Create a table in this database, with the first shard placed in the first available quorum.
        /// </summary>
        /// <param name="name">The name of the table.</param>
        /// <returns>The <see cref="Scalien.Table"/> object corresponding to the created table.</returns>
        /// <exception cref="SDBPException"/>
        /// <seealso cref="Scalien.Table"/>
        /// <seealso cref="CreateTable(string, Quorum)"/>
        public virtual Table CreateTable(string name)
        {
            List <Quorum> quorums = client.GetQuorums();

            if (quorums.Count == 0)
            {
                throw new SDBPException(Status.SDBP_BADSCHEMA, "No quorums found");
            }
            Quorum quorum = quorums[0];

            return(CreateTable(name, quorum));
        }