* @param ready the ForwardedReadyTransaction message to process
* @param sender the sender of the message
* @param shard the transaction's shard actor
- * @param schema
*/
void handleForwardedReadyTransaction(final ForwardedReadyTransaction ready, final ActorRef sender,
final Shard shard) {
cohortEntry.getTransaction().getSnapshot().applyToCursor(new AbstractBatchedModificationsCursor() {
@Override
protected BatchedModifications getModifications() {
- if (newModifications.isEmpty() ||
- newModifications.getLast().getModifications().size() >= maxModificationsPerBatch) {
+ if (newModifications.isEmpty()
+ || newModifications.getLast().getModifications().size() >= maxModificationsPerBatch) {
newModifications.add(new BatchedModifications(from.getTransactionID(), from.getVersion()));
}
}
@Override
- public void onFailure(final Throwable t) {
+ public void onFailure(final Throwable failure) {
log.debug("{}: An exception occurred during canCommit for {}: {}", name,
- cohortEntry.getTransactionID(), t);
+ cohortEntry.getTransactionID(), failure);
cohortCache.remove(cohortEntry.getTransactionID());
- cohortEntry.getReplySender().tell(new Failure(t), cohortEntry.getShard().self());
+ cohortEntry.getReplySender().tell(new Failure(failure), cohortEntry.getShard().self());
}
});
}
}
@Override
- public void onFailure(final Throwable t) {
+ public void onFailure(final Throwable failure) {
log.error("{} An exception occurred while preCommitting transaction {}", name,
- cohortEntry.getTransactionID(), t);
+ cohortEntry.getTransactionID(), failure);
cohortCache.remove(cohortEntry.getTransactionID());
- cohortEntry.getReplySender().tell(new Failure(t), cohortEntry.getShard().self());
+ cohortEntry.getReplySender().tell(new Failure(failure), cohortEntry.getShard().self());
}
});
}
}
@Override
- public void onFailure(final Throwable t) {
+ public void onFailure(final Throwable failure) {
log.error("{}, An exception occurred while committing transaction {}", persistenceId(),
- cohortEntry.getTransactionID(), t);
+ cohortEntry.getTransactionID(), failure);
cohortCache.remove(cohortEntry.getTransactionID());
- sender.tell(new Failure(t), cohortEntry.getShard().self());
+ sender.tell(new Failure(failure), cohortEntry.getShard().self());
}
});
}
doCommit(cohortEntry);
}
+ @SuppressWarnings("checkstyle:IllegalCatch")
void handleAbort(final Identifier transactionID, final ActorRef sender, final Shard shard) {
CohortEntry cohortEntry = cohortCache.remove(transactionID);
if (cohortEntry == null) {
Iterator<CohortEntry> iter = cohortCache.values().iterator();
while (iter.hasNext()) {
CohortEntry cohortEntry = iter.next();
- if(cohortEntry.isFailed()) {
+ if (cohortEntry.isFailed()) {
iter.remove();
}
}