/**
* @throws IOException
*/
public void testSingleCommit() throws IOException {
HLog log = new HLog(fs, dir, this.conf, null);
TransactionalHLogManager logMangaer = new TransactionalHLogManager(log, fs,
regionInfo, conf);
// Write columns named 1, 2, 3, etc. and then values of single byte
// 1, 2, 3...
long transactionId = 1;
logMangaer.writeStartToLog(transactionId);
BatchUpdate update1 = new BatchUpdate(row1);
update1.put(col, val1);
logMangaer.writeUpdateToLog(transactionId, update1);
BatchUpdate update2 = new BatchUpdate(row2);
update2.put(col, val2);
logMangaer.writeUpdateToLog(transactionId, update2);
BatchUpdate update3 = new BatchUpdate(row3);
update3.put(col, val3);
logMangaer.writeUpdateToLog(transactionId, update3);
logMangaer.writeCommitToLog(transactionId);
// log.completeCacheFlush(regionName, tableName, logSeqId);
log.close();
Path filename = log.computeFilename(log.getFilenum());
Map<Long, List<BatchUpdate>> commits = logMangaer.getCommitsFromLog(
filename, -1, null);
assertEquals(1, commits.size());