|
1 | 1 | using MiniSQL.Library.Models;
|
2 | 2 | using MiniSQL.IndexManager.Models;
|
3 | 3 | using System.Collections.Generic;
|
4 |
| -using System; |
5 | 4 |
|
6 | 5 | namespace MiniSQL.IndexManager.Interfaces
|
7 | 6 | {
|
8 | 7 | public interface IIndexManager
|
9 | 8 | {
|
10 |
| - // when create table |
| 9 | + /// <summary> |
| 10 | + /// use when creating table |
| 11 | + /// </summary> |
| 12 | + /// <returns>The root node of the new B+ tree</returns> |
11 | 13 | BTreeNode OccupyNewTableNode();
|
12 |
| - // when drop table |
| 14 | + /// <summary> |
| 15 | + /// use when dropping table |
| 16 | + /// </summary> |
| 17 | + /// <param name="root">root node of the B+ Tree</param> |
13 | 18 | void RemoveTree(BTreeNode root);
|
14 |
| - // insert cell |
15 |
| - BTreeNode InsertCell(BTreeNode Root, DBRecord key, DBRecord dBRecord); |
16 |
| - // delete cell(s) that satisfy `condition` |
17 |
| - // `keyName` := primary key in table tree; indexed value in index tree |
| 19 | + /// <summary> |
| 20 | + /// insert a row/record/cell |
| 21 | + /// </summary> |
| 22 | + /// <param name="root">the root of the B+ tree</param> |
| 23 | + /// <param name="key">primary key in table tree and indexed column in index tree</param> |
| 24 | + /// <param name="dBRecord">new row of values to insert</param> |
| 25 | + /// <returns>new root node of the B+ tree</returns> |
| 26 | + BTreeNode InsertCell(BTreeNode root, DBRecord key, DBRecord dBRecord); |
| 27 | + /// <summary> |
| 28 | + /// delete cell(s) that satisfy `condition` |
| 29 | + /// </summary> |
| 30 | + /// <param name="root">the root of the B+ tree</param> |
| 31 | + /// <param name="condition">condition to satisfy</param> |
| 32 | + /// <param name="keyName">primary key in table tree; indexed value in index tree</param> |
| 33 | + /// <param name="attributeDeclarations">the names of the columns</param> |
| 34 | + /// <returns>new root node of the B+ tree</returns> |
18 | 35 | BTreeNode DeleteCells(BTreeNode root, Expression condition, string keyName, List<AttributeDeclaration> attributeDeclarations);
|
19 |
| - // return matches that satisfy `condition` |
20 |
| - // `keyName` := primary key in table tree; indexed value in index tree |
| 36 | + /// <summary> |
| 37 | + /// return matches that satisfy `condition` |
| 38 | + /// </summary> |
| 39 | + /// <param name="root">the root of the B+ tree</param> |
| 40 | + /// <param name="condition">condition to satisfy</param> |
| 41 | + /// <param name="keyName">primary key in table tree; indexed value in index tree</param> |
| 42 | + /// <param name="attributeDeclarations">the names of the columns</param> |
| 43 | + /// <returns>matches that satisfy `condition`</returns> |
21 | 44 | List<BTreeCell> FindCells(BTreeNode root, Expression condition, string keyName, List<AttributeDeclaration> attributeDeclarations);
|
| 45 | + /// <summary> |
| 46 | + /// find a row/record/cell by the key value |
| 47 | + /// </summary> |
| 48 | + /// <param name="key">primary key in table tree; indexed value in index tree</param> |
| 49 | + /// <param name="root">the root of the B+ tree</param> |
| 50 | + /// <returns>the matched cell</returns> |
22 | 51 | BTreeCell FindCell(DBRecord key, BTreeNode root);
|
23 |
| - System.Collections.Generic.IEnumerable<BTreeCell> LinearSearch(BTreeNode root); |
| 52 | + /// <summary> |
| 53 | + /// enumerate all leaf nodes of the B+ tree |
| 54 | + /// </summary> |
| 55 | + /// <param name="root">the root of the B+ tree</param> |
| 56 | + /// <returns>each leaf node</returns> |
| 57 | + IEnumerable<BTreeCell> LinearSearch(BTreeNode root); |
24 | 58 | }
|
25 | 59 | }
|
0 commit comments