Write a BEGIN record for the specified transaction @param tid The transaction that is beginning
(TransactionId tid)
| 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 { |