Example #1
0
 /// <summary>
 /// This method should be used for creating a brand new table object
 /// </summary>
 /// <param name="Host"></param>
 /// <param name="Alias"></param>
 /// <param name="Dir"></param>
 /// <param name="Columns"></param>
 /// <param name="PageSize"></param>
 /// <param name="ClusterKey"></param>
 public TreeTable(Host Host, string Path, Schema Columns, Key ClusterColumns, BinaryRecordTree.TreeAffinity State, int PageSize)
     : base(Host, Path, Columns, PageSize)
 {
     this._Cluster           = BinaryRecordTree.CreateClusteredIndex(this, ClusterColumns, State);
     this._TableType         = "CLUSTER_SCRIBE";
     this._Header.ClusterKey = ClusterColumns;
 }
Example #2
0
        /// <summary>
        /// This method should be used for creating a table object from an existing table on disk
        /// </summary>
        /// <param name="Host"></param>
        /// <param name="Header"></param>
        /// <param name="ClusterKey"></param>
        public TreeTable(Host Host, TableHeader Header)
            : base(Host, Header)
        {
            if (Header.RootPageID == -1)
            {
                throw new ArgumentException("The root page ID cannot be null");
            }

            // Get the sort key //
            Key k = Header.ClusterKey;

            // Get the root page ID //
            Page root = this.GetPage(Header.RootPageID);

            // Cluster //
            BinaryRecordTree.TreeAffinity x = this._Header.ClusterKeyState;
            this._Cluster = new BinaryRecordTree(this, k, this.Columns, root, this.Header, x);

            this._TableType = "CLUSTER_SCRIBE";
        }
Example #3
0
 /// <summary>
 /// This method should be used for creating a brand new table object
 /// </summary>
 /// <param name="Host"></param>
 /// <param name="Alias"></param>
 /// <param name="Dir"></param>
 /// <param name="Columns"></param>
 /// <param name="ClusterColumns"></param>
 public TreeTable(Host Host, string Path, Schema Columns, Key ClusterColumns, BinaryRecordTree.TreeAffinity State)
     : this(Host, Path, Columns, ClusterColumns, State, Page.DEFAULT_SIZE)
 {
 }
Example #4
0
 /// <summary>
 /// Creates a table with a given index; the page size is defaulted
 /// </summary>
 /// <param name="Alias"></param>
 /// <param name="Alias"></param>
 /// <param name="Columns"></param>
 /// <param name="ClusterColumns"></param>
 /// <param name="State"></param>
 /// <returns></returns>
 public TreeTable CreateTable(string Path, Schema Columns, Key ClusterColumns, BinaryRecordTree.TreeAffinity State)
 {
     return(this.CreateTable(Path, Columns, ClusterColumns, State, Page.DEFAULT_SIZE));
 }
Example #5
0
        /// <summary>
        /// Creates a table with a cluster index
        /// </summary>
        /// <param name="Alias"></param>
        /// <param name="Alias"></param>
        /// <param name="Columns"></param>
        /// <param name="ClusterColumns"></param>
        /// <param name="State"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public TreeTable CreateTable(string Path, Schema Columns, Key ClusterColumns, BinaryRecordTree.TreeAffinity State, int PageSize)
        {
            this._Cache.DropTable(Path);
            TreeTable t = new TreeTable(this, Path, Columns, ClusterColumns, State, PageSize);

            return(t);
        }