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

Method logXactionBegin

src/java/simpledb/storage/LogFile.java:296–311  ·  view source on GitHub ↗

Write a BEGIN record for the specified transaction @param tid The transaction that is beginning

(TransactionId tid)

Source from the content-addressed store, hash-verified

294
295 */
296 public synchronized void logXactionBegin(TransactionId tid)
297 throws IOException {
298 Debug.log("BEGIN");
299 if(tidToFirstLogRecord.get(tid.getId()) != null){
300 System.err.print("logXactionBegin: already began this tid\n");
301 throw new IOException("double logXactionBegin()");
302 }
303 preAppend();
304 raf.writeInt(BEGIN_RECORD);
305 raf.writeLong(tid.getId());
306 raf.writeLong(currentOffset);
307 tidToFirstLogRecord.put(tid.getId(), currentOffset);
308 currentOffset = raf.getFilePointer();
309
310 Debug.log("BEGIN OFFSET = " + currentOffset);
311 }
312
313 /** Checkpoint the log and write a checkpoint record. */
314 public void logCheckpoint() throws IOException {

Callers 1

startMethod · 0.80

Calls 6

logMethod · 0.95
preAppendMethod · 0.95
getMethod · 0.80
printMethod · 0.80
putMethod · 0.80
getIdMethod · 0.65

Tested by

no test coverage detected