MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / addTable

Method addTable

src/java/simpledb/common/Catalog.java:91–105  ·  view source on GitHub ↗

Add a new table to the catalog. This table's contents are stored in the specified DbFile. @param file the contents of the table to add; file.getId() is the identfier of this file/tupledesc param for the calls getTupleDesc and getFile @param name the name of the table -- may be an empty string.

(DbFile file, String name, String pkeyField)

Source from the content-addressed store, hash-verified

89 * @param pkeyField the name of the primary key field
90 */
91 public void addTable(DbFile file, String name, String pkeyField) {
92 // some code goes here
93 Table table = new Table(file, name, pkeyField);
94 for(int i=0;i<this.tables.size();i++){
95 Table tmp = this.tables.get(i);
96 if (tmp.getName()==null){
97 continue;
98 }
99 if(tmp.getName().equals(name) || tmp.getFile().getId()==file.getId()){
100 this.tables.set(i,table);
101 return;
102 }
103 }
104 this.tables.add(table);
105 }
106
107 public void addTable(DbFile file, String name) {
108 addTable(file, name, "");

Callers 4

loadSchemaMethod · 0.95
openBTreeFileMethod · 0.45
openHeapFileMethod · 0.45
mainMethod · 0.45

Calls 6

getNameMethod · 0.95
getFileMethod · 0.95
getMethod · 0.80
equalsMethod · 0.65
getIdMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected