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

Method logCommit

src/java/simpledb/storage/LogFile.java:179–190  ·  view source on GitHub ↗

Write a commit record to disk for the specified tid, and force the log to disk. @param tid The committing transaction.

(TransactionId tid)

Source from the content-addressed store, hash-verified

177 @param tid The committing transaction.
178 */
179 public synchronized void logCommit(TransactionId tid) throws IOException {
180 preAppend();
181 Debug.log("COMMIT " + tid.getId());
182 //should we verify that this is a live transaction?
183
184 raf.writeInt(COMMIT_RECORD);
185 raf.writeLong(tid.getId());
186 raf.writeLong(currentOffset);
187 currentOffset = raf.getFilePointer();
188 force();
189 tidToFirstLogRecord.remove(tid.getId());
190 }
191
192 /** Write an UPDATE record to disk for the specified tid and page
193 (with provided before and after images.)

Callers 1

transactionCompleteMethod · 0.80

Calls 5

preAppendMethod · 0.95
logMethod · 0.95
forceMethod · 0.95
getIdMethod · 0.65
removeMethod · 0.45

Tested by

no test coverage detected