// 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());
assertTrue(commits.containsKey(transactionId));
assertEquals(3, commits.get(transactionId).size());
List<BatchUpdate> updates = commits.get(transactionId);
update1 = updates.get(0);
assertTrue(Bytes.equals(row1, update1.getRow()));
assertTrue(Bytes.equals(val1, update1.iterator().next().getValue()));
update2 = updates.get(1);
assertTrue(Bytes.equals(row2, update2.getRow()));
assertTrue(Bytes.equals(val2, update2.iterator().next().getValue()));
update3 = updates.get(2);
assertTrue(Bytes.equals(row3, update3.getRow()));
assertTrue(Bytes.equals(val3, update3.iterator().next().getValue()));
}