}
public void testInsertUpdateAndLoad() throws Exception
{
SequentialFileFactory factory = new AIOSequentialFileFactory(getTestDir());
JournalImpl impl = new JournalImpl(10 * 1024 * 1024,
AddAndRemoveStressTest.NUMBER_OF_FILES_ON_JOURNAL,
0,
0,
factory,
"hq",
"hq",
1000);
impl.start();
impl.load(AddAndRemoveStressTest.dummyLoader);
for (long i = 1; i <= AddAndRemoveStressTest.NUMBER_OF_MESSAGES; i++)
{
if (i % 10000 == 0)
{
System.out.println("Append " + i);
}
impl.appendAddRecord(i, (byte)21, new SimpleEncoding(40, (byte)'f'), false);
impl.appendUpdateRecord(i, (byte)22, new SimpleEncoding(40, (byte)'g'), false);
}
impl.stop();
factory = new AIOSequentialFileFactory(getTestDir());
impl = new JournalImpl(10 * 1024 * 1024, 10, 0, 0, factory, "hq", "hq", 1000);
impl.start();
impl.load(AddAndRemoveStressTest.dummyLoader);
for (long i = 1; i <= AddAndRemoveStressTest.NUMBER_OF_MESSAGES; i++)
{
if (i % 10000 == 0)
{
System.out.println("Delete " + i);
}
impl.appendDeleteRecord(i, false);
}
impl.stop();
factory = new AIOSequentialFileFactory(getTestDir());
impl = new JournalImpl(10 * 1024 * 1024,
AddAndRemoveStressTest.NUMBER_OF_FILES_ON_JOURNAL,
0,
0,
factory,