private void testLoggingTransientMemoryPersister() throws Exception {
Sail baseSail = new MemoryStore();
baseSail.initialize();
OutputStream out = new FileOutputStream(new File("/tmp/throughput-test.log"));
RecorderSail sail = new RecorderSail(baseSail, out);
sail.getConfiguration().logReadOperations = false;
//sail.getConfiguration().logTransactions = false;
try {
TweetStore store = new TweetStore(sail);
store.initialize();
try {
final SailConnection sc = baseSail.getConnection();
try {
final TweetPersister p = new TweetPersister(store, null);
Handler<Tweet> h = new Handler<Tweet>() {
public boolean isOpen() {
return p.isOpen();
}
public void handle(final Tweet tweet) throws HandlerException {
try {
sc.clear();
sc.commit();
sc.begin();
} catch (SailException e) {
throw new HandlerException(e);
}
p.handle(tweet);
}
};
stressTest(h, 1000);
} finally {
sc.close();
}
} finally {
store.shutDown();
}
} finally {
sail.shutDown();
}
}