100 | 
101 | Figure 1: Diagram illustrating classes, methods, and objects used in the parser
102 |
230 | 
231 | Figure 2: Diagram illustrating the histograms you will implement in Lab 5
232 |
For more details about how to use Ant, see the [manual](http://ant.apache.org/manual/). The [Running Ant](http://ant.apache.org/manual/running.html) section provides details about using the `ant` command. However, the quick reference table below should be sufficient for working on the labs. 86 | 87 | Command | Description 88 | --- | --- 89 | ant|Build the default target (for simpledb, this is dist). 90 | ant -projecthelp|List all the targets in `build.xml` with descriptions. 91 | ant dist|Compile the code in src and package it in `dist/simpledb.jar`. 92 | ant test|Compile and run all the unit tests. 93 | ant runtest -Dtest=testname|Run the unit test named `testname`. 94 | ant systemtest|Compile and run all the system tests. 95 | ant runsystest -Dtest=testname|Compile and run the system test named `testname`. 96 | 97 | 98 | If you are under windows system and don't want to run ant tests from command line, you can also run them from eclipse. Right click build.xml, in the targets tab, you can see "runtest" "runsystest" etc. For example, select runtest would be equivalent to "ant runtest" from command line. Arguments such as "-Dtest=testname" can be specified in the "Main" Tab, "Arguments" textbox. Note that you can also create a shortcut to runtest by copying from build.xml, modifying targets and arguments and renaming it to, say, runtest_build.xml. 99 | 100 | ### 1.1. Running end-to-end tests 101 | 102 | We have also provided a set of end-to-end tests that will eventually be used for grading. These tests are structured as JUnit tests that live in the test/simpledb/systemtest directory. To run all the system tests, use the `systemtest` build target: 103 | 104 | ``` 105 | $ ant systemtest 106 | 107 | ... build output ... 108 | 109 | [junit] Testcase: testSmall took 0.017 sec 110 | [junit] Caused an ERROR 111 | [junit] expected to find the following tuples: 112 | [junit] 19128 113 | [junit] 114 | [junit] java.lang.AssertionError: expected to find the following tuples: 115 | [junit] 19128 116 | [junit] 117 | [junit] at simpledb.systemtest.SystemTestUtil.matchTuples(SystemTestUtil.java:122) 118 | [junit] at simpledb.systemtest.SystemTestUtil.matchTuples(SystemTestUtil.java:83) 119 | [junit] at simpledb.systemtest.SystemTestUtil.matchTuples(SystemTestUtil.java:75) 120 | [junit] at simpledb.systemtest.ScanTest.validateScan(ScanTest.java:30) 121 | [junit] at simpledb.systemtest.ScanTest.testSmall(ScanTest.java:40) 122 | 123 | ... more error messages ... 124 | ``` 125 | 126 |
This indicates that this test failed, showing the stack trace where the error was detected. To debug, start by reading the source code where the error occurred. When the tests pass, you will see something like the following: 127 | 128 | ``` 129 | $ ant systemtest 130 | 131 | ... build output ... 132 | 133 | [junit] Testsuite: simpledb.systemtest.ScanTest 134 | [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 7.278 sec 135 | [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 7.278 sec 136 | [junit] 137 | [junit] Testcase: testSmall took 0.937 sec 138 | [junit] Testcase: testLarge took 5.276 sec 139 | [junit] Testcase: testRandom took 1.049 sec 140 | 141 | BUILD SUCCESSFUL 142 | Total time: 52 seconds 143 | ``` 144 | 145 | #### 1.1.1 Creating dummy tables 146 | 147 | It is likely you'll want to create your own tests and your own data tables to test your own implementation of SimpleDB. You can create any .txt file and convert it to a .dat file in SimpleDB's `HeapFile` format using the command: 148 | 149 | ``` 150 | $ java -jar dist/simpledb.jar convert file.txt N 151 | ``` 152 | 153 | where file.txt is the name of the file and N is the number of columns in the file. Notice that file.txt has to be in the following format: 154 | 155 | ``` 156 | int1,int2,...,intN 157 | int1,int2,...,intN 158 | int1,int2,...,intN 159 | int1,int2,...,intN 160 | ``` 161 | 162 | ...where each intN is a non-negative integer. 163 | 164 | To view the contents of a table, use the `print` command: 165 | 166 | ``` 167 | $ java -jar dist/simpledb.jar print file.dat N 168 | ``` 169 | 170 | where file.dat is the name of a table created with the convert command, and N is the number of columns in the file. 171 | 172 | 173 | 174 | ### 1.2. Working in Eclipse 175 | 176 | [Eclipse](http://www.eclipse.org) is a graphical software development environment that you might be more comfortable with working in. The instructions we provide were generated by using Eclipse for Java Developers (not the enterprise edition) with Java 1.7. 177 | 178 | **Setting the Lab Up in Eclipse** 179 | 180 | * Once Eclipse is installed, start it, and note that the first screen asks you to select a location for your workspace (we will refer to this directory as $W). Select the directory containing your simple-db-hw repository. 181 | * In Eclipse, select File->New->Project->Java->Java Project, and push Next. 182 | * Enter "simple-db-hw" as the project name. 183 | * On the same screen that you entered the project name, select "Create project from existing source," and browse to $W/simple-db-hw. 184 | * Click finish, and you should be able to see "simple-db-hw" as a new project in the Project Explorer tab on the left-hand side of your screen. Opening this project reveals the directory structure discussed above - implementation code can be found in "src," and unit tests and system tests found in "test." 185 | 186 | **Note:** that this class assumes that you are using the official Oracle release of Java. This is the default on MacOS X, and for most Windows Eclipse installs; but many Linux distributions default to alternate Java runtimes (like OpenJDK). Please download the latest Java8 updates from [Oracle Website](http://www.oracle.com/technetwork/java/javase/downloads/index.html), and use that Java version. If you don't switch, you may see spurious test failures in some of the performance tests in later labs. 187 | 188 | **Running Individual Unit and System Tests** 189 | 190 | To run a unit test or system test (both are JUnit tests, and can be initialized the same way), go to the Package Explorer tab on the left side of your screen. Under the "simple-db-hw" project, open the "test" directory. Unit tests are found in the "simpledb" package, and system tests are found in the "simpledb.systemtests" package. To run one of these tests, select the test (they are all called *Test.java - don't select TestUtil.java or SystemTestUtil.java), right click on it, select "Run As," and select "JUnit Test." This will bring up a JUnit tab, which will tell you the status of the individual tests within the JUnit test suite, and will show you exceptions and other errors that will help you debug problems. 191 | 192 | **Running Ant Build Targets** 193 | 194 | If you want to run commands such as "ant test" or "ant systemtest," right click on build.xml in the Package Explorer. Select "Run As," and then "Ant Build..." (note: select the option with the ellipsis (...), otherwise you won't be presented with a set of build targets to run). Then, in the "Targets" tab of the next screen, check off the targets you want to run (probably "dist" and one of "test" or "systemtest"). This should run the build targets and show you the results in Eclipse's console window. 195 | 196 | ### 1.3. Implementation hints 197 | 198 | Before beginning to write code, we **strongly encourage** you to read through this entire document to get a feel for the high-level design of SimpleDB. 199 | 200 |
201 | 202 | You will need to fill in any piece of code that is not implemented. It will be obvious where we think you should write code. You may need to add private methods and/or helper classes. You may change APIs, but make sure our [grading](#grading) tests still run and make sure to mention, explain, and defend your decisions in your writeup. 203 | 204 |
205 | 206 | In addition to the methods that you need to fill out for this lab, the class interfaces contain numerous methods that you need not implement until subsequent labs. These will either be indicated per class: 207 | 208 | ```java 209 | // Not necessary for lab1. 210 | public class Insert implements DbIterator { 211 | ``` 212 | 213 | or per method: 214 | 215 | ```Java 216 | public boolean deleteTuple(Tuple t) throws DbException { 217 | // some code goes here 218 | // not necessary for lab1 219 | return false; 220 | } 221 | ``` 222 | 223 | 224 | The code that you submit should compile without having to modify these methods. 225 | 226 |
227 | 228 | We suggest exercises along this document to guide your implementation, but you may find that a different order makes more sense for you. 229 | 230 | **Here's a rough outline of one way you might proceed with your SimpleDB implementation:** 231 | 232 | **** 233 | * Implement the classes to manage tuples, namely Tuple, TupleDesc. We have already implemented Field, IntField, StringField, and Type for you. Since you only need to support integer and (fixed length) string fields and fixed length tuples, these are straightforward. 234 | * Implement the Catalog (this should be very simple). 235 | * Implement the BufferPool constructor and the getPage() method. 236 | * Implement the access methods, HeapPage and HeapFile and associated ID classes. A good portion of these files has already been written for you. 237 | * Implement the operator SeqScan. 238 | * At this point, you should be able to pass the ScanTest system test, which is the goal for this lab. 239 | 240 | *** 241 | 242 | Section 2 below walks you through these implementation steps and the unit tests corresponding to each one in more detail. 243 | 244 | ### 1.4. Transactions, locking, and recovery 245 | 246 | As you look through the interfaces we have provided you, you will see a number of references to locking, transactions, and recovery. You do not need to support these features in this lab, but you should keep these parameters in the interfaces of your code because you will be implementing transactions and locking in a future lab. The test code we have provided you with generates a fake transaction ID that is passed into the operators of the query it runs; you should pass this transaction ID into other operators and the buffer pool. 247 | 248 | ## 2. SimpleDB Architecture and Implementation Guide 249 | 250 | SimpleDB consists of: 251 | 252 | 253 | * Classes that represent fields, tuples, and tuple schemas; 254 | * Classes that apply predicates and conditions to tuples; 255 | * One or more access methods (e.g., heap files) that store relations on disk and provide a way to iterate through tuples of those relations; 256 | * A collection of operator classes (e.g., select, join, insert, delete, etc.) that process tuples; 257 | * A buffer pool that caches active tuples and pages in memory and handles concurrency control and transactions (neither of which you need to worry about for this lab); and, 258 | * A catalog that stores information about available tables and their schemas. 259 | 260 | 261 | SimpleDB does not include many things that you may think of as being a part of a "database." In particular, SimpleDB does not have: 262 | 263 | * (In this lab), a SQL front end or parser that allows you to type queries directly into SimpleDB. Instead, queries are built up by chaining a set of operators together into a hand-built query plan (see [Section 2.7](#query_walkthrough)). We will provide a simple parser for use in later labs. 264 | * Views. 265 | * Data types except integers and fixed length strings. 266 | * (In this lab) Query optimizer. 267 | * (In this lab) Indices. 268 | 269 |
270 | 271 | In the rest of this Section, we describe each of the main components of SimpleDB that you will need to implement in this lab. You should use the exercises in this discussion to guide your implementation. This document is by no means a complete specification for SimpleDB; you will need to make decisions about how to design and implement various parts of the system. Note that for Lab 1 you do not need to implement any operators (e.g., select, join, project) except sequential scan. You will add support for additional operators in future labs. 272 | 273 |
274 | 275 | ### 2.1. The Database Class 276 | 277 | The Database class provides access to a collection of static objects that are the global state of the database. In particular, this includes methods to access the catalog (the list of all the tables in the database), the buffer pool (the collection of database file pages that are currently resident in memory), and the log file. You will not need to worry about the log file in this lab. We have implemented the Database class for you. You should take a look at this file as you will need to access these objects. 278 | 279 | ### 2.2. Fields and Tuples 280 | 281 |
Tuples in SimpleDB are quite basic. They consist of a collection of `Field` objects, one per field in the `Tuple`. `Field` is an interface that different data types (e.g., integer, string) implement. `Tuple` objects are created by the underlying access methods (e.g., heap files, or B-trees), as described in the next section. Tuples also have a type (or schema), called a _tuple descriptor_, represented by a `TupleDesc` object. This object consists of a collection of `Type` objects, one per field in the tuple, each of which describes the type of the corresponding field. 282 | 283 | ### Exercise 1 284 | 285 | **Implement the skeleton methods in:** 286 | *** 287 | * src/simpledb/TupleDesc.java 288 | * src/simpledb/Tuple.java 289 | 290 | *** 291 | 292 | 293 | At this point, your code should pass the unit tests TupleTest and TupleDescTest. At this point, modifyRecordId() should fail because you havn't implemented it yet. 294 | 295 | ### 2.3. Catalog 296 | 297 | The catalog (class `Catalog` in SimpleDB) consists of a list of the tables and schemas of the tables that are currently in the database. You will need to support the ability to add a new table, as well as getting information about a particular table. Associated with each table is a `TupleDesc` object that allows operators to determine the types and number of fields in a table. 298 | 299 | The global catalog is a single instance of `Catalog` that is allocated for the entire SimpleDB process. The global catalog can be retrieved via the method `Database.getCatalog()`, and the same goes for the global buffer pool (using `Database.getBufferPool()`). 300 | 301 | ### Exercise 2 302 | 303 | **Implement the skeleton methods in:** 304 | *** 305 | * src/simpledb/Catalog.java 306 | 307 | *** 308 | 309 | At this point, your code should pass the unit tests in CatalogTest. 310 | 311 | 312 | ### 2.4. BufferPool 313 | 314 |
The buffer pool (class `BufferPool` in SimpleDB) is responsible for caching pages in memory that have been recently read from disk. All operators read and write pages from various files on disk through the buffer pool. It consists of a fixed number of pages, defined by the `numPages` parameter to the `BufferPool` constructor. In later labs, you will implement an eviction policy. For this lab, you only need to implement the constructor and the `BufferPool.getPage()` method used by the SeqScan operator. The BufferPool should store up to `numPages` pages. For this lab, if more than `numPages` requests are made for different pages, then instead of implementing an eviction policy, you may throw a DbException. In future labs you will be required to implement an eviction policy. 315 | 316 | The `Database` class provides a static method, `Database.getBufferPool()`, that returns a reference to the single BufferPool instance for the entire SimpleDB process. 317 | 318 | ### Exercise 3 319 | 320 | **Implement the `getPage()` method in:** 321 | 322 | *** 323 | * src/simpledb/BufferPool.java 324 | 325 | *** 326 | 327 | We have not provided unit tests for BufferPool. The functionality you implemented will be tested in the implementation of HeapFile below. You should use the `DbFile.readPage` method to access pages of a DbFile. 328 | 329 | 330 | 335 | 336 | 345 | 346 | ### 2.5. HeapFile access method 347 | 348 | Access methods provide a way to read or write data from disk that is arranged in a specific way. Common access methods include heap files (unsorted files of tuples) and B-trees; for this assignment, you will only implement a heap file access method, and we have written some of the code for you. 349 | 350 |
351 | 352 | A `HeapFile` object is arranged into a set of pages, each of which consists of a fixed number of bytes for storing tuples, (defined by the constant `BufferPool.DEFAULT_PAGE_SIZE`), including a header. In SimpleDB, there is one `HeapFile` object for each table in the database. Each page in a `HeapFile` is arranged as a set of slots, each of which can hold one tuple (tuples for a given table in SimpleDB are all of the same size). In addition to these slots, each page has a header that consists of a bitmap with one bit per tuple slot. If the bit corresponding to a particular tuple is 1, it indicates that the tuple is valid; if it is 0, the tuple is invalid (e.g., has been deleted or was never initialized.) Pages of `HeapFile` objects are of type `HeapPage` which implements the `Page` interface. Pages are stored in the buffer pool but are read and written by the `HeapFile` class. 353 | 354 |
355 | 356 | SimpleDB stores heap files on disk in more or less the same format they are stored in memory. Each file consists of page data arranged consecutively on disk. Each page consists of one or more bytes representing the header, followed by the _page size_ bytes of actual page content. Each tuple requires _tuple size_ * 8 bits for its content and 1 bit for the header. Thus, the number of tuples that can fit in a single page is: 357 | 358 |
359 | 360 | ` 361 | _tuples per page_ = floor((_page size_ * 8) / (_tuple size_ * 8 + 1)) 362 | ` 363 | 364 |
365 | 366 | Where _tuple size_ is the size of a tuple in the page in bytes. The idea here is that each tuple requires one additional bit of storage in the header. We compute the number of bits in a page (by mulitplying page size by 8), and divide this quantity by the number of bits in a tuple (including this extra header bit) to get the number of tuples per page. The floor operation rounds down to the nearest integer number of tuples (we don't want to store partial tuples on a page!) 367 | 368 |
369 | 370 | Once we know the number of tuples per page, the number of bytes required to store the header is simply: 371 |
372 | 373 | ` 374 | headerBytes = ceiling(tupsPerPage/8) 375 | ` 376 | 377 |
378 | 379 | The ceiling operation rounds up to the nearest integer number of bytes (we never store less than a full byte of header information.) 380 | 381 |
382 | 383 | The low (least significant) bits of each byte represents the status of the slots that are earlier in the file. Hence, the lowest bit of the first byte represents whether or not the first slot in the page is in use. The second lowest bit of the first byte represents whether or not the second slot in the page is in use, and so on. Also, note that the high-order bits of the last byte may not correspond to a slot that is actually in the file, since the number of slots may not be a multiple of 8. Also note that all Java virtual machines are [big-endian](http://en.wikipedia.org/wiki/Endianness). 384 | 385 |
386 | 387 | ### Exercise 4 388 | 389 | 390 | 391 | **Implement the skeleton methods in:** 392 | *** 393 | * src/simpledb/HeapPageId.java 394 | * src/simpledb/RecordID.java 395 | * src/simpledb/HeapPage.java 396 | 397 | *** 398 | 399 | 400 | Although you will not use them directly in Lab 1, we ask you to implement getNumEmptySlots() and isSlotUsed() in HeapPage. These require pushing around bits in the page header. You may find it helpful to look at the other methods that have been provided in HeapPage or in src/simpledb/HeapFileEncoder.java to understand the layout of pages. 401 | 402 | 403 | You will also need to implement an Iterator over the tuples in the page, which may involve an auxiliary class or data structure. 404 | 405 | At this point, your code should pass the unit tests in HeapPageIdTest, RecordIDTest, and HeapPageReadTest. 406 | 407 | 408 |
409 | 410 | After you have implemented HeapPage, you will write methods for HeapFile in this lab to calculate the number of pages in a file and to read a page from the file. You will then be able to fetch tuples from a file stored on disk. 411 | 412 | ### Exercise 5 413 | 414 | **Implement the skeleton methods in:** 415 | 416 | *** 417 | * src/simpledb/HeapFile.java 418 | 419 | *** 420 | 421 | To read a page from disk, you will first need to calculate the correct offset in the file. Hint: you will need random access to the file in order to read and write pages at arbitrary offsets. You should not call BufferPool methods when reading a page from disk. 422 | 423 |
424 | You will also need to implement the `HeapFile.iterator()` method, which should iterate through through the tuples of each page in the HeapFile. The iterator must use the `BufferPool.getPage()` method to access pages in the `HeapFile`. This method loads the page into the buffer pool and will eventually be used (in a later lab) to implement locking-based concurrency control and recovery. Do not load the entire table into memory on the open() call -- this will cause an out of memory error for very large tables. 425 | 426 |
427 | 428 | At this point, your code should pass the unit tests in HeapFileReadTest. 429 | 430 | 431 | ### 2.6. Operators 432 | 433 | Operators are responsible for the actual execution of the query plan. They implement the operations of the relational algebra. In SimpleDB, operators are iterator based; each operator implements the `DbIterator` interface. 434 | 435 |
436 | 437 | Operators are connected together into a plan by passing lower-level operators into the constructors of higher-level operators, i.e., by 'chaining them together.' Special access method operators at the leaves of the plan are responsible for reading data from the disk (and hence do not have any operators below them). 438 | 439 |
440 | 441 | At the top of the plan, the program interacting with SimpleDB simply calls `getNext` on the root operator; this operator then calls `getNext` on its children, and so on, until these leaf operators are called. They fetch tuples from disk and pass them up the tree (as return arguments to `getNext`); tuples propagate up the plan in this way until they are output at the root or combined or rejected by another operator in the plan. 442 | 443 |
444 | 445 | 454 | 455 | For this lab, you will only need to implement one SimpleDB operator. 456 | 457 | ### Exercise 6. 458 | 459 | **Implement the skeleton methods in:** 460 | 461 | *** 462 | * src/simpledb/SeqScan.java 463 | 464 | *** 465 | This operator sequentially scans all of the tuples from the pages of the table specified by the `tableid` in the constructor. This operator should access tuples through the `DbFile.iterator()` method. 466 | 467 |
At this point, you should be able to complete the ScanTest system test. Good work! 468 | 469 | You will fill in other operators in subsequent labs. 470 | 471 | 472 | 473 | ### 2.7. A simple query 474 | 475 | The purpose of this section is to illustrate how these various components are connected together to process a simple query. 476 | 477 | Suppose you have a data file, "some_data_file.txt", with the following contents: 478 | ``` 479 | 1,1,1 480 | 2,2,2 481 | 3,4,4 482 | ``` 483 |
484 | You can convert this into a binary file that SimpleDB can query as follows: 485 |
486 | ```java -jar dist/simpledb.jar convert some_data_file.txt 3``` 487 |
488 | Here, the argument "3" tells conver that the input has 3 columns. 489 |
490 | The following code implements a simple selection query over this file. This code is equivalent to the SQL statement `SELECT * FROM some_data_file`.
491 |
492 | ```
493 | package simpledb;
494 | import java.io.*;
495 |
496 | public class test {
497 |
498 | public static void main(String[] argv) {
499 |
500 | // construct a 3-column table schema
501 | Type types[] = new Type[]{ Type.INT_TYPE, Type.INT_TYPE, Type.INT_TYPE };
502 | String names[] = new String[]{ "field0", "field1", "field2" };
503 | TupleDesc descriptor = new TupleDesc(types, names);
504 |
505 | // create the table, associate it with some_data_file.dat
506 | // and tell the catalog about the schema of this table.
507 | HeapFile table1 = new HeapFile(new File("some_data_file.dat"), descriptor);
508 | Database.getCatalog().addTable(table1, "test");
509 |
510 | // construct the query: we use a simple SeqScan, which spoonfeeds
511 | // tuples via its iterator.
512 | TransactionId tid = new TransactionId();
513 | SeqScan f = new SeqScan(tid, table1.getId());
514 |
515 | try {
516 | // and run it
517 | f.open();
518 | while (f.hasNext()) {
519 | Tuple tup = f.next();
520 | System.out.println(tup);
521 | }
522 | f.close();
523 | Database.getBufferPool().transactionComplete(tid);
524 | } catch (Exception e) {
525 | System.out.println ("Exception : " + e);
526 | }
527 | }
528 |
529 | }
530 | ```
531 |
532 | The table we create has three integer fields. To express this, we create a `TupleDesc` object and pass it an array of `Type` objects, and optionally an array of `String` field names. Once we have created this `TupleDesc`, we initialize a `HeapFile` object representing the table stored in `some_data_file.dat`. Once we have created the table, we add it to the catalog. If this were a database server that was already running, we would have this catalog information loaded. We need to load it explicitly to make this code self-contained.
533 |
534 | Once we have finished initializing the database system, we create a query plan. Our plan consists only of the `SeqScan` operator that scans the tuples from disk. In general, these operators are instantiated with references to the appropriate table (in the case of `SeqScan`) or child operator (in the case of e.g. Filter). The test program then repeatedly calls `hasNext` and `next` on the `SeqScan` operator. As tuples are output from the `SeqScan`, they are printed out on the command line.
535 |
536 | We **strongly recommend** you try this out as a fun end-to-end test that will help you get experience writing your own test programs for simpledb. You should create the file "test.java" in the src/simpledb directory with the code above, and place the `some_data_file.dat` file in the top level directory. Then run:
537 |
538 | ```
539 | ant
540 | java -classpath dist/simpledb.jar simpledb.test
541 | ```
542 |
543 | Note that `ant` compiles `test.java` and generates a new jarfile that contains it.
544 |
545 | ## 3. Logistics
546 |
547 | You must submit your code (see below) as well as a short (2 pages, maximum) writeup describing your approach. This writeup should:
548 |
549 | * Describe any design decisions you made. These may be minimal for Lab 1.
550 | * Discuss and justify any changes you made to the API.
551 | * Describe any missing or incomplete elements of your code.
552 | * Describe how long you spent on the lab, and whether there was anything you found particularly difficult or confusing.
553 |
554 | ### 3.1. Collaboration
555 |
556 | This lab should be manageable for a single person, but if you prefer to work with a partner, this is also OK. Larger groups are not allowed. Please indicate clearly who you worked with, if anyone, on your individual writeup.
557 |
558 | ### 3.2. Submitting your assignment
559 |
564 |
565 | You may submit your code multiple times; we will use the latest version you submit that arrives before the deadline (before 11:59 PM on the due date). Place the write-up in a file called lab1-writeup.txt, which has been created for you in the top level of your simple-db-hw directory.
566 |
567 | You also need to explicitly add any other files you create, such as new *.java files.
568 |
569 | The criteria for your lab being submitted on time is that your code must be **tagged** and **pushed** by the date and time. This means that if one of the TAs or the instructor were to open up GitHub, they would be able to see your solutions on the GitHub web page.
570 |
571 | Just because your code has been commited on your local machine does not mean that it has been **submitted**; it needs to be on GitHub.
572 |
573 | There is a bash script `turnInLab1.sh` in the root level directory of simple-db-hw that commits your changes, deletes any prior tag for the current lab, tags the current commit, and pushes the branch and tag to github. If you are using Linux or Mac OSX, you should be able to run the following:
574 |
575 | ```bash
576 | $ ./turnInLab1.sh
577 | ```
578 |
579 | You should see something like the following output:
580 |
581 | ```bash
582 | $ ./turnInLab1.sh
583 | error: tag 'lab1submit' not found.
584 | remote: warning: Deleting a non-existent ref.
585 | To git@github.com:MIT-DB-Class/homework-solns-2018- 75% of your grade will be based on whether or not your code passes the system test suite we will run over it. These tests will be a superset of the tests we have provided. Before handing in your code, you should make sure it produces no errors (passes all of the tests) from both ant test and ant systemtest.
670 |
671 | **Important:** before testing, we will replace your build.xml and the entire contents of the test directory with our version of these files. This means you cannot change the format of .dat files! You should also be careful changing our APIs. You should test that your code compiles the unmodified tests.
672 |
673 | In other words, we will pull your repo, replace the files mentioned above, compile it, and then grade it. It will look roughly like this:
674 |
675 | ```
676 | [replace build.xml and test]
677 | $ git checkout -- build.xml test\
678 | $ ant test
679 | $ ant systemtest
680 | [additional tests]
681 | ```
682 |
683 | If any of these commands fail, we`ll be unhappy, and, therefore, so will your grade.
684 |
685 | An additional 25% of your grade will be based on the quality of your writeup and our subjective evaluation of your code.
686 |
687 | We`ve had a lot of fun designing this assignment, and we hope you enjoy hacking on it!
688 |
--------------------------------------------------------------------------------