LOG.info("Replay Events " + numResults);
for(WALEntry<RecoverableMemoryChannelEvent> entry : results.getResults()) {
seqidGenerator.set(Math.max(entry.getSequenceID(),seqidGenerator.get()));
}
for(WALEntry<RecoverableMemoryChannelEvent> entry : results.getResults()) {
Transaction transaction = null;
try {
transaction = memoryChannel.getTransaction();
transaction.begin();
memoryChannel.put(entry.getData());
transaction.commit();
} catch(Exception e) {
if(transaction != null) {
try {
transaction.rollback();
} catch(Exception ex) {
LOG.info("Error during rollback", ex);
}
}
Throwables.propagate(e);
} catch(Error e) {
if(transaction != null) {
try {
transaction.rollback();
} catch(Exception ex) {
LOG.info("Error during rollback", ex);
}
}
throw e;
} finally {
if(transaction != null) {
transaction.close();
}
}
}
} catch (IOException e) {
Throwables.propagate(e);