// Over the LAN:
// 1 trans/upload -- 60 t/s
// 100 trans/upload -- 160 t/s
private void testRdfTransactionPersister(final int commitsPerUpload) throws Exception {
AGRepository repo = new AGRepositorySailFactory(TwitLogic.getConfiguration(), false).makeAGRepository();
repo.initialize();
try {
AGRepositoryConnection rc = repo.getConnection();
try {
//rc.begin();
Sail tSail = new MemoryStore();
tSail.initialize();
try {
Sail sail = new AGTransactionSail(tSail, rc, commitsPerUpload);
try {
TweetStore store = new TweetStore(sail);
store.doNotRefreshCoreMetadata();
store.initialize();
try {
final SailConnection tc = tSail.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 {
tc.clear();
tc.commit();
tc.begin();
} catch (SailException e) {
throw new HandlerException(e);
}
p.handle(tweet);
}
};
stressTest(h, 100);
} finally {
tc.close();
}
} finally {
store.shutDown();
}
} finally {
sail.shutDown();
}
} finally {
tSail.shutDown();
}
} finally {
//rc.rollback();
rc.close();
}
} finally {
repo.shutDown();
}
}