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

Method deleteTuple

src/java/simpledb/storage/BufferPool.java:218–227  ·  view source on GitHub ↗

Remove the specified tuple from the buffer pool. Will acquire a write lock on the page the tuple is removed from and any other pages that are updated. May block if the lock(s) cannot be acquired. Marks any pages that were dirtied by the operation as dirty by calling their markDirty bit, and adds ve

(TransactionId tid, Tuple t)

Source from the content-addressed store, hash-verified

216 * @param t the tuple to delete
217 */
218 public void deleteTuple(TransactionId tid, Tuple t)
219 throws DbException, IOException, TransactionAbortedException {
220 // some code goes here
221 // not necessary for lab1
222 DbFile dbFile = Database.getCatalog().getDatabaseFile(t.getRecordId().getPageId().getTableId());
223 List<Page> pages = dbFile.deleteTuple(tid,t);
224 for(Page page: pages){
225 page.markDirty(true,tid);
226 }
227 }
228
229 /**
230 * Flush all dirty pages to disk.

Callers

nothing calls this directly

Calls 7

getCatalogMethod · 0.95
deleteTupleMethod · 0.95
getTableIdMethod · 0.65
markDirtyMethod · 0.65
getDatabaseFileMethod · 0.45
getPageIdMethod · 0.45
getRecordIdMethod · 0.45

Tested by

no test coverage detected