Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TODO to placeholder comments #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/java/simpledb/BufferPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class BufferPool {
* @param numPages maximum number of pages in this buffer pool.
*/
public BufferPool(int numPages) {
// some code goes here
// TODO some code goes here
}

public static int getPageSize() {
Expand Down Expand Up @@ -66,7 +66,7 @@ public static void resetPageSize() {
*/
public Page getPage(TransactionId tid, PageId pid, Permissions perm)
throws TransactionAbortedException, DbException {
// some code goes here
// TODO some code goes here
return null;
}

Expand All @@ -80,7 +80,7 @@ public Page getPage(TransactionId tid, PageId pid, Permissions perm)
* @param pid the ID of the page to unlock
*/
public void releasePage(TransactionId tid, PageId pid) {
// some code goes here
// TODO some code goes here
// not necessary for lab1|lab2
}

Expand All @@ -90,13 +90,13 @@ public void releasePage(TransactionId tid, PageId pid) {
* @param tid the ID of the transaction requesting the unlock
*/
public void transactionComplete(TransactionId tid) throws IOException {
// some code goes here
// TODO some code goes here
// not necessary for lab1|lab2
}

/** Return true if the specified transaction has a lock on the specified page */
public boolean holdsLock(TransactionId tid, PageId p) {
// some code goes here
// TODO some code goes here
// not necessary for lab1|lab2
return false;
}
Expand All @@ -110,7 +110,7 @@ public boolean holdsLock(TransactionId tid, PageId p) {
*/
public void transactionComplete(TransactionId tid, boolean commit)
throws IOException {
// some code goes here
// TODO some code goes here
// not necessary for lab1|lab2
}

Expand All @@ -131,7 +131,7 @@ public void transactionComplete(TransactionId tid, boolean commit)
*/
public void insertTuple(TransactionId tid, int tableId, Tuple t)
throws DbException, IOException, TransactionAbortedException {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

Expand All @@ -150,7 +150,7 @@ public void insertTuple(TransactionId tid, int tableId, Tuple t)
*/
public void deleteTuple(TransactionId tid, Tuple t)
throws DbException, IOException, TransactionAbortedException {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

Expand All @@ -160,7 +160,7 @@ public void deleteTuple(TransactionId tid, Tuple t)
* break simpledb if running in NO STEAL mode.
*/
public synchronized void flushAllPages() throws IOException {
// some code goes here
// TODO some code goes here
// not necessary for lab1

}
Expand All @@ -174,7 +174,7 @@ public synchronized void flushAllPages() throws IOException {
are removed from the cache so they can be reused safely
*/
public synchronized void discardPage(PageId pid) {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

Expand All @@ -183,14 +183,14 @@ public synchronized void discardPage(PageId pid) {
* @param pid an ID indicating the page to flush
*/
private synchronized void flushPage(PageId pid) throws IOException {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

/** Write all pages of the specified transaction to disk.
*/
public synchronized void flushPages(TransactionId tid) throws IOException {
// some code goes here
// TODO some code goes here
// not necessary for lab1|lab2
}

Expand All @@ -199,7 +199,7 @@ public synchronized void flushPages(TransactionId tid) throws IOException {
* Flushes the page to disk to ensure dirty pages are updated on disk.
*/
private synchronized void evictPage() throws DbException {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

Expand Down
18 changes: 9 additions & 9 deletions src/java/simpledb/Catalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Catalog {
* Creates a new, empty catalog.
*/
public Catalog() {
// some code goes here
// TODO some code goes here
}

/**
Expand All @@ -36,7 +36,7 @@ public Catalog() {
* @param pkeyField the name of the primary key field
*/
public void addTable(DbFile file, String name, String pkeyField) {
// some code goes here
// TODO some code goes here
}

public void addTable(DbFile file, String name) {
Expand All @@ -59,7 +59,7 @@ public void addTable(DbFile file) {
* @throws NoSuchElementException if the table doesn't exist
*/
public int getTableId(String name) throws NoSuchElementException {
// some code goes here
// TODO some code goes here
return 0;
}

Expand All @@ -70,7 +70,7 @@ public int getTableId(String name) throws NoSuchElementException {
* @throws NoSuchElementException if the table doesn't exist
*/
public TupleDesc getTupleDesc(int tableid) throws NoSuchElementException {
// some code goes here
// TODO some code goes here
return null;
}

Expand All @@ -81,28 +81,28 @@ public TupleDesc getTupleDesc(int tableid) throws NoSuchElementException {
* function passed to addTable
*/
public DbFile getDatabaseFile(int tableid) throws NoSuchElementException {
// some code goes here
// TODO some code goes here
return null;
}

public String getPrimaryKey(int tableid) {
// some code goes here
// TODO some code goes here
return null;
}

public Iterator<Integer> tableIdIterator() {
// some code goes here
// TODO some code goes here
return null;
}

public String getTableName(int id) {
// some code goes here
// TODO some code goes here
return null;
}

/** Delete all tables from the catalog */
public void clear() {
// some code goes here
// TODO some code goes here
}

/**
Expand Down
20 changes: 10 additions & 10 deletions src/java/simpledb/HeapFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class HeapFile implements DbFile {
* file.
*/
public HeapFile(File f, TupleDesc td) {
// some code goes here
// TODO some code goes here
}

/**
Expand All @@ -32,7 +32,7 @@ public HeapFile(File f, TupleDesc td) {
* @return the File backing this HeapFile on disk.
*/
public File getFile() {
// some code goes here
// TODO some code goes here
return null;
}

Expand All @@ -46,7 +46,7 @@ public File getFile() {
* @return an ID uniquely identifying this HeapFile.
*/
public int getId() {
// some code goes here
// TODO some code goes here
throw new UnsupportedOperationException("implement this");
}

Expand All @@ -56,49 +56,49 @@ public int getId() {
* @return TupleDesc of this DbFile.
*/
public TupleDesc getTupleDesc() {
// some code goes here
// TODO some code goes here
throw new UnsupportedOperationException("implement this");
}

// see DbFile.java for javadocs
public Page readPage(PageId pid) {
// some code goes here
// TODO some code goes here
return null;
}

// see DbFile.java for javadocs
public void writePage(Page page) throws IOException {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

/**
* Returns the number of pages in this HeapFile.
*/
public int numPages() {
// some code goes here
// TODO some code goes here
return 0;
}

// see DbFile.java for javadocs
public ArrayList<Page> insertTuple(TransactionId tid, Tuple t)
throws DbException, IOException, TransactionAbortedException {
// some code goes here
// TODO some code goes here
return null;
// not necessary for lab1
}

// see DbFile.java for javadocs
public ArrayList<Page> deleteTuple(TransactionId tid, Tuple t) throws DbException,
TransactionAbortedException {
// some code goes here
// TODO some code goes here
return null;
// not necessary for lab1
}

// see DbFile.java for javadocs
public DbFileIterator iterator(TransactionId tid) {
// some code goes here
// TODO some code goes here
return null;
}

Expand Down
22 changes: 11 additions & 11 deletions src/java/simpledb/HeapPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public HeapPage(HeapPageId id, byte[] data) throws IOException {
@return the number of tuples on this page
*/
private int getNumTuples() {
// some code goes here
// TODO some code goes here
return 0;

}
Expand All @@ -77,7 +77,7 @@ private int getNumTuples() {
*/
private int getHeaderSize() {

// some code goes here
// TODO some code goes here
return 0;

}
Expand Down Expand Up @@ -111,7 +111,7 @@ public void setBeforeImage() {
* @return the PageId associated with this page.
*/
public HeapPageId getId() {
// some code goes here
// TODO some code goes here
throw new UnsupportedOperationException("implement this");
}

Expand Down Expand Up @@ -243,7 +243,7 @@ public static byte[] createEmptyPageData() {
* @param t The tuple to delete
*/
public void deleteTuple(Tuple t) throws DbException {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

Expand All @@ -255,7 +255,7 @@ public void deleteTuple(Tuple t) throws DbException {
* @param t The tuple to add.
*/
public void insertTuple(Tuple t) throws DbException {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

Expand All @@ -264,15 +264,15 @@ public void insertTuple(Tuple t) throws DbException {
* that did the dirtying
*/
public void markDirty(boolean dirty, TransactionId tid) {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

/**
* Returns the tid of the transaction that last dirtied this page, or null if the page is not dirty
*/
public TransactionId isDirty() {
// some code goes here
// TODO some code goes here
// Not necessary for lab1
return null;
}
Expand All @@ -281,23 +281,23 @@ public TransactionId isDirty() {
* Returns the number of empty slots on this page.
*/
public int getNumEmptySlots() {
// some code goes here
// TODO some code goes here
return 0;
}

/**
* Returns true if associated slot on this page is filled.
*/
public boolean isSlotUsed(int i) {
// some code goes here
// TODO some code goes here
return false;
}

/**
* Abstraction to fill or clear a slot on this page.
*/
private void markSlotUsed(int i, boolean value) {
// some code goes here
// TODO some code goes here
// not necessary for lab1
}

Expand All @@ -306,7 +306,7 @@ private void markSlotUsed(int i, boolean value) {
* (note that this iterator shouldn't return tuples in empty slots!)
*/
public Iterator<Tuple> iterator() {
// some code goes here
// TODO some code goes here
return null;
}

Expand Down
Loading